From ecc3712ddfe522dad4d6e96c485ec3f6613a902f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 22 Nov 1994 16:31:29 +0000 Subject: [PATCH] Release 941122 Sun Nov 20 18:30:06 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [controls/scroll.c] [include/scroll.h] Rewritten most of scroll-bar code for better Windows look & feel. Implemented EnableScrollBar(). Preliminary keyboard support. * [objects/bitblt.c] Fixed BadMatch error for BitBlt() and StretchBlt() when reading bits from outside the visible region. * [objects/oembitmap.c] [include/bitmaps/obm_*] Use XPM symbolic colors to load bitmaps. This allows the colors of the bitmaps to depend on the system colors. * [tools/make_debug] Made the make_debug script more robust. * [windows/dialog.c] Fixed CheckRadioButton(). * [windows/nonclient.c] A few changes to scroll-bar drawing and tracking. * [windows/winpos.c] Renamed NextWindowFromPoint() to WINPOS_NextWindowFromPoint() to avoid confusion, and optimized it somewhat. Nov 19, 94 Martin Ayotte (wine@trgcorp.mksinfo.qc.ca) * [misc/audio.c] * [misc/mcianim.c] more coding but nothing spectacular. * [misc/mmaux.c] some coding to access '/dev/mixer'. * [misc/midi.c] some coding to read .MID files, but it's not playing yet. Sun Nov 13 19:31:03 1994 James Youngman (mbcstjy@afs.man.ac.uk) * [objects/dib.c] Reimplemented DIB_SetImageBits_RLE8() so that it would cope with bitmaps which don't end 0x00, 0x02 (previously it blew up). This includes some bitmaps output by Paint Shop Pro. Implementation is possibly now too lax. Please see the notes on the function about why. * [controls/desktop.c] The desktop pattern should be painted if the wallpaper doesn't cover the whole screen width OR the whole screen height. Sun Nov 13 00:07:11 MET 1994 Erik Bos * [objects/dib.c] Small bug in DIB_SetImageBits() fixed, bitmaps in 16,24 bpp now work. * [loader/ne_resource.c] [include/resource.h] Some cleanup. Thu Nov 10 20:44:58 1994 Martin von Loewis (martin@cs.csufresno.edu) * [Configure] [rc/sysres.rc] Primitive compile-time support for multiple languages * [rc/sysres_De.rc] New file * [loader/resource.c] LoadBitmap: Recognize end of sysresbm properly * [rc/Imakefile] Rules to compile resources simplified, dependencies changed * [rc/sysresbm.rc] Don't use sysresbm if using XPM * [windows/dialog.c] CreateDialogIndirectParam: Reverse Z-order of controls * [windows/message.c] MSG_TranslateMouseMsg: Fix HTTRANSPARENT handling * [windows/winpos.c] NextWindowFromPoint: New function * [controls/button.c] WM_NCHITTEST: Group Box is HTTRANSPARENT BUTTON_CheckAutoRadioButton: New function BM_SETCHECK: Added call to BUTTON_CheckAutoRadioButton Mon Nov 7 11:20:26 1994 Paul Falstad (pf@zoof.cts.com) * [objects/text.c] Fix hang when using DrawText(..., DT_WORDBREAK) with a word that is too long to break. * [objects/font.c] Don't assume helvetica if there is no font family; let the other font attributes decide what font to use. * [controls/widgets.c] Listboxes and combo boxes need to be notified of double-clicks. * [controls/listbox.c] [include/listbox.h] scrolling to bottom of list box should display last item at the bottom, not at the top. list boxes need to allocate a separate heap for their item data, rather than using the user heap. Otherwise, it's very easy to run out of memory for list box items. removed redundant code in ListBoxAddString(). Implemented simple version of LBS_SORT. Don't put [.] in the list box when using DDL_DIRECTORY. * [controls/combo.c] Combos should pass CBS_SORT onto their list box. * [windows/win.c] If window creation is aborted, remove the window from the linked lists. * [controls/static.c] static controls with SS_ICON were always returning 0 from WM_NCCREATE. Make sure static controls have text to draw before drawing it. --- ChangeLog | 137 ++++ Configure | 3 + Imakefile | 9 +- autoconf.h | 11 +- controls/button.c | 36 +- controls/combo.c | 10 +- controls/desktop.c | 4 +- controls/edit.c | 5 +- controls/listbox.c | 198 ++--- controls/scroll.c | 1701 +++++++++++++++++++++------------------ controls/static.c | 5 +- controls/widgets.c | 8 +- debugger/break.c | 1 + debugger/info.c | 1 + debugger/readline/editline.c | 1 + if1632/relay.c | 5 +- if1632/user.spec | 6 +- include/bitmaps/obm_btncorners | 4 +- include/bitmaps/obm_btsize | 4 +- include/bitmaps/obm_check | 4 +- include/bitmaps/obm_checkboxes | 88 +- include/bitmaps/obm_close | 2 +- include/bitmaps/obm_combo | 4 +- include/bitmaps/obm_mnarrow | 4 +- include/bitmaps/obm_old_close | 4 +- include/bitmaps/obm_old_dnarrow | 4 +- include/bitmaps/obm_old_lfarrow | 4 +- include/bitmaps/obm_old_reduce | 4 +- include/bitmaps/obm_old_restore | 4 +- include/bitmaps/obm_old_rgarrow | 4 +- include/bitmaps/obm_old_uparrow | 4 +- include/bitmaps/obm_old_zoom | 4 +- include/bitmaps/obm_size | 4 +- include/debug.h | 589 +++++++------- include/listbox.h | 1 + include/resource.h | 2 - include/scroll.h | 61 +- include/stddebug.h | 14 +- include/win.h | 5 +- include/windows.h | 254 +++--- loader/ne_image.c | 11 +- loader/ne_resource.c | 353 +++----- loader/resource.c | 4 +- misc/Imakefile | 6 - misc/clipboard.c | 15 +- misc/comm.c | 18 +- misc/dos_fs.c | 31 +- misc/driver.c | 10 +- misc/exec.c | 5 +- misc/file.c | 8 +- misc/keyboard.c | 2 +- misc/profile.c | 4 +- miscemu/int21.c | 4 +- miscemu/int31.c | 4 +- multimedia/Imakefile | 20 + {misc => multimedia}/audio.c | 58 +- {misc => multimedia}/mcianim.c | 8 +- {misc => multimedia}/mcicda.c | 0 {misc => multimedia}/midi.c | 480 ++++++++++- {misc => multimedia}/mmaux.c | 63 +- {misc => multimedia}/mmsystem.c | 21 +- objects/bitblt.c | 56 +- objects/bitmap.c | 8 +- objects/brush.c | 4 +- objects/color.c | 17 +- objects/dib.c | 232 ++++-- objects/font.c | 18 +- objects/gdiobj.c | 6 +- objects/oembitmap.c | 83 +- objects/palette.c | 11 +- objects/pen.c | 6 +- objects/text.c | 9 +- rc/Imakefile | 18 +- rc/sysres.rc | 7 + rc/{sysres.rc => sysres_De.rc} | 524 ++++++------ rc/sysresbm.rc | 115 +-- rc/winerc.c | 2 +- tools/make_debug | 281 ++++--- windows/defwnd.c | 14 +- windows/dialog.c | 37 +- windows/graphics.c | 9 +- windows/message.c | 10 +- windows/nonclient.c | 82 +- windows/painting.c | 14 +- windows/win.c | 20 +- windows/winpos.c | 27 +- 86 files changed, 3469 insertions(+), 2479 deletions(-) rewrite controls/scroll.c (93%) rewrite include/bitmaps/obm_checkboxes (97%) rewrite include/scroll.h (98%) create mode 100644 multimedia/Imakefile rename {misc => multimedia}/audio.c (97%) rename {misc => multimedia}/mcianim.c (98%) rename {misc => multimedia}/mcicda.c (100%) rename {misc => multimedia}/midi.c (67%) rename {misc => multimedia}/mmaux.c (73%) rename {misc => multimedia}/mmsystem.c (98%) copy rc/{sysres.rc => sysres_De.rc} (53%) rewrite tools/make_debug (82%) diff --git a/ChangeLog b/ChangeLog index f73a4aa356d..f9dc5d2ebc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,140 @@ +---------------------------------------------------------------------- +Sun Nov 20 18:30:06 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) + + * [controls/scroll.c] [include/scroll.h] + Rewritten most of scroll-bar code for better Windows look & feel. + Implemented EnableScrollBar(). + Preliminary keyboard support. + + * [objects/bitblt.c] + Fixed BadMatch error for BitBlt() and StretchBlt() when reading + bits from outside the visible region. + + * [objects/oembitmap.c] [include/bitmaps/obm_*] + Use XPM symbolic colors to load bitmaps. This allows the colors + of the bitmaps to depend on the system colors. + + * [tools/make_debug] + Made the make_debug script more robust. + + * [windows/dialog.c] + Fixed CheckRadioButton(). + + * [windows/nonclient.c] + A few changes to scroll-bar drawing and tracking. + + * [windows/winpos.c] + Renamed NextWindowFromPoint() to WINPOS_NextWindowFromPoint() to + avoid confusion, and optimized it somewhat. + +Nov 19, 94 Martin Ayotte (wine@trgcorp.mksinfo.qc.ca) + + * [misc/audio.c] + * [misc/mcianim.c] + more coding but nothing spectacular. + + * [misc/mmaux.c] + some coding to access '/dev/mixer'. + + * [misc/midi.c] + some coding to read .MID files, but it's not playing yet. + +Sun Nov 13 19:31:03 1994 James Youngman (mbcstjy@afs.man.ac.uk) + + * [objects/dib.c] + Reimplemented DIB_SetImageBits_RLE8() so that it would cope with + bitmaps which don't end 0x00, 0x02 (previously it blew up). This + includes some bitmaps output by Paint Shop Pro. Implementation is + possibly now too lax. Please see the notes on the function about + why. + + * [controls/desktop.c] + The desktop pattern should be painted if the wallpaper doesn't + cover the whole screen width OR the whole screen height. + +Sun Nov 13 00:07:11 MET 1994 Erik Bos + + * [objects/dib.c] + Small bug in DIB_SetImageBits() fixed, bitmaps in 16,24 bpp + now work. + + * [loader/ne_resource.c] [include/resource.h] + Some cleanup. + +Thu Nov 10 20:44:58 1994 Martin von Loewis (martin@cs.csufresno.edu) + + * [Configure] + [rc/sysres.rc] + Primitive compile-time support for multiple languages + + * [rc/sysres_De.rc] + New file + + * [loader/resource.c] + LoadBitmap: Recognize end of sysresbm properly + + * [rc/Imakefile] + Rules to compile resources simplified, dependencies changed + + * [rc/sysresbm.rc] + Don't use sysresbm if using XPM + + * [windows/dialog.c] + CreateDialogIndirectParam: Reverse Z-order of controls + + * [windows/message.c] + MSG_TranslateMouseMsg: Fix HTTRANSPARENT handling + + * [windows/winpos.c] + NextWindowFromPoint: New function + + * [controls/button.c] + WM_NCHITTEST: Group Box is HTTRANSPARENT + BUTTON_CheckAutoRadioButton: New function + BM_SETCHECK: Added call to BUTTON_CheckAutoRadioButton + +Mon Nov 7 11:20:26 1994 Paul Falstad (pf@zoof.cts.com) + + * [objects/text.c] + Fix hang when using DrawText(..., DT_WORDBREAK) with a word that + is too long to break. + + * [objects/font.c] + Don't assume helvetica if there is no font family; let the other + font attributes decide what font to use. + + * [controls/widgets.c] + Listboxes and combo boxes need to be notified of double-clicks. + + * [controls/listbox.c] + [include/listbox.h] + + scrolling to bottom of list box should display last item at the + bottom, not at the top. + + list boxes need to allocate a separate heap for their item data, + rather than using the user heap. Otherwise, it's very easy to run + out of memory for list box items. + + removed redundant code in ListBoxAddString(). Implemented simple + version of LBS_SORT. + + Don't put [.] in the list box when using DDL_DIRECTORY. + + * [controls/combo.c] + Combos should pass CBS_SORT onto their list box. + + * [windows/win.c] + If window creation is aborted, remove the window from the + linked lists. + + * [controls/static.c] + static controls with SS_ICON were always returning 0 from + WM_NCCREATE. + + Make sure static controls have text to draw before drawing it. + +---------------------------------------------------------------------- Sun Nov 6 18:52:04 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [objects/oembitmap.c] (New file) diff --git a/Configure b/Configure index da4a11a3224..d4025828eb1 100644 --- a/Configure +++ b/Configure @@ -175,6 +175,9 @@ else fi fi +prompt "Language (En/De)" LANG En +ALLDEFINES="$ALLDEFINES -ALANG\($LANG\)" + NEWBUILD='' if [ "`(domainname)`" = 'amscons.com' ] then diff --git a/Imakefile b/Imakefile index 7c97769fda7..c358d67ef05 100644 --- a/Imakefile +++ b/Imakefile @@ -30,6 +30,7 @@ COMMONSUBDIRS = \ rc \ loader \ misc \ + multimedia \ objects \ test \ windows @@ -50,6 +51,7 @@ COMMONOBJS = \ controls.o \ loader.o \ misc.o \ + multimedia.o \ objects.o \ rc.o \ windows.o @@ -114,6 +116,9 @@ depend:: install:: etags:: - etags `find . -name '*.[chS]'` - + etags `find . -name '*.[chS]' -print` +distclean: clean + $(RM) `find . -name Makefile -print` + echo "/* autoconf.h generated automatically. Run Configure */" >autoconf.h + echo "#error You must run Configure before you can build the makefiles." >>autoconf.h diff --git a/autoconf.h b/autoconf.h index 3309b25ce93..9cb370efd1b 100644 --- a/autoconf.h +++ b/autoconf.h @@ -1,9 +1,2 @@ -/* autoconf.h generated automatically. Run Configure. */ - - - - -#define WINE_INI_GLOBAL "/home/alex/wine/wine.conf" - - -#define AutoDefines -DNEW_LDT_STRUCT +/* autoconf.h generated automatically. Run Configure */ +#error You must run Configure before you can build the makefiles. diff --git a/controls/button.c b/controls/button.c index d20baffd872..2c7fd61e805 100644 --- a/controls/button.c +++ b/controls/button.c @@ -15,11 +15,11 @@ static char Copyright3[] = "Copyright Alexandre Julliard, 1994"; #include "syscolor.h" + /* windows/graphics.c */ +extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size, + int shadow_size, BOOL pressed ); extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest, - int xsrc, int ysrc, int width, int height, - int rop ); /* windows/graphics.c */ -extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int thickness, - BOOL pressed ); /* windows/graphics.c */ + int xsrc, int ysrc, int width, int height, int rop ); extern void DEFWND_SetText( HWND hwnd, LPSTR text ); /* windows/defwnd.c */ @@ -28,6 +28,7 @@ static void CB_Paint( HWND hWnd, HDC hDC, WORD action ); static void GB_Paint( HWND hWnd, HDC hDC, WORD action ); static void UB_Paint( HWND hWnd, HDC hDC, WORD action ); static void OB_Paint( HWND hWnd, HDC hDC, WORD action ); +static void BUTTON_CheckAutoRadioButton(HWND hWnd); #define MAX_BTN_TYPE 12 @@ -178,6 +179,11 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam) } break; + case WM_NCHITTEST: + if(style == BS_GROUPBOX) return HTTRANSPARENT; + lResult = DefWindowProc(hWnd, uMsg, wParam, lParam); + break; + case WM_SETTEXT: DEFWND_SetText( hWnd, (LPSTR)lParam ); PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE ); @@ -226,6 +232,8 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam) infoPtr->state = (infoPtr->state & ~3) | wParam; PAINT_BUTTON( hWnd, style, ODA_SELECT ); } + if(style == BS_AUTORADIOBUTTON && wParam==BUTTON_CHECKED) + BUTTON_CheckAutoRadioButton(hWnd); break; case BM_GETSTATE: @@ -300,7 +308,7 @@ static void PB_Paint( HWND hButton, HDC hDC, WORD action ) rc.left += 2; /* To position the text down and right */ rc.top += 2; } - else GRAPH_DrawReliefRect( hDC, &rc, 2, FALSE ); + else GRAPH_DrawReliefRect( hDC, &rc, 2, 2, FALSE ); /* draw button label, if any: */ text = USER_HEAP_ADDR( wndPtr->hText ); @@ -330,7 +338,7 @@ static void PB_Paint( HWND hButton, HDC hDC, WORD action ) /********************************************************************** - * Check Box & Radion Button Functions + * Check Box & Radio Button Functions */ static void CB_Paint( HWND hWnd, HDC hDC, WORD action ) @@ -388,6 +396,22 @@ static void CB_Paint( HWND hWnd, HDC hDC, WORD action ) /********************************************************************** + * BUTTON_CheckAutoRadioButton + * + * hWnd is checked, uncheck everything else in group + */ +static void BUTTON_CheckAutoRadioButton(HWND hWnd) +{ + HWND parent = GetParent(hWnd); + HWND sibling; + for(sibling = GetNextDlgGroupItem(parent,hWnd,FALSE); + sibling != hWnd; + sibling = GetNextDlgGroupItem(parent,sibling,FALSE)) + SendMessage(sibling,BM_SETCHECK,BUTTON_UNCHECKED,0); +} + + +/********************************************************************** * Group Box Functions */ diff --git a/controls/combo.c b/controls/combo.c index 4aed28adb11..ed8f07d06b4 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -24,8 +24,8 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993"; #include "debug.h" /* windows/graphics.c */ -extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, - int thickness, BOOL pressed ); +extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size, + int shadow_size, BOOL pressed ); extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest, int xsrc, int ysrc, int width, int height, int rop ); @@ -95,6 +95,8 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) dwStyle = WS_POPUP | WS_BORDER | WS_VSCROLL | LBS_NOTIFY; if ((wndPtr->dwStyle & CBS_HASSTRINGS) == CBS_HASSTRINGS) dwStyle |= LBS_HASSTRINGS; + if ((wndPtr->dwStyle & CBS_SORT) == CBS_SORT) + dwStyle |= LBS_SORT; if ((wndPtr->dwStyle & CBS_OWNERDRAWFIXED) == CBS_OWNERDRAWFIXED) dwStyle |= LBS_OWNERDRAWFIXED; if ((wndPtr->dwStyle & CBS_OWNERDRAWVARIABLE) == CBS_OWNERDRAWVARIABLE) @@ -163,7 +165,7 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) rect.left = rect.right - (rect.bottom - rect.top); hDC = GetDC(hwnd); InflateRect(&rect, -1, -1); - GRAPH_DrawReliefRect(hDC, &rect, 1, 1); + GRAPH_DrawReliefRect(hDC, &rect, 1, 1, TRUE); ReleaseDC(hwnd, hDC); wndPtr = WIN_FindWndPtr(hwnd); lphc = ComboGetStorageHeader(hwnd); @@ -194,7 +196,7 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) rect.left = rect.right - (rect.bottom - rect.top); hDC = GetDC(hwnd); InflateRect(&rect, -1, -1); - GRAPH_DrawReliefRect(hDC, &rect, 1, 0); + GRAPH_DrawReliefRect(hDC, &rect, 1, 1, FALSE); ReleaseDC(hwnd, hDC); break; case WM_KEYDOWN: diff --git a/controls/desktop.c b/controls/desktop.c index 920ac232822..53579f13902 100644 --- a/controls/desktop.c +++ b/controls/desktop.c @@ -76,8 +76,8 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr ) /* Paint desktop pattern (only if wall paper does not cover everything) */ if (!infoPtr->hbitmapWallPaper || - (!infoPtr->fTileWallPaper && (infoPtr->bitmapSize.cx < rect.right) && - (infoPtr->bitmapSize.cy < rect.bottom))) + (!infoPtr->fTileWallPaper && ((infoPtr->bitmapSize.cx < rect.right) || + (infoPtr->bitmapSize.cy < rect.bottom)))) { /* Set colors in case pattern is a monochrome bitmap */ SetBkColor( hdc, RGB(0,0,0) ); diff --git a/controls/edit.c b/controls/edit.c index bbaa91743f6..b907f4940f0 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -516,11 +516,8 @@ long EDIT_NCCreateMsg(HWND hwnd, LONG lParam) EDIT_BuildTextPointers(hwnd); } - if ((createStruct->style & WS_VSCROLL) || - (createStruct->style & WS_HSCROLL)) NC_CreateScrollBars(hwnd); - /* ES_AUTOVSCROLL and ES_AUTOHSCROLL are automatically applied if */ - /* the corresponding WM_* message is set */ + /* the corresponding WS_* style is set */ if (createStruct->style & WS_VSCROLL) wndPtr->dwStyle |= ES_AUTOVSCROLL; if (createStruct->style & WS_HSCROLL) diff --git a/controls/listbox.c b/controls/listbox.c index 430609f42fe..185142b2076 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -51,12 +51,18 @@ int ListBoxSetItemHeight(HWND hwnd, WORD wIndex, long height); int ListBoxDefaultItem(HWND hwnd, WND *wndPtr, LPHEADLIST lphl, LPLISTSTRUCT lpls); int ListBoxFindNextMatch(HWND hwnd, WORD wChar); +int ListMaxFirstVisible(LPHEADLIST lphl); #define HasStrings(wndPtr) ( \ ( ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) != LBS_OWNERDRAWFIXED) && \ ((wndPtr->dwStyle & LBS_OWNERDRAWVARIABLE) != LBS_OWNERDRAWVARIABLE) ) || \ ((wndPtr->dwStyle & LBS_HASSTRINGS) == LBS_HASSTRINGS) ) +#define LIST_HEAP_ALLOC(lphl,f,size) ((int)HEAP_Alloc(&lphl->Heap,f,size) & 0xffff) +#define LIST_HEAP_FREE(lphl,handle) (HEAP_Free(&lphl->Heap,LIST_HEAP_ADDR(lphl,handle))) +#define LIST_HEAP_ADDR(lphl,handle) \ + ((void *)((handle) ? ((handle) | ((int)lphl->Heap & 0xffff0000)) : 0)) +#define LIST_HEAP_SIZE 0x10000 /*********************************************************************** * ListBoxWndProc @@ -86,7 +92,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl->hFont = GetStockObject(SYSTEM_FONT); lphl->ColumnsWidth = wndPtr->rectClient.right - wndPtr->rectClient.left; if (wndPtr->dwStyle & WS_VSCROLL) { - SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, TRUE); + SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE); ShowScrollBar(hwnd, SB_VERT, FALSE); } if (wndPtr->dwStyle & WS_HSCROLL) { @@ -100,6 +106,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr); if (lphl == NULL) return 0; ListBoxResetContent(hwnd); + /* XXX need to free lphl->Heap */ free(lphl); *((LPHEADLIST *)&wndPtr->wExtra[1]) = 0; dprintf_listbox(stddeb,"ListBox WM_DESTROY %p !\n", lphl); @@ -117,7 +124,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl->FirstVisible--; break; case SB_LINEDOWN: - if (lphl->FirstVisible < lphl->ItemsCount) + if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) lphl->FirstVisible++; break; case SB_PAGEUP: @@ -125,7 +132,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl->FirstVisible -= lphl->ItemsVisible; break; case SB_PAGEDOWN: - if (lphl->FirstVisible < lphl->ItemsCount) + if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) lphl->FirstVisible += lphl->ItemsVisible; break; case SB_THUMBTRACK: @@ -133,8 +140,8 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) break; } if (lphl->FirstVisible < 1) lphl->FirstVisible = 1; - if (lphl->FirstVisible > lphl->ItemsCount) - lphl->FirstVisible = lphl->ItemsCount; + if (lphl->FirstVisible > ListMaxFirstVisible(lphl)) + lphl->FirstVisible = ListMaxFirstVisible(lphl); if (y != lphl->FirstVisible) { SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE); InvalidateRect(hwnd, NULL, TRUE); @@ -154,7 +161,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl->FirstVisible -= lphl->ItemsPerColumn; break; case SB_LINEDOWN: - if (lphl->FirstVisible < lphl->ItemsCount) + if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) lphl->FirstVisible += lphl->ItemsPerColumn; break; case SB_PAGEUP: @@ -163,7 +170,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) lphl->ItemsPerColumn * lphl->ItemsPerColumn; break; case SB_PAGEDOWN: - if (lphl->FirstVisible < lphl->ItemsCount && + if (lphl->FirstVisible < ListMaxFirstVisible(lphl) && lphl->ItemsPerColumn != 0) lphl->FirstVisible += lphl->ItemsVisible / lphl->ItemsPerColumn * lphl->ItemsPerColumn; @@ -174,8 +181,8 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) break; } if (lphl->FirstVisible < 1) lphl->FirstVisible = 1; - if (lphl->FirstVisible > lphl->ItemsCount) - lphl->FirstVisible = lphl->ItemsCount; + if (lphl->FirstVisible > ListMaxFirstVisible(lphl)) + lphl->FirstVisible = ListMaxFirstVisible(lphl); if (lphl->ItemsPerColumn != 0) { lphl->FirstVisible = lphl->FirstVisible / lphl->ItemsPerColumn * lphl->ItemsPerColumn + 1; @@ -244,7 +251,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) } GetClientRect(hwnd, &rect); if (y > (rect.bottom - 4)) { - if (lphl->FirstVisible < lphl->ItemsCount) { + if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) { lphl->FirstVisible++; if (wndPtr->dwStyle & WS_VSCROLL) SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE); @@ -752,6 +759,8 @@ int CreateListBoxStruct(HWND hwnd) { WND *wndPtr; LPHEADLIST lphl; + int HeapHandle; + void *HeapBase; wndPtr = WIN_FindWndPtr(hwnd); lphl = (LPHEADLIST)malloc(sizeof(HEADLIST)); lphl->lpFirst = NULL; @@ -767,6 +776,9 @@ int CreateListBoxStruct(HWND hwnd) lphl->SelCount = 0; lphl->DrawCtlType = ODT_LISTBOX; lphl->bRedrawFlag = TRUE; + HeapHandle = GlobalAlloc(GMEM_FIXED, LIST_HEAP_SIZE); + HeapBase = GlobalLock(HeapHandle); + HEAP_Init(&lphl->Heap, HeapBase, LIST_HEAP_SIZE); return TRUE; } @@ -798,122 +810,63 @@ void ListBoxAskMeasure(WND *wndPtr, LPHEADLIST lphl, LPLISTSTRUCT lpls) int ListBoxAddString(HWND hwnd, LPSTR newstr) { - WND *wndPtr; - LPHEADLIST lphl; - LPLISTSTRUCT lpls, lplsnew; - HANDLE hItem; - HANDLE hStr; - LPSTR str; + LPHEADLIST lphl; + UINT pos = (UINT) -1; + WND *wndPtr; + lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr); if (lphl == NULL) return LB_ERR; - hItem = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LISTSTRUCT)); - lplsnew = (LPLISTSTRUCT) USER_HEAP_ADDR(hItem); - if (lplsnew == NULL) { - dprintf_listbox(stddeb,"ListBoxAddString() // Bad allocation of new item !\n"); - return LB_ERRSPACE; - } - lpls = lphl->lpFirst; - if (lpls != NULL) { - while(lpls->lpNext != NULL) { - lpls = (LPLISTSTRUCT)lpls->lpNext; - } - lpls->lpNext = lplsnew; - } - else - lphl->lpFirst = lplsnew; - lphl->ItemsCount++; - dprintf_listbox(stddeb,"Items Count = %u\n", lphl->ItemsCount); - hStr = 0; - - ListBoxDefaultItem(hwnd, wndPtr, lphl, lplsnew); - if (HasStrings(wndPtr)) { - hStr = USER_HEAP_ALLOC(GMEM_MOVEABLE, strlen(newstr) + 1); - str = (LPSTR)USER_HEAP_ADDR(hStr); - if (str == NULL) return LB_ERRSPACE; - strcpy(str, newstr); - newstr = str; - lplsnew->itemText = str; - dprintf_listbox(stddeb,"ListBoxAddString // LBS_HASSTRINGS after strcpy '%s'\n", str); - } - else { - lplsnew->itemText = NULL; - lplsnew->dis.itemData = (DWORD)newstr; - } - lplsnew->hMem = hItem; - lplsnew->lpNext = NULL; - lplsnew->dis.itemID = lphl->ItemsCount; - lplsnew->hData = hStr; - if (((wndPtr->dwStyle & LBS_OWNERDRAWVARIABLE) == LBS_OWNERDRAWVARIABLE) || - ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) == LBS_OWNERDRAWFIXED)) - ListBoxAskMeasure(wndPtr, lphl, lplsnew); - if (wndPtr->dwStyle & WS_VSCROLL) - SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, - (lphl->FirstVisible != 1 && lphl->bRedrawFlag)); - if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0) - SetScrollRange(hwnd, SB_HORZ, 1, - lphl->ItemsVisible / lphl->ItemsPerColumn + 1, - (lphl->FirstVisible != 1 && lphl->bRedrawFlag)); - if (lphl->FirstVisible >= (lphl->ItemsCount - lphl->ItemsVisible)) { - InvalidateRect(hwnd, NULL, TRUE); - UpdateWindow(hwnd); - } - if ((lphl->ItemsCount - lphl->FirstVisible) == lphl->ItemsVisible) { - if (wndPtr->dwStyle & WS_VSCROLL) - ShowScrollBar(hwnd, SB_VERT, TRUE); - if (wndPtr->dwStyle & WS_HSCROLL) - ShowScrollBar(hwnd, SB_HORZ, TRUE); - } - return (lphl->ItemsCount - 1); + if (HasStrings(wndPtr) && (wndPtr->dwStyle & LBS_SORT)) { + LPLISTSTRUCT lpls = lphl->lpFirst; + for (pos = 0; lpls; lpls = lpls->lpNext, pos++) + if (strcmp(lpls->itemText, newstr) >= 0) + break; + } + return ListBoxInsertString(hwnd, pos, newstr); } - int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr) { - WND *wndPtr; - LPHEADLIST lphl; - LPLISTSTRUCT lpls, lplsnew; + WND *wndPtr; + LPHEADLIST lphl; + LPLISTSTRUCT *lppls, lplsnew; HANDLE hItem; HANDLE hStr; - LPSTR str; - UINT Count; - dprintf_listbox(stddeb,"ListBoxInsertString(%04X, %d, %p);\n", + LPSTR str; + UINT Count; + + dprintf_listbox(stddeb,"ListBoxInsertString(%04X, %d, %p);\n", hwnd, uIndex, newstr); - if (uIndex == (UINT)-1) return ListBoxAddString(hwnd, newstr); - lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr); - if (lphl == NULL) return LB_ERR; - /* The following line will cause problems if the content of the */ - /* listbox is sorted by the listbox itself */ - if (uIndex == lphl->ItemsCount) return ListBoxAddString(hwnd, newstr); - if (uIndex >= lphl->ItemsCount) return LB_ERR; - lpls = lphl->lpFirst; - if (lpls == NULL) return LB_ERR; - if (uIndex > lphl->ItemsCount) return LB_ERR; - for(Count = 1; Count < uIndex; Count++) { - if (lpls->lpNext == NULL) return LB_ERR; - lpls = (LPLISTSTRUCT)lpls->lpNext; - } - hItem = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LISTSTRUCT)); - lplsnew = (LPLISTSTRUCT) USER_HEAP_ADDR(hItem); + + lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr); + if (lphl == NULL) return LB_ERR; + + if (uIndex == (UINT)-1) + uIndex = lphl->ItemsCount; + if (uIndex > lphl->ItemsCount) return LB_ERR; + lppls = (LPLISTSTRUCT *) &lphl->lpFirst; + + for(Count = 0; Count < uIndex; Count++) { + if (*lppls == NULL) return LB_ERR; + lppls = (LPLISTSTRUCT *) &(*lppls)->lpNext; + } + + hItem = LIST_HEAP_ALLOC(lphl, GMEM_MOVEABLE, sizeof(LISTSTRUCT)); + lplsnew = (LPLISTSTRUCT) LIST_HEAP_ADDR(lphl, hItem); if (lplsnew == NULL) { printf("ListBoxInsertString() // Bad allocation of new item !\n"); return LB_ERRSPACE; } ListBoxDefaultItem(hwnd, wndPtr, lphl, lplsnew); lplsnew->hMem = hItem; - if (uIndex == 0) { - lplsnew->lpNext = lphl->lpFirst; - lphl->lpFirst = lplsnew; - } - else { - lplsnew->lpNext = lpls->lpNext; - lpls->lpNext = lplsnew; - } + lplsnew->lpNext = *lppls; + *lppls = lplsnew; lphl->ItemsCount++; hStr = 0; if (HasStrings(wndPtr)) { - hStr = USER_HEAP_ALLOC(GMEM_MOVEABLE, strlen(newstr) + 1); - str = (LPSTR)USER_HEAP_ADDR(hStr); + hStr = LIST_HEAP_ALLOC(lphl, GMEM_MOVEABLE, strlen(newstr) + 1); + str = (LPSTR)LIST_HEAP_ADDR(lphl, hStr); if (str == NULL) return LB_ERRSPACE; strcpy(str, newstr); newstr = str; @@ -930,11 +883,12 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr) ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) == LBS_OWNERDRAWFIXED)) ListBoxAskMeasure(wndPtr, lphl, lplsnew); if (wndPtr->dwStyle & WS_VSCROLL) - SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, - (lphl->FirstVisible != 1)); + SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), + (lphl->FirstVisible != 1 && lphl->bRedrawFlag)); if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0) SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible / - lphl->ItemsPerColumn + 1, (lphl->FirstVisible != 1)); + lphl->ItemsPerColumn + 1, + (lphl->FirstVisible != 1 && lphl->bRedrawFlag)); if (((lphl->ItemsCount - lphl->FirstVisible) == lphl->ItemsVisible) && (lphl->ItemsVisible != 0)) { if (wndPtr->dwStyle & WS_VSCROLL) ShowScrollBar(hwnd, SB_VERT, TRUE); @@ -946,7 +900,6 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr) UpdateWindow(hwnd); } dprintf_listbox(stddeb,"ListBoxInsertString // count=%d\n", lphl->ItemsCount); -/* return lphl->ItemsCount; */ return uIndex; } @@ -1022,10 +975,10 @@ int ListBoxDeleteString(HWND hwnd, UINT uIndex) } lpls2->lpNext = (LPLISTSTRUCT)lpls->lpNext; lphl->ItemsCount--; - if (lpls->hData != 0) USER_HEAP_FREE(lpls->hData); - if (lpls->hMem != 0) USER_HEAP_FREE(lpls->hMem); + if (lpls->hData != 0) LIST_HEAP_FREE(lphl, lpls->hData); + if (lpls->hMem != 0) LIST_HEAP_FREE(lphl, lpls->hMem); if (wndPtr->dwStyle & WS_VSCROLL) - SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, TRUE); + SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE); if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0) SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible / lphl->ItemsPerColumn + 1, TRUE); @@ -1090,8 +1043,8 @@ int ListBoxResetContent(HWND hwnd) if (i != 0) { dprintf_listbox(stddeb,"ResetContent #%u\n", i); if (lpls2->hData != 0 && lpls2->hData != lpls2->hMem) - USER_HEAP_FREE(lpls2->hData); - if (lpls2->hMem != 0) USER_HEAP_FREE(lpls2->hMem); + LIST_HEAP_FREE(lphl, lpls2->hData); + if (lpls2->hMem != 0) LIST_HEAP_FREE(lphl, lpls2->hMem); } if (lpls == NULL) break; } @@ -1104,7 +1057,7 @@ int ListBoxResetContent(HWND hwnd) SendMessage(lphl->hWndLogicParent, WM_COMMAND, wndPtr->wIDmenu, MAKELONG(hwnd, LBN_SELCHANGE)); if (wndPtr->dwStyle & WS_VSCROLL) - SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, TRUE); + SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE); if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0) SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible / lphl->ItemsPerColumn + 1, TRUE); @@ -1211,7 +1164,8 @@ int ListBoxDirectory(HWND hwnd, UINT attrib, LPSTR filespec) if (!dp->inuse) break; dprintf_listbox(stddeb,"ListBoxDirectory %p '%s' !\n", dp->filename, dp->filename); if (dp->attribute & FA_DIREC) { - if (attrib & DDL_DIRECTORY) { + if (attrib & DDL_DIRECTORY && + strcmp(dp->filename, ".")) { sprintf(temp, "[%s]", dp->filename); if ( (wRet = ListBoxAddString(hwnd, temp)) == LB_ERR) break; } @@ -1427,5 +1381,9 @@ int DlgDirList(HWND hDlg, LPSTR lpPathSpec, return ret; } - - +/* get the maximum value of lphl->FirstVisible */ +int ListMaxFirstVisible(LPHEADLIST lphl) +{ + int m = lphl->ItemsCount-lphl->ItemsVisible+1; + return (m < 1) ? 1 : m; +} diff --git a/controls/scroll.c b/controls/scroll.c dissimilarity index 93% index 74be05004b1..168c964fe8e 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -1,778 +1,923 @@ -/* - * Interface code to SCROLLBAR widget - * - * Copyright Martin Ayotte, 1993 - * - * Small fixes and implemented SB_THUMBPOSITION - * by Peter Broadhurst, 940611 - */ - -static char Copyright[] = "Copyright Martin Ayotte, 1993"; - -#include -#include -#include -#include -#include "windows.h" -#include "sysmetrics.h" -#include "scroll.h" -#include "heap.h" -#include "win.h" -#include "prototypes.h" -#include "stddebug.h" -/* #define DEBUG_SCROLL */ -/* #undef DEBUG_SCROLL */ -#include "debug.h" - - -HBITMAP hUpArrow = 0; -HBITMAP hDnArrow = 0; -HBITMAP hLfArrow = 0; -HBITMAP hRgArrow = 0; -HBITMAP hUpArrowD = 0; -HBITMAP hDnArrowD = 0; -HBITMAP hLfArrowD = 0; -HBITMAP hRgArrowD = 0; - - /* windows/graphics.c */ -extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, - int thickness, BOOL pressed ); - -LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hWnd, WND **wndPtr); -LPHEADSCROLL ScrollBarGetStorageHeader(HWND hWnd); -LPHEADSCROLL GetScrollObjectStruct(HWND hWnd, int nBar); -void ScrollBarButtonDown(HWND hWnd, int nBar, int x, int y); -void ScrollBarButtonUp(HWND hWnd, int nBar, int x, int y); -void ScrollBarMouseMove(HWND hWnd, int nBar, WORD wParam, int x, int y); -void StdDrawScrollBar(HWND hWnd, HDC hDC, int nBar, LPRECT lprect, LPHEADSCROLL lphs); -int CreateScrollBarStruct(HWND hWnd); -void NC_CreateScrollBars(HWND hWnd); -LPHEADSCROLL AllocScrollBar(DWORD dwStyle, int width, int height); - - -/*********************************************************************** - * WIDGETS_ScrollBarWndProc - */ -LONG ScrollBarWndProc( HWND hWnd, WORD message, WORD wParam, LONG lParam ) -{ - WND *wndPtr; - LPHEADSCROLL lphs; - PAINTSTRUCT ps; - HDC hDC; - RECT rect; - LPCREATESTRUCT lpCreat; - POINT *pt; - pt=(POINT*)&lParam; - switch(message) { - case WM_CREATE: - lpCreat = (LPCREATESTRUCT)lParam; - if (lpCreat->style & SBS_VERT) { - if (lpCreat->style & SBS_LEFTALIGN) - SetWindowPos(hWnd, 0, 0, 0, 16, lpCreat->cy, - SWP_NOZORDER | SWP_NOMOVE); - if (lpCreat->style & SBS_RIGHTALIGN) - SetWindowPos(hWnd, 0, lpCreat->x + lpCreat->cx - 16, - lpCreat->y, 16, lpCreat->cy, SWP_NOZORDER); - } - if (lpCreat->style & SBS_HORZ) { - if (lpCreat->style & SBS_TOPALIGN) - SetWindowPos(hWnd, 0, 0, 0, lpCreat->cx, 16, - SWP_NOZORDER | SWP_NOMOVE); - if (lpCreat->style & SBS_BOTTOMALIGN) - SetWindowPos(hWnd, 0, lpCreat->x, - lpCreat->y + lpCreat->cy - 16, - lpCreat->cx, 16, SWP_NOZORDER); - } - CreateScrollBarStruct(hWnd); - dprintf_scroll(stddeb,"ScrollBar Creation !\n"); - return 0; - case WM_DESTROY: - lphs = ScrollBarGetWindowAndStorage(hWnd, &wndPtr); - if (lphs == 0) return 0; - dprintf_scroll(stddeb,"ScrollBar WM_DESTROY %p !\n", lphs); - free(lphs); - *((LPHEADSCROLL *)&wndPtr->wExtra[1]) = 0; - return 0; - - case WM_LBUTTONDOWN: - SetCapture(hWnd); - ScrollBarButtonDown(hWnd, SB_CTL, pt->x,pt->y); - break; - case WM_LBUTTONUP: - ReleaseCapture(); - ScrollBarButtonUp(hWnd, SB_CTL, pt->x,pt->y); - break; - - case WM_MOUSEMOVE: - ScrollBarMouseMove(hWnd, SB_CTL, wParam, pt->x,pt->y); - break; - case WM_KEYDOWN: - case WM_KEYUP: - case WM_CHAR: - lphs = ScrollBarGetWindowAndStorage(hWnd, &wndPtr); - return(SendMessage(wndPtr->hwndParent, message, wParam, lParam)); - - case WM_TIMER: - dprintf_scroll(stddeb,"ScrollBar WM_TIMER wParam=%X lParam=%lX !\n", wParam, lParam); - lphs = ScrollBarGetWindowAndStorage(hWnd, &wndPtr); - KillTimer(hWnd, wParam); - switch(lphs->ButtonDown) { - case 0: - lphs->TimerPending = FALSE; - return 0; - case 1: - case 3: - SendMessage(wndPtr->hwndParent, lphs->Direction, - SB_LINEUP, MAKELONG(0, hWnd)); - break; - case 2: - case 4: - SendMessage(wndPtr->hwndParent, lphs->Direction, - SB_LINEDOWN, MAKELONG(0, hWnd)); - break; - case 5: - SendMessage(wndPtr->hwndParent, lphs->Direction, - SB_PAGEUP, MAKELONG(0, hWnd)); - break; - case 6: - SendMessage(wndPtr->hwndParent, lphs->Direction, - SB_PAGEDOWN, MAKELONG(0, hWnd)); - break; - } - SetTimer(hWnd, 1, 100, NULL); - return 0; - - case WM_SETREDRAW: -#ifdef DEBUG_SCROLL - printf("ScrollBar WM_SETREDRAW hWnd=%04X w=%04X !\n", hWnd, wParam); -#endif - lphs = ScrollBarGetStorageHeader(hWnd); - if (lphs == NULL) return 0; - lphs->bRedrawFlag = wParam; - break; - - case WM_PAINT: - hDC = BeginPaint(hWnd, &ps); - lphs = ScrollBarGetStorageHeader(hWnd); - if (lphs != NULL && lphs->bRedrawFlag) { - GetClientRect(hWnd, &rect); - StdDrawScrollBar(hWnd, hDC, SB_CTL, &rect, lphs); - } - EndPaint(hWnd, &ps); - break; - default: - return DefWindowProc( hWnd, message, wParam, lParam ); - } - return(0); -} - - - -void ScrollBarButtonDown(HWND hWnd, int nBar, int x, int y) -{ - LPHEADSCROLL lphs; - HWND hWndParent; - RECT rect; - int width, height; - LONG dwOwner; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (nBar == SB_CTL) { - hWndParent = GetParent(hWnd); - dwOwner = MAKELONG(0, lphs->hWndOwner); - dprintf_scroll(stddeb,"ScrollBarButtonDown SB_CTL // x=%d y=%d\n", x, y); - } - else { - hWndParent = hWnd; - dwOwner = 0L; - dprintf_scroll(stddeb,"ScrollBarButtonDown SB_?SCROLL // x=%d y=%d\n", x, y); - } -/* - SetFocus(lphs->hWndOwner); -*/ - CopyRect(&rect, &lphs->rect); - dprintf_scroll(stddeb,"ScrollDown / x=%d y=%d left=%d top=%d right=%d bottom=%d \n", - x, y, rect.left, rect.top, rect.right, rect.bottom); - if (lphs->Direction == WM_VSCROLL) { - width = rect.right - rect.left; - if (y <= lphs->rectUp.bottom) { - lphs->ButtonDown = 1; - InvalidateRect(lphs->hWndOwner, &lphs->rectUp, TRUE); - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_LINEUP\n"); - SendMessage(hWndParent, lphs->Direction, - SB_LINEUP, dwOwner); - } - if (y >= lphs->rectDown.top) { - lphs->ButtonDown = 2; - InvalidateRect(lphs->hWndOwner, &lphs->rectDown, TRUE); - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_LINEDOWN\n"); - SendMessage(hWndParent, lphs->Direction, - SB_LINEDOWN, dwOwner); - } - if (y > lphs->rectUp.bottom && y < (lphs->CurPix + width)) { - lphs->ButtonDown = 5; - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_PAGEUP\n"); - SendMessage(hWndParent, lphs->Direction, - SB_PAGEUP, dwOwner); - } - if (y < lphs->rectDown.top && y > (lphs->CurPix + (width << 1))) { - lphs->ButtonDown = 6; - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_PAGEDOWN\n"); - SendMessage(hWndParent, lphs->Direction, - SB_PAGEDOWN, dwOwner); - } - if (lphs->MaxPix > 0 && y > (lphs->CurPix + width) && - y < (lphs->CurPix + (width << 1))) { - lphs->ThumbActive = TRUE; - dprintf_scroll(stddeb,"THUMB DOWN !\n"); - } - } - else { - height = rect.bottom - rect.top; - if (x <= lphs->rectUp.right) { - lphs->ButtonDown = 3; - InvalidateRect(lphs->hWndOwner, &lphs->rectUp, TRUE); - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_LINEUP\n"); - SendMessage(hWndParent, lphs->Direction, - SB_LINEUP, dwOwner); - } - if (x >= lphs->rectDown.left) { - lphs->ButtonDown = 4; - InvalidateRect(lphs->hWndOwner, &lphs->rectDown, TRUE); - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_LINEDOWN\n"); - SendMessage(hWndParent, lphs->Direction, - SB_LINEDOWN, dwOwner); - } - if (x > lphs->rectUp.right && x < (lphs->CurPix + height)) { - lphs->ButtonDown = 5; - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_PAGEUP\n"); - SendMessage(hWndParent, lphs->Direction, - SB_PAGEUP, dwOwner); - } - if (x < lphs->rectDown.left && x > (lphs->CurPix + (height << 1))) { - lphs->ButtonDown = 6; - dprintf_scroll(stddeb,"ScrollBarButtonDown send SB_PAGEDOWN\n"); - SendMessage(hWndParent, lphs->Direction, - SB_PAGEDOWN, dwOwner); - } - if (lphs->MaxPix > 0 && x > (lphs->CurPix + height) && - x < (lphs->CurPix + (height << 1))) { - lphs->ThumbActive = TRUE; - dprintf_scroll(stddeb,"THUMB DOWN !\n"); - } - } - if (lphs->ButtonDown != 0) { - UpdateWindow(lphs->hWndOwner); - if (!lphs->TimerPending && nBar == SB_CTL) { - lphs->TimerPending = TRUE; - SetTimer(lphs->hWndOwner, 1, 500, NULL); - } - } -} - - -void ScrollBarButtonUp(HWND hWnd, int nBar, int x, int y) -{ - LPHEADSCROLL lphs; - RECT rect; - HDC hDC; - dprintf_scroll(stddeb,"ScrollBarButtonUp // x=%d y=%d\n", x, y); - lphs = GetScrollObjectStruct(hWnd, nBar); - if(lphs->ThumbActive) - { - HWND hWndOwner,hWndParent; - if (nBar == SB_CTL) { - hWndParent = GetParent(hWnd); - hWndOwner = lphs->hWndOwner; - } - else { - hWndParent = hWnd; - hWndOwner = 0; - } - - - SendMessage(hWndParent, lphs->Direction, - SB_THUMBPOSITION, MAKELONG(lphs->ThumbVal, hWndOwner)); - lphs->ThumbActive = FALSE; - } - - if (lphs->ButtonDown != 0) { - lphs->ButtonDown = 0; - if (nBar == SB_CTL) { - GetClientRect(lphs->hWndOwner, &rect); - InvalidateRect(lphs->hWndOwner, &rect, TRUE); - UpdateWindow(lphs->hWndOwner); - } - else { - hDC = GetWindowDC(lphs->hWndOwner); - StdDrawScrollBar(lphs->hWndOwner, hDC, nBar, &lphs->rect, lphs); - ReleaseDC(lphs->hWndOwner, hDC); - } - } -} - - -void ScrollBarMouseMove(HWND hWnd, int nBar, WORD wParam, int x, int y) -{ - LPHEADSCROLL lphs; - HWND hWndParent; - HWND hWndOwner; - - if ((wParam & MK_LBUTTON) == 0) return; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (lphs->ThumbActive == 0) return; - if (nBar == SB_CTL) { - hWndParent = GetParent(hWnd); - hWndOwner = lphs->hWndOwner; - dprintf_scroll(stddeb,"ScrollBarButtonMove SB_CTL // x=%d y=%d\n", x, y); - } - else { - hWndParent = hWnd; - hWndOwner = 0; - dprintf_scroll(stddeb,"ScrollBarButtonMove SB_?SCROLL // x=%d y=%d\n", x, y); - } - - if(xrect.left||x>lphs->rect.right|| - yrect.top||y>lphs->rect.bottom) - { - - dprintf_scroll(stddeb,"Rejecting thumb position !\n"); - lphs->ThumbVal=lphs->CurVal;/*revert to last set position*/ - } - else - { - - if (lphs->Direction == WM_VSCROLL) { - int butsiz = lphs->rect.right - lphs->rect.left; - y = y - butsiz - (butsiz >> 1); - } - else { - int butsiz = lphs->rect.bottom - lphs->rect.top; - y = x - butsiz - (butsiz >> 1); - } - if(y<0)y=0; - if(y>lphs->MaxPix)y=lphs->MaxPix; - lphs->ThumbVal = (y * (lphs->MaxVal - lphs->MinVal) / - lphs->MaxPix) + lphs->MinVal; - } - - dprintf_scroll(stddeb,"Scroll WM_MOUSEMOVE val=%d pix=%d\n", - lphs->ThumbVal, y); - SendMessage(hWndParent, lphs->Direction, - SB_THUMBTRACK, MAKELONG(lphs->ThumbVal, hWndOwner)); -} - - -LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hWnd, WND **wndPtr) -{ - WND *Ptr; - LPHEADSCROLL lphs; - *(wndPtr) = Ptr = WIN_FindWndPtr(hWnd); - if (Ptr == 0) { - fprintf(stderr,"Bad Window handle on ScrollBar !\n"); - return 0; - } - lphs = *((LPHEADSCROLL *)&Ptr->wExtra[1]); - return lphs; -} - - -LPHEADSCROLL ScrollBarGetStorageHeader(HWND hWnd) -{ - WND *wndPtr; - LPHEADSCROLL lphs; - wndPtr = WIN_FindWndPtr(hWnd); - if (wndPtr == 0) { - fprintf(stderr,"Bad Window handle on ScrollBar !\n"); - return 0; - } - lphs = *((LPHEADSCROLL *)&wndPtr->wExtra[1]); - return lphs; -} - - - -void StdDrawScrollBar(HWND hWnd, HDC hDC, int nBar, LPRECT lprect, LPHEADSCROLL lphs) -{ - HWND hWndParent; - HBRUSH hBrush; - HDC hMemDC; - HBITMAP hOldBmp; - BITMAP bm; - RECT rect; - UINT w, w2, h, h2; - - if (lphs == NULL) return; - if (!lphs->bRedrawFlag) return; - dprintf_scroll(stddeb,"StdDrawScrollBar nBar=%04X !\n", nBar); - if (lphs->Direction == WM_VSCROLL) - dprintf_scroll(stddeb,"StdDrawScrollBar Vertical left=%d top=%d right=%d bottom=%d !\n", - lprect->left, lprect->top, lprect->right, lprect->bottom); - else - dprintf_scroll(stddeb,"StdDrawScrollBar Horizontal left=%d top=%d right=%d bottom=%d !\n", - lprect->left, lprect->top, lprect->right, lprect->bottom); - if (nBar == SB_CTL) - hWndParent = GetParent(hWnd); - else - hWndParent = lphs->hWndOwner; - hBrush = SendMessage(hWndParent, WM_CTLCOLOR, (WORD)hDC, - MAKELONG(hWnd, CTLCOLOR_SCROLLBAR)); - if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(LTGRAY_BRUSH); - CopyRect(&lphs->rect, lprect); - CopyRect(&lphs->rectUp, lprect); - CopyRect(&lphs->rectDown, lprect); - CopyRect(&rect, lprect); - w = rect.right - rect.left; - h = rect.bottom - rect.top; - if (w == 0 || h == 0) return; - if (lphs->Direction == WM_VSCROLL) { - if (h > 3 * w) - lphs->MaxPix = h - 3 * w; - else - lphs->MaxPix = 0; - if (h > 2 * w) - h2 = w; - else - h2 = (h - 4) / 2; - lphs->rectUp.bottom = h2; - lphs->rectDown.top = rect.bottom - h2; - } - else { - if (w > 3 * h) - lphs->MaxPix = w - 3 * h; - else - lphs->MaxPix = 0; - if (w > 2 * h) - w2 = h; - else - w2 = (w - 4) / 2; - lphs->rectUp.right = w2; - lphs->rectDown.left = rect.right - w2; - } - if (lphs->MaxVal != lphs->MinVal) - lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) / - (lphs->MaxVal - lphs->MinVal); - if(lphs->CurPix <0)lphs->CurPix=0; - if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix; - - hMemDC = CreateCompatibleDC(hDC); - if (lphs->Direction == WM_VSCROLL) { - GetObject(hUpArrow, sizeof(BITMAP), (LPSTR)&bm); - if (lphs->ButtonDown == 1) - hOldBmp = SelectObject(hMemDC, hUpArrowD); - else - hOldBmp = SelectObject(hMemDC, hUpArrow); - StretchBlt(hDC, rect.left, rect.top, w, h2, hMemDC, - 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); - GetObject(hDnArrow, sizeof(BITMAP), (LPSTR)&bm); - if (lphs->ButtonDown == 2) - SelectObject(hMemDC, hDnArrowD); - else - SelectObject(hMemDC, hDnArrow); - StretchBlt(hDC, rect.left, rect.bottom - h2, w, h2, hMemDC, - 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); - rect.top += h2; - rect.bottom -= h2; - } - else { - GetObject(hLfArrow, sizeof(BITMAP), (LPSTR)&bm); - if (lphs->ButtonDown == 3) - hOldBmp = SelectObject(hMemDC, hLfArrowD); - else - hOldBmp = SelectObject(hMemDC, hLfArrow); - StretchBlt(hDC, rect.left, rect.top, w2, h, hMemDC, - 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); - GetObject(hRgArrow, sizeof(BITMAP), (LPSTR)&bm); - if (lphs->ButtonDown == 4) - SelectObject(hMemDC, hRgArrowD); - else - SelectObject(hMemDC, hRgArrow); - StretchBlt(hDC, rect.right - w2, rect.top, w2, h, hMemDC, - 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); - rect.left += w2; - rect.right -= w2; - } - SelectObject( hMemDC, hOldBmp ); - DeleteDC(hMemDC); - FillRect(hDC, &rect, hBrush); - if (lphs->MaxPix != 0) { - if (lphs->Direction == WM_VSCROLL) - SetRect(&rect, rect.left, rect.top + lphs->CurPix, - rect.left + w, rect.top + lphs->CurPix + h2); - else - SetRect(&rect, rect.left + lphs->CurPix, rect.top, - rect.left + lphs->CurPix + w2, rect.top + h); - FrameRect(hDC, &rect, GetStockObject(BLACK_BRUSH)); - InflateRect(&rect, -1, -1); - FillRect(hDC, &rect, GetStockObject(LTGRAY_BRUSH)); - GRAPH_DrawReliefRect(hDC, &rect, 2, 0); - InflateRect(&rect, -3, -3); - GRAPH_DrawReliefRect(hDC, &rect, 1, 1); - } -} - - - -int CreateScrollBarStruct(HWND hWnd) -{ - int width, height; - WND *wndPtr; - LPHEADSCROLL lphs; - wndPtr = WIN_FindWndPtr(hWnd); - width = wndPtr->rectClient.right - wndPtr->rectClient.left; - height = wndPtr->rectClient.bottom - wndPtr->rectClient.top; - if (width <= height) - lphs = AllocScrollBar(WS_VSCROLL, width, height); - else - lphs = AllocScrollBar(WS_HSCROLL, width, height); - dprintf_scroll(stddeb,"CreateScrollBarStruct %p !\n", lphs); - *((LPHEADSCROLL *)&wndPtr->wExtra[1]) = lphs; - lphs->hWndOwner = hWnd; - CopyRect(&lphs->rect, &wndPtr->rectClient); - return TRUE; -} - - - -LPHEADSCROLL AllocScrollBar(DWORD dwStyle, int width, int height) -{ - LPHEADSCROLL lphs; - if (hUpArrow == (HBITMAP)NULL) - hUpArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWI)); - if (hDnArrow == (HBITMAP)NULL) - hDnArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWI)); - if (hLfArrow == (HBITMAP)NULL) - hLfArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWI)); - if (hRgArrow == (HBITMAP)NULL) - hRgArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWI)); - if (hUpArrowD == (HBITMAP)NULL) - hUpArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWD)); - if (hDnArrowD == (HBITMAP)NULL) - hDnArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWD)); - if (hLfArrowD == (HBITMAP)NULL) - hLfArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWD)); - if (hRgArrowD == (HBITMAP)NULL) - hRgArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWD)); - lphs = (LPHEADSCROLL)malloc(sizeof(HEADSCROLL)); - if (lphs == 0) { - fprintf(stderr,"Bad Memory Alloc on ScrollBar !\n"); - return NULL; - } - lphs->bRedrawFlag = TRUE; - lphs->ThumbActive = FALSE; - lphs->TimerPending = FALSE; - lphs->ButtonDown = 0; - lphs->MinVal = 0; - lphs->MaxVal = 100; - lphs->CurVal = 0; - lphs->CurPix = 0; - SetRect(&lphs->rect, 0, 0, width, height); - if (dwStyle & WS_VSCROLL) { - if (height > 3 * width) - lphs->MaxPix = height - 3 * width; - else - lphs->MaxPix = 0; - lphs->Direction = WM_VSCROLL; - } - else { - if (width > 3 * height) - lphs->MaxPix = width - 3 * height; - else - lphs->MaxPix = 0; - lphs->Direction = WM_HSCROLL; - } - if (lphs->MaxPix < 1) lphs->MaxPix = 1; - return lphs; -} - - -void NC_CreateScrollBars(HWND hWnd) -{ - RECT rect; - int width, height; - WND *wndPtr; - LPHEADSCROLL lphs; - wndPtr = WIN_FindWndPtr(hWnd); - GetWindowRect(hWnd, &rect); - width = rect.right - rect.left; - height = rect.bottom - rect.top; - if (wndPtr->dwStyle & WS_VSCROLL) { - if (wndPtr->dwStyle & WS_HSCROLL) height -= SYSMETRICS_CYHSCROLL; - lphs = AllocScrollBar(WS_VSCROLL, SYSMETRICS_CXVSCROLL, height); - dprintf_scroll(stddeb,"NC_CreateScrollBars Vertical %p !\n", - lphs); - lphs->rect.left = width - SYSMETRICS_CYVSCROLL; - lphs->rect.right = width; - lphs->hWndOwner = hWnd; - wndPtr->VScroll = lphs; - wndPtr->scroll_flags |= 0x0001; - if (wndPtr->dwStyle & WS_HSCROLL) height += SYSMETRICS_CYHSCROLL; - } - if (wndPtr->dwStyle & WS_HSCROLL) { - if (wndPtr->dwStyle & WS_VSCROLL) width -= SYSMETRICS_CYVSCROLL; - lphs = AllocScrollBar(WS_HSCROLL, width, SYSMETRICS_CYHSCROLL); - dprintf_scroll(stddeb,"NC_CreateScrollBars Horizontal %p !\n", lphs); - lphs->rect.top = height - SYSMETRICS_CYHSCROLL; - lphs->rect.bottom = height; - lphs->hWndOwner = hWnd; - wndPtr->HScroll = lphs; - wndPtr->scroll_flags |= 0x0002; - } -} - - -/************************************************************************* - * GetScrollObjectStruct [internal] - */ -LPHEADSCROLL GetScrollObjectStruct(HWND hWnd, int nBar) -{ - WND *wndPtr; - if (nBar != SB_CTL) { - wndPtr = WIN_FindWndPtr(hWnd); - if (nBar == SB_VERT) return (LPHEADSCROLL)wndPtr->VScroll; - if (nBar == SB_HORZ) return (LPHEADSCROLL)wndPtr->HScroll; - return NULL; - } - return ScrollBarGetStorageHeader(hWnd); -} - - -/************************************************************************* - * SetScrollPos [USER.62] - */ -int SetScrollPos(HWND hWnd, int nBar, int nPos, BOOL bRedraw) -{ - LPHEADSCROLL lphs; - HDC hDC; - int nRet; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (lphs == NULL) return 0; - nRet = lphs->CurVal; - lphs->CurVal = (short)nPos; - if (lphs->MaxVal != lphs->MinVal) - lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) / - (lphs->MaxVal - lphs->MinVal); - if(lphs->CurPix <0)lphs->CurPix=0; - - if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix; - dprintf_scroll(stddeb,"SetScrollPos val=%d pixval=%d pixmax%d\n", - (short)nPos, lphs->CurPix, lphs->MaxPix); - dprintf_scroll(stddeb,"SetScrollPos min=%d max=%d\n", - lphs->MinVal, lphs->MaxVal); - if ((bRedraw) && (IsWindowVisible(lphs->hWndOwner))) { - if (nBar == SB_CTL) { - InvalidateRect(lphs->hWndOwner, &lphs->rect, TRUE); - UpdateWindow(lphs->hWndOwner); - } - else { - if (lphs->rect.right != 0 && lphs->rect.bottom != 0) { - hDC = GetWindowDC(lphs->hWndOwner); - StdDrawScrollBar(lphs->hWndOwner, hDC, nBar, &lphs->rect, lphs); - ReleaseDC(lphs->hWndOwner, hDC); - } - } - } - return nRet; -} - - - -/************************************************************************* - * GetScrollPos [USER.63] - */ -int GetScrollPos(HWND hWnd, int nBar) -{ - LPHEADSCROLL lphs; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (lphs == NULL) return 0; - return lphs->CurVal; -} - - - -/************************************************************************* - * SetScrollRange [USER.64] - */ -void SetScrollRange(HWND hWnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw) -{ - LPHEADSCROLL lphs; - HDC hDC; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (lphs == NULL) return; - -/* should a bad range be rejected here? - */ - lphs->MinVal = (short)MinPos; - lphs->MaxVal = (short)MaxPos; - if (lphs->MaxVal != lphs->MinVal) - lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) / - (lphs->MaxVal - lphs->MinVal); - if(lphs->CurPix <0)lphs->CurPix=0; - if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix; - dprintf_scroll(stddeb,"SetScrollRange min=%d max=%d\n", - lphs->MinVal, lphs->MaxVal); - if ((bRedraw) && (IsWindowVisible(lphs->hWndOwner))) { - if (nBar == SB_CTL) { - InvalidateRect(lphs->hWndOwner, &lphs->rect, TRUE); - UpdateWindow(lphs->hWndOwner); - } - else { - if (lphs->rect.right != 0 && lphs->rect.bottom != 0) { - hDC = GetWindowDC(lphs->hWndOwner); - StdDrawScrollBar(lphs->hWndOwner, hDC, nBar, &lphs->rect, lphs); - ReleaseDC(lphs->hWndOwner, hDC); - } - } - } -} - - - -/************************************************************************* - * GetScrollRange [USER.65] - */ -void GetScrollRange(HWND hWnd, int nBar, LPINT lpMin, LPINT lpMax) -{ - LPHEADSCROLL lphs; - lphs = GetScrollObjectStruct(hWnd, nBar); - if (lphs == NULL) return; - *lpMin = lphs->MinVal; - *lpMax = lphs->MaxVal; -} - - - -/************************************************************************* - * ShowScrollBar [USER.267] - */ -void ShowScrollBar(HWND hWnd, WORD wBar, BOOL bFlag) -{ - WND *wndPtr; - dprintf_scroll(stddeb,"ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", - hWnd, wBar, bFlag); - if (wBar == SB_CTL) { - if (bFlag) - ShowWindow(hWnd, SW_SHOW); - else - ShowWindow(hWnd, SW_HIDE); - return; - } - wndPtr = WIN_FindWndPtr(hWnd); - if ((wBar == SB_VERT) || (wBar == SB_BOTH)) { - if (bFlag) - wndPtr->scroll_flags |= 1; - else - wndPtr->scroll_flags &= ~1; - } - if ((wBar == SB_HORZ) || (wBar == SB_BOTH)) { - if (bFlag) - wndPtr->scroll_flags |= 2; - else - wndPtr->scroll_flags &= ~2; - } - SetWindowPos(hWnd, 0, 0, 0, 0, 0, - SWP_NOZORDER | SWP_NOMOVE | - SWP_NOSIZE | SWP_FRAMECHANGED); -} - - - +/* + * Interface code to SCROLLBAR widget + * + * Copyright Martin Ayotte, 1993 + * + * Small fixes and implemented SB_THUMBPOSITION + * by Peter Broadhurst, 940611 + */ + +static char Copyright[] = "Copyright Martin Ayotte, 1993"; + +#include +#include +#include +#include +#include "windows.h" +#include "syscolor.h" +#include "sysmetrics.h" +#include "scroll.h" +#include "user.h" +#include "win.h" +#include "stddebug.h" +/* #define DEBUG_SCROLL */ +/* #undef DEBUG_SCROLL */ +#include "debug.h" + + +static HBITMAP hUpArrow = 0; +static HBITMAP hDnArrow = 0; +static HBITMAP hLfArrow = 0; +static HBITMAP hRgArrow = 0; +static HBITMAP hUpArrowD = 0; +static HBITMAP hDnArrowD = 0; +static HBITMAP hLfArrowD = 0; +static HBITMAP hRgArrowD = 0; +static HBITMAP hUpArrowI = 0; +static HBITMAP hDnArrowI = 0; +static HBITMAP hLfArrowI = 0; +static HBITMAP hRgArrowI = 0; + +#define TOP_ARROW(flags,pressed) \ + (((flags)&ESB_DISABLE_UP) ? hUpArrowI : ((pressed) ? hUpArrowD:hUpArrow)) +#define BOTTOM_ARROW(flags,pressed) \ + (((flags)&ESB_DISABLE_DOWN) ? hDnArrowI : ((pressed) ? hDnArrowD:hDnArrow)) +#define LEFT_ARROW(flags,pressed) \ + (((flags)&ESB_DISABLE_LEFT) ? hLfArrowI : ((pressed) ? hLfArrowD:hLfArrow)) +#define RIGHT_ARROW(flags,pressed) \ + (((flags)&ESB_DISABLE_RIGHT) ? hRgArrowI : ((pressed) ? hRgArrowD:hRgArrow)) + + + /* windows/graphics.c */ +extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size, + int shadow_size, BOOL pressed ); + + /* Minimum size of the rectangle between the arrows */ +#define SCROLL_MIN_RECT 4 + + /* Delay (in ms) before first repetition when holding the button down */ +#define SCROLL_FIRST_DELAY 200 + + /* Delay (in ms) between scroll repetitions */ +#define SCROLL_REPEAT_DELAY 100 + + /* Scroll timer id */ +#define SCROLL_TIMER 0 + + /* Scroll-bar hit testing */ +enum SCROLL_HITTEST +{ + SCROLL_NOWHERE, /* Outside the scroll bar */ + SCROLL_TOP_ARROW, /* Top or left arrow */ + SCROLL_TOP_RECT, /* Rectangle between the top arrow and the thumb */ + SCROLL_THUMB, /* Thumb rectangle */ + SCROLL_BOTTOM_RECT, /* Rectangle between the thumb and the bottom arrow */ + SCROLL_BOTTOM_ARROW /* Bottom or right arrow */ +}; + + +/*********************************************************************** + * SCROLL_LoadBitmaps + */ +static void SCROLL_LoadBitmaps(void) +{ + hUpArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROW)); + hDnArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROW)); + hLfArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROW)); + hRgArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROW)); + hUpArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWD)); + hDnArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWD)); + hLfArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWD)); + hRgArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWD)); + hUpArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWI)); + hDnArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWI)); + hLfArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWI)); + hRgArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWI)); +} + + +/*********************************************************************** + * SCROLL_GetScrollInfo + */ +static SCROLLINFO *SCROLL_GetScrollInfo( HWND hwnd, int nBar ) +{ + HANDLE handle; + WND *wndPtr = WIN_FindWndPtr( hwnd ); + + switch(nBar) + { + case SB_HORZ: handle = wndPtr->hHScroll; break; + case SB_VERT: handle = wndPtr->hVScroll; break; + case SB_CTL: return (SCROLLINFO *)wndPtr->wExtra; + default: return NULL; + } + + if (!handle) /* Create the info structure if needed */ + { + if ((handle = USER_HEAP_ALLOC( GMEM_MOVEABLE, sizeof(SCROLLINFO) ))) + { + SCROLLINFO *infoPtr = (SCROLLINFO *) USER_HEAP_ADDR( handle ); + infoPtr->MinVal = infoPtr->CurVal = 0; + infoPtr->MaxVal = 100; + infoPtr->flags = ESB_ENABLE_BOTH; + if (nBar == SB_HORZ) wndPtr->hHScroll = handle; + else wndPtr->hVScroll = handle; + } + if (!hUpArrow) SCROLL_LoadBitmaps(); + } + return (SCROLLINFO *) USER_HEAP_ADDR( handle ); +} + + +/*********************************************************************** + * SCROLL_GetScrollBarRect + * + * Compute the scroll bar rectangle, in drawing coordinates (i.e. client + * coords for SB_CTL, window coords for SB_VERT and SB_HORZ). + * 'arrowSize' returns the width or height of an arrow (depending on the + * orientation of the scrollbar), and 'thumbPos' returns the position of + * the thumb relative to the left or to the top. + * Return TRUE if the scrollbar is vertical, FALSE if horizontal. + */ +static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT *lprect, + WORD *arrowSize, WORD *thumbPos ) +{ + int pixels; + BOOL vertical; + WND *wndPtr = WIN_FindWndPtr( hwnd ); + + switch(nBar) + { + case SB_HORZ: + lprect->left = wndPtr->rectClient.left - wndPtr->rectWindow.left - 1; + lprect->top = wndPtr->rectClient.bottom - wndPtr->rectWindow.top; + lprect->right = wndPtr->rectClient.right - wndPtr->rectWindow.left +1; + lprect->bottom = lprect->top + SYSMETRICS_CYHSCROLL + 1; + vertical = FALSE; + break; + + case SB_VERT: + lprect->left = wndPtr->rectClient.right - wndPtr->rectWindow.left; + lprect->top = wndPtr->rectClient.top - wndPtr->rectWindow.top - 1; + lprect->right = lprect->left + SYSMETRICS_CXVSCROLL + 1; + lprect->bottom = wndPtr->rectClient.bottom - wndPtr->rectWindow.top +1; + vertical = TRUE; + break; + + case SB_CTL: + GetClientRect( hwnd, lprect ); + vertical = ((wndPtr->dwStyle & SBS_VERT) != 0); + break; + } + + if (vertical) pixels = lprect->bottom - lprect->top; + else pixels = lprect->right - lprect->left; + + if (pixels > 2*SYSMETRICS_CXVSCROLL + SCROLL_MIN_RECT) + { + *arrowSize = SYSMETRICS_CXVSCROLL; + } + else if (pixels > SCROLL_MIN_RECT) + { + *arrowSize = (pixels - SCROLL_MIN_RECT) / 2; + } + else *arrowSize = 0; + + if ((pixels -= 3*SYSMETRICS_CXVSCROLL+1) > 0) + { + SCROLLINFO *info = SCROLL_GetScrollInfo( hwnd, nBar ); + if ((info->flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) + *thumbPos = 0; + else if (info->MinVal == info->MaxVal) + *thumbPos = *arrowSize; + else + *thumbPos = *arrowSize + pixels * (info->CurVal - info->MinVal) / + (info->MaxVal - info->MinVal); + } + else *thumbPos = 0; + return vertical; +} + + +/*********************************************************************** + * SCROLL_GetThumbVal + * + * Compute the current scroll position based on the thumb position in pixels + * from the top of the scroll-bar. + */ +static UINT SCROLL_GetThumbVal( SCROLLINFO *infoPtr, RECT *rect, + WORD arrowSize, BOOL vertical, WORD pos ) +{ + int pixels = vertical ? rect->bottom-rect->top : rect->right-rect->left; + if ((pixels -= 3*SYSMETRICS_CXVSCROLL+1) <= 0) return infoPtr->MinVal; + pos = max( 0, pos - SYSMETRICS_CXVSCROLL ); + if (pos > pixels) pos = pixels; + dprintf_scroll(stddeb,"GetThumbVal: pos=%d ret=%d\n", pos, + (infoPtr->MinVal + + (UINT)(((int)pos * (infoPtr->MaxVal-infoPtr->MinVal) + pixels/2) + / pixels)) ); + return (infoPtr->MinVal + + (UINT)(((int)pos * (infoPtr->MaxVal-infoPtr->MinVal) + pixels/2) + / pixels)); +} + + +/*********************************************************************** + * SCROLL_HitTest + * + * Scroll-bar hit testing (don't confuse this with WM_NCHITTEST!). + */ +static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, int nBar, POINT pt ) +{ + WORD arrowSize, thumbPos; + RECT rect; + + BOOL vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, + &arrowSize, &thumbPos ); + if (!PtInRect( &rect, pt )) return SCROLL_NOWHERE; + + if (vertical) + { + if (pt.y <= rect.top + arrowSize + 1) return SCROLL_TOP_ARROW; + if (pt.y >= rect.bottom - arrowSize) return SCROLL_BOTTOM_ARROW; + if (!thumbPos) return SCROLL_TOP_RECT; + pt.y -= rect.top; + if (pt.y < (INT)thumbPos) return SCROLL_TOP_RECT; + if (pt.y > thumbPos+SYSMETRICS_CYHSCROLL) return SCROLL_BOTTOM_RECT; + return SCROLL_THUMB; + } + else /* horizontal */ + { + if (pt.x <= rect.left + arrowSize) return SCROLL_TOP_ARROW; + if (pt.x >= rect.right - arrowSize) return SCROLL_BOTTOM_ARROW; + if (!thumbPos) return SCROLL_TOP_RECT; + pt.x -= rect.left; + if (pt.x < (INT)thumbPos) return SCROLL_TOP_RECT; + if (pt.x > thumbPos+SYSMETRICS_CXVSCROLL) return SCROLL_BOTTOM_RECT; + return SCROLL_THUMB; + } +} + + +/*********************************************************************** + * SCROLL_DrawArrows + * + * Draw the scroll bar arrows. + */ +static void SCROLL_DrawArrows( HDC hdc, SCROLLINFO *infoPtr, RECT *rect, + WORD arrowSize, BOOL vertical, + BOOL top_pressed, BOOL bottom_pressed ) +{ + HDC hdcMem = CreateCompatibleDC( hdc ); + HBITMAP hbmpPrev = SelectObject( hdcMem, vertical ? + TOP_ARROW(infoPtr->flags, top_pressed) + : LEFT_ARROW(infoPtr->flags, top_pressed)); + StretchBlt( hdc, rect->left, rect->top, + vertical ? rect->right-rect->left : arrowSize+1, + vertical ? arrowSize+1 : rect->bottom-rect->top, + hdcMem, 0, 0, + SYSMETRICS_CXVSCROLL + 1, SYSMETRICS_CYHSCROLL + 1, + SRCCOPY ); + + SelectObject( hdcMem, vertical ? + BOTTOM_ARROW( infoPtr->flags, bottom_pressed ) + : RIGHT_ARROW( infoPtr->flags, bottom_pressed ) ); + if (vertical) + StretchBlt( hdc, rect->left, rect->bottom - arrowSize - 1, + rect->right - rect->left, arrowSize + 1, + hdcMem, 0, 0, + SYSMETRICS_CXVSCROLL + 1, SYSMETRICS_CYHSCROLL + 1, + SRCCOPY ); + else + StretchBlt( hdc, rect->right - arrowSize - 1, rect->top, + arrowSize + 1, rect->bottom - rect->top, + hdcMem, 0, 0, + SYSMETRICS_CXVSCROLL + 1, SYSMETRICS_CYHSCROLL + 1, + SRCCOPY ); + SelectObject( hdcMem, hbmpPrev ); + DeleteDC( hdcMem ); +} + + +/*********************************************************************** + * SCROLL_DrawMovingThumb + * + * Draw the moving thumb rectangle. + */ +static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical, + WORD arrowSize, WORD thumbPos ) +{ + RECT r = *rect; + if (vertical) + { + r.top += thumbPos; + if (r.top < rect->top + arrowSize) r.top = rect->top + arrowSize; + if (r.top + SYSMETRICS_CYHSCROLL >= rect->bottom - arrowSize) + r.top = rect->bottom - arrowSize - SYSMETRICS_CYHSCROLL - 1; + r.bottom = r.top + SYSMETRICS_CYHSCROLL + 1; + } + else + { + r.left += thumbPos; + if (r.left < rect->left + arrowSize) r.left = rect->left + arrowSize; + if (r.left + SYSMETRICS_CXVSCROLL >= rect->right - arrowSize) + r.left = rect->right - arrowSize - SYSMETRICS_CXVSCROLL - 1; + r.right = r.left + SYSMETRICS_CXVSCROLL + 1; + } + InflateRect( &r, -1, -1 ); + DrawFocusRect( hdc, &r ); +} + + +/*********************************************************************** + * SCROLL_DrawInterior + * + * Draw the scroll bar interior (everything except the arrows). + */ +static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect, + WORD arrowSize, WORD thumbPos, WORD flags, + BOOL vertical, BOOL top_selected, + BOOL bottom_selected ) +{ + RECT r; + WND *wndPtr = WIN_FindWndPtr( hwnd ); + if (((nBar == SB_VERT) && !(wndPtr->dwStyle & WS_VSCROLL)) + || ((nBar == SB_HORZ) && (!wndPtr->dwStyle & WS_HSCROLL))) return; + + /* Select the correct brush and pen */ + + SelectObject( hdc, sysColorObjects.hpenWindowFrame ); + if ((flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) + { + /* This ought to be the color of the parent window */ + SelectObject( hdc, sysColorObjects.hbrushWindow ); + } + else + { + if (nBar == SB_CTL) /* Only scrollbar controls send WM_CTLCOLOR */ + { + HBRUSH hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLOR, hdc, + MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) ); + SelectObject( hdc, hbrush ); + } + else SelectObject( hdc, sysColorObjects.hbrushScrollbar ); + } + + /* Calculate the scroll rectangle */ + + r = *rect; + if (vertical) + { + r.top += arrowSize; + r.bottom -= arrowSize; + } + else + { + r.left += arrowSize; + r.right -= arrowSize; + } + + /* Draw the scroll bar frame */ + + MoveTo( hdc, r.left, r.top ); + LineTo( hdc, r.right-1, r.top ); + LineTo( hdc, r.right-1, r.bottom-1 ); + LineTo( hdc, r.left, r.bottom-1 ); + LineTo( hdc, r.left, r.top ); + + /* Draw the scroll rectangles and thumb */ + + if (!thumbPos) /* No thumb to draw */ + { + PatBlt( hdc, r.left+1, r.top+1, r.right - r.left - 2, + r.bottom - r.top - 2, SRCCOPY ); + return; + } + + if (vertical) + { + PatBlt( hdc, r.left + 1, r.top + 1, + r.right - r.left - 2, + thumbPos - arrowSize, + top_selected ? NOTSRCCOPY : SRCCOPY ); + r.top += thumbPos - arrowSize; + PatBlt( hdc, r.left + 1, r.top + SYSMETRICS_CYHSCROLL + 1, + r.right - r.left - 2, + r.bottom - r.top - SYSMETRICS_CYHSCROLL - 2, + bottom_selected ? NOTSRCCOPY : SRCCOPY ); + r.bottom = r.top + SYSMETRICS_CYHSCROLL + 1; + } + else /* horizontal */ + { + PatBlt( hdc, r.left + 1, r.top + 1, + thumbPos - arrowSize, + r.bottom - r.top - 2, + top_selected ? NOTSRCCOPY : SRCCOPY ); + r.left += thumbPos - arrowSize; + PatBlt( hdc, r.left + SYSMETRICS_CYHSCROLL + 1, r.top + 1, + r.right - r.left - SYSMETRICS_CYHSCROLL - 2, + r.bottom - r.top - 2, + bottom_selected ? NOTSRCCOPY : SRCCOPY ); + r.right = r.left + SYSMETRICS_CXVSCROLL + 1; + } + + /* Draw the thumb */ + + SelectObject( hdc, sysColorObjects.hbrushBtnFace ); + Rectangle( hdc, r.left, r.top, r.right, r.bottom ); + InflateRect( &r, -1, -1 ); + GRAPH_DrawReliefRect( hdc, &r, 1, 2, FALSE ); +} + + +/*********************************************************************** + * SCROLL_DrawScrollBar + * + * Redraw the whole scrollbar. + */ +void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar ) +{ + WORD arrowSize, thumbPos; + RECT rect; + BOOL vertical; + + SCROLLINFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); + if (!infoPtr) return; + vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, + &arrowSize, &thumbPos ); + /* Draw the arrows */ + + if (arrowSize) SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, + vertical, FALSE, FALSE ); + + SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbPos, + infoPtr->flags, vertical, FALSE, FALSE ); +} + + +/*********************************************************************** + * SCROLL_RefreshScrollBar + * + * Repaint the scroll bar interior after a SetScrollRange() or + * SetScrollPos() call. + */ +static void SCROLL_RefreshScrollBar( HWND hwnd, int nBar ) +{ + WORD arrowSize, thumbPos; + RECT rect; + BOOL vertical; + HDC hdc; + + SCROLLINFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); + if (!infoPtr) return; + vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, + &arrowSize, &thumbPos ); + hdc = (nBar == SB_CTL) ? GetDC(hwnd) : GetWindowDC(hwnd); + if (!hdc) return; + SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbPos, + infoPtr->flags, vertical, FALSE, FALSE ); + ReleaseDC( hwnd, hdc ); +} + + +/*********************************************************************** + * SCROLL_HandleKbdEvent + * + * Handle a keyboard event (only for SB_CTL scrollbars). + */ +static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam ) +{ + WND *wndPtr = WIN_FindWndPtr( hwnd ); + WORD msg; + + switch(wParam) + { + case VK_PRIOR: msg = SB_PAGEUP; break; + case VK_NEXT: msg = SB_PAGEDOWN; break; + case VK_HOME: msg = SB_TOP; break; + case VK_END: msg = SB_BOTTOM; break; + case VK_UP: msg = SB_LINEUP; break; + case VK_DOWN: msg = SB_LINEDOWN; break; + default: + return; + } + SendMessage( GetParent(hwnd), + (wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL, + msg, MAKELONG( 0, hwnd )); +} + + +/*********************************************************************** + * SCROLL_HandleScrollEvent + * + * Handle a mouse or timer event for the scrollbar. + * 'pt' is the location of the mouse event in client (for SB_CTL) or + * windows coordinates. + */ +void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt ) +{ + /* Previous mouse position for timer events */ + static POINT prevPt; + /* Hit test code of the last button-down event */ + static enum SCROLL_HITTEST trackHitTest; + /* Thumb position when tracking started. */ + static UINT trackThumbPos; + /* Position in the scroll-bar of the last button-down event. */ + static int lastClickPos; + /* Position in the scroll-bar of the last mouse event. */ + static int lastMousePos; + + enum SCROLL_HITTEST hittest; + HWND hwndOwner, hwndCtl; + BOOL vertical; + WORD arrowSize, thumbPos; + RECT rect; + HDC hdc; + + SCROLLINFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); + if (!infoPtr) return; + if ((trackHitTest == SCROLL_NOWHERE) && (msg != WM_LBUTTONDOWN)) return; + + hdc = (nBar == SB_CTL) ? GetDC(hwnd) : GetWindowDC(hwnd); + vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, + &arrowSize, &thumbPos ); + hwndOwner = (nBar == SB_CTL) ? GetParent(hwnd) : hwnd; + hwndCtl = (nBar == SB_CTL) ? hwnd : 0; + + switch(msg) + { + case WM_LBUTTONDOWN: /* Initialise mouse tracking */ + trackHitTest = hittest = SCROLL_HitTest( hwnd, nBar, pt ); + lastClickPos = vertical ? (pt.y - rect.top) : (pt.x - rect.left); + lastMousePos = lastClickPos; + trackThumbPos = thumbPos; + prevPt = pt; + SetCapture( hwnd ); + if (nBar == SB_CTL) SetFocus( hwnd ); + break; + + case WM_MOUSEMOVE: + hittest = SCROLL_HitTest( hwnd, nBar, pt ); + prevPt = pt; + break; + + case WM_LBUTTONUP: + hittest = SCROLL_NOWHERE; + ReleaseCapture(); + break; + + case WM_SYSTIMER: + pt = prevPt; + hittest = SCROLL_HitTest( hwnd, nBar, pt ); + break; + + default: + return; /* Should never happen */ + } + + dprintf_scroll( stddeb, "ScrollBar Event: hwnd=%x bar=%d msg=%x pt=%d,%d hit=%d\n", + hwnd, nBar, msg, pt.x, pt.y, hittest ); + + switch(trackHitTest) + { + case SCROLL_NOWHERE: /* No tracking in progress */ + break; + + case SCROLL_TOP_ARROW: + SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical, + (hittest == trackHitTest), FALSE ); + if (hittest == trackHitTest) + { + SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? + SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL ); + if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)) + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_LINEUP, MAKELONG( 0, hwndCtl )); + } + else KillSystemTimer( hwnd, SCROLL_TIMER ); + break; + + case SCROLL_TOP_RECT: + SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbPos, + infoPtr->flags, vertical, + (hittest == trackHitTest), FALSE ); + if (hittest == trackHitTest) + { + SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? + SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL ); + if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)) + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_PAGEUP, MAKELONG( 0, hwndCtl )); + } + else KillSystemTimer( hwnd, SCROLL_TIMER ); + break; + + case SCROLL_THUMB: + if (msg == WM_LBUTTONDOWN) + SCROLL_DrawMovingThumb( hdc, &rect, vertical, arrowSize, + trackThumbPos + lastMousePos - lastClickPos ); + else if (msg == WM_LBUTTONUP) + SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbPos, + infoPtr->flags, vertical, FALSE, FALSE ); + else /* WM_MOUSEMOVE */ + { + UINT pos, val; + + if (!PtInRect( &rect, pt )) pos = lastClickPos; + else pos = vertical ? (pt.y - rect.top) : (pt.x - rect.left); + if (pos != lastMousePos) + { + SCROLL_DrawMovingThumb( hdc, &rect, vertical, arrowSize, + trackThumbPos + lastMousePos - lastClickPos ); + SCROLL_DrawMovingThumb( hdc, &rect, vertical, arrowSize, + trackThumbPos + pos - lastClickPos ); + lastMousePos = pos; + val = SCROLL_GetThumbVal( infoPtr, &rect, vertical, arrowSize, + trackThumbPos + lastMousePos - lastClickPos ); + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_THUMBTRACK, MAKELONG( val, hwndCtl )); + } + } + break; + + case SCROLL_BOTTOM_RECT: + SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbPos, + infoPtr->flags, vertical, + FALSE, (hittest == trackHitTest) ); + if (hittest == trackHitTest) + { + SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? + SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL ); + if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)) + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_PAGEDOWN, MAKELONG( 0, hwndCtl )); + } + else KillSystemTimer( hwnd, SCROLL_TIMER ); + break; + + case SCROLL_BOTTOM_ARROW: + SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical, + FALSE, (hittest == trackHitTest) ); + if (hittest == trackHitTest) + { + SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? + SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL ); + if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)) + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_LINEDOWN, MAKELONG( 0, hwndCtl )); + } + else KillSystemTimer( hwnd, SCROLL_TIMER ); + break; + } + + if (msg == WM_LBUTTONUP) + { + if (trackHitTest == SCROLL_THUMB) + { + UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical, arrowSize, + trackThumbPos + lastMousePos - lastClickPos ); + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_THUMBPOSITION, MAKELONG( val, hwndCtl ) ); + } + else + SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, + SB_ENDSCROLL, MAKELONG( 0, hwndCtl ) ); + trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */ + } + + ReleaseDC( hwnd, hdc ); +} + + +/*********************************************************************** + * ScrollBarWndProc + */ +LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) +{ + switch(message) + { + case WM_CREATE: + { + CREATESTRUCT *lpCreat = (CREATESTRUCT *)lParam; + if (lpCreat->style & SBS_SIZEBOX) + { + fprintf( stdnimp, "Unimplemented style SBS_SIZEBOX.\n" ); + return -1; + } + + if (lpCreat->style & SBS_VERT) + { + if (lpCreat->style & SBS_LEFTALIGN) + MoveWindow( hwnd, lpCreat->x, lpCreat->y, + SYSMETRICS_CXVSCROLL+1, lpCreat->cy, FALSE ); + else if (lpCreat->style & SBS_RIGHTALIGN) + MoveWindow( hwnd, + lpCreat->x+lpCreat->cx-SYSMETRICS_CXVSCROLL-1, + lpCreat->y, + SYSMETRICS_CXVSCROLL + 1, lpCreat->cy, FALSE ); + } + else /* SBS_HORZ */ + { + if (lpCreat->style & SBS_TOPALIGN) + MoveWindow( hwnd, lpCreat->x, lpCreat->y, + lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE ); + else if (lpCreat->style & SBS_BOTTOMALIGN) + MoveWindow( hwnd, + lpCreat->x, + lpCreat->y+lpCreat->cy-SYSMETRICS_CYHSCROLL-1, + lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE ); + } + } + if (!hUpArrow) SCROLL_LoadBitmaps(); + dprintf_scroll( stddeb, "ScrollBar creation, hwnd=%d\n", hwnd ); + return 0; + + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MOUSEMOVE: + case WM_SYSTIMER: + SCROLL_HandleScrollEvent( hwnd, SB_CTL, message, MAKEPOINT(lParam) ); + break; + + case WM_KEYDOWN: + SCROLL_HandleKbdEvent( hwnd, wParam ); + break; + + case WM_ERASEBKGND: + break; + + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc = BeginPaint( hwnd, &ps ); + SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL ); + EndPaint( hwnd, &ps ); + } + break; + + default: + return DefWindowProc( hwnd, message, wParam, lParam ); + } + return 0; +} + + +/************************************************************************* + * SetScrollPos (USER.62) + */ +int SetScrollPos( HWND hwnd, int nBar, int nPos, BOOL bRedraw ) +{ + SCROLLINFO *infoPtr; + INT oldPos; + + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0; + + dprintf_scroll( stddeb,"SetScrollPos min=%d max=%d pos=%d\n", + infoPtr->MinVal, infoPtr->MaxVal, nPos ); + + if (nPos < infoPtr->MinVal) nPos = infoPtr->MinVal; + else if (nPos > infoPtr->MaxVal) nPos = infoPtr->MaxVal; + oldPos = infoPtr->CurVal; + infoPtr->CurVal = nPos; + if (bRedraw) SCROLL_RefreshScrollBar( hwnd, nBar ); + return oldPos; +} + + +/************************************************************************* + * GetScrollPos (USER.63) + */ +int GetScrollPos( HWND hwnd, int nBar ) +{ + SCROLLINFO *infoPtr; + + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0; + return infoPtr->CurVal; +} + + +/************************************************************************* + * SetScrollRange (USER.64) + */ +void SetScrollRange(HWND hwnd, int nBar, int MinVal, int MaxVal, BOOL bRedraw) +{ + SCROLLINFO *infoPtr; + + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return; + + dprintf_scroll( stddeb,"SetScrollRange min=%d max=%d\n", MinVal, MaxVal ); + + /* Invalid range -> range is set to (0,0) */ + if ((MinVal > MaxVal) || ((long)MaxVal - MinVal > 32767L)) + MinVal = MaxVal = 0; + if (infoPtr->CurVal < MinVal) infoPtr->CurVal = MinVal; + else if (infoPtr->CurVal > MaxVal) infoPtr->CurVal = MaxVal; + infoPtr->MinVal = MinVal; + infoPtr->MaxVal = MaxVal; + + /* Non-client scroll-bar is hidden iff range is (0,0) */ + if (nBar != SB_CTL) ShowScrollBar( hwnd, nBar, (MinVal || MaxVal) ); + if (bRedraw) SCROLL_RefreshScrollBar( hwnd, nBar ); +} + + +/************************************************************************* + * GetScrollRange (USER.65) + */ +void GetScrollRange(HWND hwnd, int nBar, LPINT lpMin, LPINT lpMax) +{ + SCROLLINFO *infoPtr; + + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return; + if (lpMin) *lpMin = infoPtr->MinVal; + if (lpMax) *lpMax = infoPtr->MaxVal; +} + + +/************************************************************************* + * ShowScrollBar (USER.267) + */ +void ShowScrollBar( HWND hwnd, WORD wBar, BOOL fShow ) +{ + WND *wndPtr = WIN_FindWndPtr( hwnd ); + + if (!wndPtr) return; + dprintf_scroll( stddeb, "ShowScrollBar: %x %d %d\n", hwnd, wBar, fShow ); + + switch(wBar) + { + case SB_CTL: + ShowWindow( hwnd, fShow ? SW_SHOW : SW_HIDE ); + return; + + case SB_HORZ: + if (fShow) + { + if (wndPtr->dwStyle & WS_HSCROLL) return; + wndPtr->dwStyle |= WS_HSCROLL; + } + else /* hide it */ + { + if (!(wndPtr->dwStyle & WS_HSCROLL)) return; + wndPtr->dwStyle &= ~WS_HSCROLL; + } + break; + + case SB_VERT: + if (fShow) + { + if (wndPtr->dwStyle & WS_VSCROLL) return; + wndPtr->dwStyle |= WS_VSCROLL; + } + else /* hide it */ + { + if (!(wndPtr->dwStyle & WS_VSCROLL)) return; + wndPtr->dwStyle &= ~WS_VSCROLL; + } + break; + + case SB_BOTH: + if (fShow) + { + if ((wndPtr->dwStyle & WS_HSCROLL) + && (wndPtr->dwStyle & WS_VSCROLL)) return; + wndPtr->dwStyle |= WS_HSCROLL | WS_VSCROLL; + } + else /* hide it */ + { + if (!(wndPtr->dwStyle & WS_HSCROLL) + && !(wndPtr->dwStyle & WS_HSCROLL)) return; + wndPtr->dwStyle &= ~(WS_HSCROLL | WS_VSCROLL); + } + break; + + default: + return; /* Nothing to do! */ + } + SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE + | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); + /* FIXME: Hack until SetWindowPos works correctly */ + InvalidateRect( hwnd, NULL, TRUE ); +} + + +/************************************************************************* + * EnableScrollBar (USER.482) + */ +BOOL EnableScrollBar( HWND hwnd, INT nBar, UINT flags ) +{ + SCROLLINFO *infoPtr; + HDC hdc; + + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE; + dprintf_scroll( stddeb, "EnableScrollBar: %x %d %d\n", hwnd, nBar, flags ); + flags &= ESB_DISABLE_BOTH; + if (infoPtr->flags == flags) return FALSE; + infoPtr->flags = flags; + + /* Redraw the whole scroll bar */ + hdc = (nBar == SB_CTL) ? GetDC(hwnd) : GetWindowDC(hwnd); + SCROLL_DrawScrollBar( hwnd, hdc, nBar ); + ReleaseDC( hwnd, hdc ); + return TRUE; +} diff --git a/controls/static.c b/controls/static.c index b61c9e1b3cf..110817f56f2 100644 --- a/controls/static.c +++ b/controls/static.c @@ -93,7 +93,7 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam) if (createStruct->lpszName) STATIC_SetIcon( hWnd, LoadIcon( createStruct->hInstance, createStruct->lpszName )); - break; + return 1; } return DefWindowProc(hWnd, uMsg, wParam, lParam); @@ -220,7 +220,8 @@ static void PaintTextfn( HWND hwnd, HDC hdc ) MAKELONG(hwnd, CTLCOLOR_STATIC)); if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH); FillRect(hdc, &rc, hBrush); - DrawText(hdc, text, -1, &rc, wFormat); + if (text) + DrawText(hdc, text, -1, &rc, wFormat); } static void PaintRectfn( HWND hwnd, HDC hdc ) diff --git a/controls/widgets.c b/controls/widgets.c index 42804768205..838d09e4892 100644 --- a/controls/widgets.c +++ b/controls/widgets.c @@ -9,11 +9,11 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "win.h" #include "button.h" #include "static.h" +#include "scroll.h" #include "desktop.h" #include "mdi.h" #include "gdi.h" -LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); LONG EditWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); @@ -28,11 +28,11 @@ static WNDCLASS WIDGETS_BuiltinClasses[] = 0, 0, 0, 0, NULL, "BUTTON" }, { CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc, 0, sizeof(STATICINFO), 0, 0, 0, 0, NULL, "STATIC" }, - { CS_GLOBALCLASS | CS_PARENTDC, ScrollBarWndProc, 0, 8, + { CS_GLOBALCLASS | CS_PARENTDC, ScrollBarWndProc, 0, sizeof(SCROLLINFO), 0, 0, 0, 0, NULL, "SCROLLBAR" }, - { CS_GLOBALCLASS | CS_PARENTDC, ListBoxWndProc, 0, 8, + { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, ListBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "LISTBOX" }, - { CS_GLOBALCLASS | CS_PARENTDC, ComboBoxWndProc, 0, 8, + { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, ComboBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "COMBOBOX" }, { CS_GLOBALCLASS | CS_PARENTDC, EditWndProc, 0, 4, 0, 0, 0, 0, NULL, "EDIT" }, diff --git a/debugger/break.c b/debugger/break.c index 4778bb7abc2..705528c76b6 100644 --- a/debugger/break.c +++ b/debugger/break.c @@ -1,5 +1,6 @@ #include +#include #define N_BP 25 diff --git a/debugger/info.c b/debugger/info.c index 60f35133f1a..bb65bece051 100644 --- a/debugger/info.c +++ b/debugger/info.c @@ -5,6 +5,7 @@ */ #include +#include #include "opcodes/dis-asm.h" #include "regpos.h" diff --git a/debugger/readline/editline.c b/debugger/readline/editline.c index 3838de029a6..31a846e1a5c 100644 --- a/debugger/readline/editline.c +++ b/debugger/readline/editline.c @@ -4,6 +4,7 @@ */ #include "editline.h" #include +#include /* ** Manifest constants. diff --git a/if1632/relay.c b/if1632/relay.c index d9d9994bdad..8036697b34a 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -80,7 +80,6 @@ DLLRelay(unsigned int func_num, unsigned int seg_off) { struct dll_table_entry_s *dll_p; unsigned short *saved_Stack16Frame; - unsigned int segment; unsigned int offset; unsigned int dll_id; unsigned int ordinal; @@ -116,7 +115,7 @@ DLLRelay(unsigned int func_num, unsigned int seg_off) dll_builtin_table[dll_id].dll_name, ordinal, seg_off >> 16, seg_off & 0xffff); printf("ret=%08x", *ret_addr); - printf(" ESP=%08x, EBP=%08x, SS=%04x\n", + printf(" ESP=%08lx, EBP=%08lx, SS=%04x\n", IF1632_Saved16_esp, IF1632_Saved16_ebp, IF1632_Saved16_ss); @@ -210,7 +209,7 @@ DLLRelay(unsigned int func_num, unsigned int seg_off) #ifdef DEBUG_RELAY if (Options.relay_debug) { - printf("Returning %08.8x from %s (%s.%d)\n", + printf("Returning %08x from %s (%s.%d)\n", ret_val, dll_p->export_name, dll_builtin_table[dll_id].dll_name, ordinal); diff --git a/if1632/user.spec b/if1632/user.spec index 3e7af173a7e..87b6510a6c7 100644 --- a/if1632/user.spec +++ b/if1632/user.spec @@ -65,9 +65,9 @@ length 540 59 pascal SetActiveWindow(word) SetActiveWindow(1) 60 pascal GetActiveWindow() GetActiveWindow() 61 pascal ScrollWindow(word s_word s_word ptr ptr) ScrollWindow(1 2 3 4 5) -62 pascal SetScrollPos(word word word word) SetScrollPos(1 2 3 4) +62 pascal SetScrollPos(word word s_word word) SetScrollPos(1 2 3 4) 63 pascal GetScrollPos(word word) GetScrollPos(1 2) -64 pascal SetScrollRange(word word word word word) SetScrollRange(1 2 3 4 5) +64 pascal SetScrollRange(word word s_word s_word word) SetScrollRange(1 2 3 4 5) 65 pascal GetScrollRange(word word ptr ptr) GetScrollRange(1 2 3 4) 66 pascal GetDC(word) GetDC(1) 67 pascal GetWindowDC(word) GetWindowDC(1) @@ -402,7 +402,7 @@ length 540 473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2) #480 GETUSERLOCALOBJTYPE #481 HARDWARE_EVENT -#482 ENABLESCROLLBAR +482 pascal16 EnableScrollBar(word word word) EnableScrollBar(1 2 3) 483 pascal SystemParametersInfo(word word ptr word) SystemParametersInfo(1 2 3 4) #484 __GP #499 WNETERRORTEXT diff --git a/include/bitmaps/obm_btncorners b/include/bitmaps/obm_btncorners index de1fe0fbbe7..eabe8f23f57 100644 --- a/include/bitmaps/obm_btncorners +++ b/include/bitmaps/obm_btncorners @@ -1,8 +1,8 @@ /* XPM */ static char * obm_btncorners[] = { "30 10 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " .... ", " .... ...... ", diff --git a/include/bitmaps/obm_btsize b/include/bitmaps/obm_btsize index c31b35e1279..b2047331bc9 100644 --- a/include/bitmaps/obm_btsize +++ b/include/bitmaps/obm_btsize @@ -1,8 +1,8 @@ /* XPM */ static char * obm_btsize[] = { "15 15 2 1", -" c black", -". c white", +" s black c black", +". s white c white", " ", " ....... ..... ", " ....... ..... ", diff --git a/include/bitmaps/obm_check b/include/bitmaps/obm_check index c6e8a242b27..7ff8bf31f5b 100644 --- a/include/bitmaps/obm_check +++ b/include/bitmaps/obm_check @@ -1,8 +1,8 @@ /* XPM */ static char * obm_check[] = { "14 14 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " . ", " . ", diff --git a/include/bitmaps/obm_checkboxes b/include/bitmaps/obm_checkboxes dissimilarity index 97% index ba46442bbdd..1fb62bff9df 100644 --- a/include/bitmaps/obm_checkboxes +++ b/include/bitmaps/obm_checkboxes @@ -1,44 +1,44 @@ -/* XPM */ -static char * obm_checkboxes[] = { -"56 39 2 1", -" c black", -". c white", -" . . . .", -" ........... . ......... . . .", -" ........... . . ....... . . ......... . ....... .", -" ........... . .. ..... .. . ......... . . ..... . .", -" ........... . ... ... ... . ......... . .. ... .. .", -" ........... . .... . .... . ......... . ... . ... .", -" ........... . ..... ..... . ......... . .... .... .", -" ........... . .... . .... . ......... . ... . ... .", -" ........... . ... ... ... . ......... . .. ... .. .", -" ........... . .. ..... .. . ......... . . ..... . .", -" ........... . . ....... . . ......... . ....... .", -" ........... . ......... . . .", -" . . . .", -"..... ........... ........... ........... ......", -"... ... ....... ... ....... ....... ....", -".. ....... ..... ....... ..... ... ..... ... ...", -". ......... ... ... ... ... ....... ... . . ..", -". ......... ... .. .. ... ....... ... . . ..", -" ........... . .. .. . ......... . . . .", -" ........... . .. .. . ......... . . . .", -" ........... . .. .. . ......... . . . .", -". ......... ... .. .. ... ....... ... . . ..", -". ......... ... ... ... ... ....... ... . . ..", -".. ....... ..... ....... ..... ... ..... ... ...", -"... ... ....... ... ....... ....... ....", -"..... ........... ........... ........... ......", -".............. ............... .", -".............. . . . . . . ............... .", -".............. . . . . . ............... . . . . . .", -".............. . . . . . . ............... . . . . .", -".............. . . . . . ............... . . . . . .", -".............. . . . . . . ............... . . . . .", -".............. . . . . . ............... . . . . . .", -".............. . . . . . . ............... . . . . .", -".............. . . . . . ............... . . . . . .", -".............. . . . . . . ............... . . . . .", -".............. . . . . . ............... . . . . . .", -".............. . . . . . . ............... .", -".............. ............... ."}; +/* XPM */ +static char * obm_checkboxes[] = { +"56 39 2 1", +" s white c white", +". s black c black", +"............. ............. ............. ............. ", +". . .. .. ............. ............. ", +". . . . . . .. .. ... ... ", +". . . . . . .. .. .. . . .. ", +". . . . . . .. .. .. . . .. ", +". . . . . . .. .. .. . . .. ", +". . . . . .. .. .. . .. ", +". . . . . . .. .. .. . . .. ", +". . . . . . .. .. .. . . .. ", +". . . . . . .. .. .. . . .. ", +". . . . . . .. .. ... ... ", +". . .. .. ............. ............. ", +"............. ............. ............. ............. ", +" ... ... ... ... ", +" .. .. .. .. ....... ....... ", +" . . . . ... ... ... ... ", +" . . . ... . .. .. ... ... ... ", +" . . . ..... . .. .. .. ..... .. ", +". . . ....... . .. .. .. ....... .. ", +". . . ....... . .. .. .. ....... .. ", +". . . ....... . .. .. .. ....... .. ", +" . . . ..... . .. .. .. ..... .. ", +" . . . ... . .. .. ... ... ... ", +" . . . . ... ... ... ... ", +" .. .. .. .. ....... ....... ", +" ... ... ... ... ", +" ............. ............. ", +" . . . . . . . ............. ", +" .. . . . . .. .. . . . . .. ", +" . . . . . . . ... . . . ... ", +" .. . . . . .. .. . . . . .. ", +" . . . . . . . ... . . . ... ", +" .. . . . . .. .. . . . . .. ", +" . . . . . . . ... . . . ... ", +" .. . . . . .. .. . . . . .. ", +" . . . . . . . ... . . . ... ", +" .. . . . . .. .. . . . . .. ", +" . . . . . . . ............. ", +" ............. ............. "}; diff --git a/include/bitmaps/obm_close b/include/bitmaps/obm_close index 66c6e32fbed..97112604330 100644 --- a/include/bitmaps/obm_close +++ b/include/bitmaps/obm_close @@ -3,7 +3,7 @@ static char * obm_close[] = { "36 18 4 1", " s button_face c grey75", ". s window_frame c black", -"X c white", +"X s white c white", "o s button_shadow c grey50", " ", " ", diff --git a/include/bitmaps/obm_combo b/include/bitmaps/obm_combo index a6f03ac9364..c7d69a2f7b9 100644 --- a/include/bitmaps/obm_combo +++ b/include/bitmaps/obm_combo @@ -1,8 +1,8 @@ /* XPM */ static char * obm_combo[] = { "7 9 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ... ", " ... ", " ... ", diff --git a/include/bitmaps/obm_mnarrow b/include/bitmaps/obm_mnarrow index 8748a023592..34d2f122c65 100644 --- a/include/bitmaps/obm_mnarrow +++ b/include/bitmaps/obm_mnarrow @@ -1,8 +1,8 @@ /* XPM */ static char * obm_mnarrow[] = { "7 11 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " . ", " .. ", diff --git a/include/bitmaps/obm_old_close b/include/bitmaps/obm_old_close index 90a33e0a6bb..12f3a5a5562 100644 --- a/include/bitmaps/obm_old_close +++ b/include/bitmaps/obm_old_close @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_close[] = { "50 19 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_dnarrow b/include/bitmaps/obm_old_dnarrow index 1c3f98743ba..f9f707a0df3 100644 --- a/include/bitmaps/obm_old_dnarrow +++ b/include/bitmaps/obm_old_dnarrow @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_dnarrow[] = { "15 15 2 1", -" s button_highlight c white", -". s button_text c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_lfarrow b/include/bitmaps/obm_old_lfarrow index 04b8097160a..1a5d864573d 100644 --- a/include/bitmaps/obm_old_lfarrow +++ b/include/bitmaps/obm_old_lfarrow @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_lfarrow[] = { "15 15 2 1", -" s button_highlight c white", -". s button_text c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_reduce b/include/bitmaps/obm_old_reduce index 6f8cf017915..3418845f572 100644 --- a/include/bitmaps/obm_old_reduce +++ b/include/bitmaps/obm_old_reduce @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_reduce[] = { "25 19 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_restore b/include/bitmaps/obm_old_restore index 404ea55306a..92d83bb13cd 100644 --- a/include/bitmaps/obm_old_restore +++ b/include/bitmaps/obm_old_restore @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_restore[] = { "25 19 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " ", " ..... . ", diff --git a/include/bitmaps/obm_old_rgarrow b/include/bitmaps/obm_old_rgarrow index 8dcc49ac9e7..0f248dc8323 100644 --- a/include/bitmaps/obm_old_rgarrow +++ b/include/bitmaps/obm_old_rgarrow @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_rgarrow[] = { "15 15 2 1", -" s button_highlight c white", -". s button_text c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_uparrow b/include/bitmaps/obm_old_uparrow index 24513bbb9cf..5084dc9f3c5 100644 --- a/include/bitmaps/obm_old_uparrow +++ b/include/bitmaps/obm_old_uparrow @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_uparrow[] = { "15 15 2 1", -" s button_highlight c white", -". s button_text c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/bitmaps/obm_old_zoom b/include/bitmaps/obm_old_zoom index 4127bc626fe..ce6bca8c346 100644 --- a/include/bitmaps/obm_old_zoom +++ b/include/bitmaps/obm_old_zoom @@ -1,8 +1,8 @@ /* XPM */ static char * obm_old_zoom[] = { "25 19 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " ", " . ", diff --git a/include/bitmaps/obm_size b/include/bitmaps/obm_size index 7760ae5b697..74ef0b01341 100644 --- a/include/bitmaps/obm_size +++ b/include/bitmaps/obm_size @@ -1,8 +1,8 @@ /* XPM */ static char * obm_size[] = { "13 13 2 1", -" c white", -". c black", +" s white c white", +". s black c black", " ", " ", " ", diff --git a/include/debug.h b/include/debug.h index eb60565f671..6bdc132c63a 100644 --- a/include/debug.h +++ b/include/debug.h @@ -3,9 +3,8 @@ #define stddeb stdout #define stdnimp stderr -# /* Do not remove this line or change anything below this line */ - - +/* Do not remove this line or change anything below this line */ + #ifdef DEBUG_NONE_EXT #undef DEBUG_ACCEL #undef DEBUG_BITMAP @@ -35,7 +34,6 @@ #undef DEBUG_GRAPHICS #undef DEBUG_HEAP #undef DEBUG_ICON -#undef DEBUG_IF #undef DEBUG_INT #undef DEBUG_KEY #undef DEBUG_KEYBOARD @@ -49,6 +47,7 @@ #undef DEBUG_MENUCALC #undef DEBUG_MESSAGE #undef DEBUG_METAFILE +#undef DEBUG_MIDI #undef DEBUG_MMIO #undef DEBUG_MMTIME #undef DEBUG_MODULE @@ -72,8 +71,7 @@ #undef DEBUG_WIN #undef DEBUG_WINSOCK #endif - - + #ifdef DEBUG_ALL_EXT #define DEBUG_ACCEL #define DEBUG_BITMAP @@ -103,7 +101,6 @@ #define DEBUG_GRAPHICS #define DEBUG_HEAP #define DEBUG_ICON -#define DEBUG_IF #define DEBUG_INT #define DEBUG_KEY #define DEBUG_KEYBOARD @@ -117,6 +114,7 @@ #define DEBUG_MENUCALC #define DEBUG_MESSAGE #define DEBUG_METAFILE +#define DEBUG_MIDI #define DEBUG_MMIO #define DEBUG_MMTIME #define DEBUG_MODULE @@ -140,338 +138,337 @@ #define DEBUG_WIN #define DEBUG_WINSOCK #endif - - + #ifdef DEBUG_RUNTIME #ifdef DEBUG_DEFINE_VARIABLES short debug_msg_enabled[]={ #ifdef DEBUG_ACCEL -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_BITMAP -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CALLBACK -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CARET -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CATCH -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CDAUDIO -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CLASS -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CLIPBOARD -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CLIPPING -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_COMBO -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_COMM -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_CURSOR -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_DC -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_DIALOG -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_DLL -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_DOSFS -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_DRIVER -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_EDIT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_ENUM -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_EVENT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_EXEC -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_FILE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_FIXUP -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_FONT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_GDI -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_GRAPHICS -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_HEAP -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_ICON -1, + 1, #else -0, -#endif -#ifdef DEBUG_IF -1, -#else -0, + 0, #endif #ifdef DEBUG_INT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_KEY -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_KEYBOARD -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_LDT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_LISTBOX -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MCI -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MCIANIM -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MCIWAVE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MDI -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MENU -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MENUCALC -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MESSAGE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_METAFILE -1, + 1, #else -0, + 0, +#endif +#ifdef DEBUG_MIDI + 1, +#else + 0, #endif #ifdef DEBUG_MMIO -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MMTIME -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MODULE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MSG -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_MSGBOX -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_NONCLIENT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_PALETTE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_PROFILE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_PROP -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_REG -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_REGION -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_RESOURCE -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_SCROLL -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_SELECTORS -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_STRESS -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_SYSCOLOR -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_TASK -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_TEXT -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_TIMER -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_UTILITY -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_WIN -1, + 1, #else -0, + 0, #endif #ifdef DEBUG_WINSOCK -1, + 1, #else -0, + 0, #endif -0}; + 0 +}; #else extern short debug_msg_enabled[]; #endif #endif - - + #ifdef DEBUG_RUNTIME #define dprintf_accel if(debug_msg_enabled[0]) fprintf #else @@ -481,7 +478,7 @@ extern short debug_msg_enabled[]; #define dprintf_accel #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_bitmap if(debug_msg_enabled[1]) fprintf #else @@ -491,7 +488,7 @@ extern short debug_msg_enabled[]; #define dprintf_bitmap #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_callback if(debug_msg_enabled[2]) fprintf #else @@ -501,7 +498,7 @@ extern short debug_msg_enabled[]; #define dprintf_callback #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_caret if(debug_msg_enabled[3]) fprintf #else @@ -511,7 +508,7 @@ extern short debug_msg_enabled[]; #define dprintf_caret #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_catch if(debug_msg_enabled[4]) fprintf #else @@ -521,7 +518,7 @@ extern short debug_msg_enabled[]; #define dprintf_catch #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_cdaudio if(debug_msg_enabled[5]) fprintf #else @@ -531,7 +528,7 @@ extern short debug_msg_enabled[]; #define dprintf_cdaudio #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_class if(debug_msg_enabled[6]) fprintf #else @@ -541,7 +538,7 @@ extern short debug_msg_enabled[]; #define dprintf_class #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_clipboard if(debug_msg_enabled[7]) fprintf #else @@ -551,7 +548,7 @@ extern short debug_msg_enabled[]; #define dprintf_clipboard #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_clipping if(debug_msg_enabled[8]) fprintf #else @@ -561,7 +558,7 @@ extern short debug_msg_enabled[]; #define dprintf_clipping #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_combo if(debug_msg_enabled[9]) fprintf #else @@ -571,7 +568,7 @@ extern short debug_msg_enabled[]; #define dprintf_combo #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_comm if(debug_msg_enabled[10]) fprintf #else @@ -581,7 +578,7 @@ extern short debug_msg_enabled[]; #define dprintf_comm #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_cursor if(debug_msg_enabled[11]) fprintf #else @@ -591,7 +588,7 @@ extern short debug_msg_enabled[]; #define dprintf_cursor #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_dc if(debug_msg_enabled[12]) fprintf #else @@ -601,7 +598,7 @@ extern short debug_msg_enabled[]; #define dprintf_dc #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_dialog if(debug_msg_enabled[13]) fprintf #else @@ -611,7 +608,7 @@ extern short debug_msg_enabled[]; #define dprintf_dialog #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_dll if(debug_msg_enabled[14]) fprintf #else @@ -621,7 +618,7 @@ extern short debug_msg_enabled[]; #define dprintf_dll #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_dosfs if(debug_msg_enabled[15]) fprintf #else @@ -631,7 +628,7 @@ extern short debug_msg_enabled[]; #define dprintf_dosfs #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_driver if(debug_msg_enabled[16]) fprintf #else @@ -641,7 +638,7 @@ extern short debug_msg_enabled[]; #define dprintf_driver #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_edit if(debug_msg_enabled[17]) fprintf #else @@ -651,7 +648,7 @@ extern short debug_msg_enabled[]; #define dprintf_edit #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_enum if(debug_msg_enabled[18]) fprintf #else @@ -661,7 +658,7 @@ extern short debug_msg_enabled[]; #define dprintf_enum #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_event if(debug_msg_enabled[19]) fprintf #else @@ -671,7 +668,7 @@ extern short debug_msg_enabled[]; #define dprintf_event #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_exec if(debug_msg_enabled[20]) fprintf #else @@ -681,7 +678,7 @@ extern short debug_msg_enabled[]; #define dprintf_exec #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_file if(debug_msg_enabled[21]) fprintf #else @@ -691,7 +688,7 @@ extern short debug_msg_enabled[]; #define dprintf_file #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_fixup if(debug_msg_enabled[22]) fprintf #else @@ -701,7 +698,7 @@ extern short debug_msg_enabled[]; #define dprintf_fixup #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_font if(debug_msg_enabled[23]) fprintf #else @@ -711,7 +708,7 @@ extern short debug_msg_enabled[]; #define dprintf_font #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_gdi if(debug_msg_enabled[24]) fprintf #else @@ -721,7 +718,7 @@ extern short debug_msg_enabled[]; #define dprintf_gdi #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_graphics if(debug_msg_enabled[25]) fprintf #else @@ -731,7 +728,7 @@ extern short debug_msg_enabled[]; #define dprintf_graphics #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_heap if(debug_msg_enabled[26]) fprintf #else @@ -741,7 +738,7 @@ extern short debug_msg_enabled[]; #define dprintf_heap #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_icon if(debug_msg_enabled[27]) fprintf #else @@ -751,19 +748,9 @@ extern short debug_msg_enabled[]; #define dprintf_icon #endif #endif - -#ifdef DEBUG_RUNTIME -#define dprintf_if if(debug_msg_enabled[28]) fprintf -#else -#ifdef DEBUG_IF -#define dprintf_if fprintf -#else -#define dprintf_if -#endif -#endif - + #ifdef DEBUG_RUNTIME -#define dprintf_int if(debug_msg_enabled[29]) fprintf +#define dprintf_int if(debug_msg_enabled[28]) fprintf #else #ifdef DEBUG_INT #define dprintf_int fprintf @@ -771,9 +758,9 @@ extern short debug_msg_enabled[]; #define dprintf_int #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_key if(debug_msg_enabled[30]) fprintf +#define dprintf_key if(debug_msg_enabled[29]) fprintf #else #ifdef DEBUG_KEY #define dprintf_key fprintf @@ -781,9 +768,9 @@ extern short debug_msg_enabled[]; #define dprintf_key #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_keyboard if(debug_msg_enabled[31]) fprintf +#define dprintf_keyboard if(debug_msg_enabled[30]) fprintf #else #ifdef DEBUG_KEYBOARD #define dprintf_keyboard fprintf @@ -791,9 +778,9 @@ extern short debug_msg_enabled[]; #define dprintf_keyboard #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_ldt if(debug_msg_enabled[32]) fprintf +#define dprintf_ldt if(debug_msg_enabled[31]) fprintf #else #ifdef DEBUG_LDT #define dprintf_ldt fprintf @@ -801,9 +788,9 @@ extern short debug_msg_enabled[]; #define dprintf_ldt #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_listbox if(debug_msg_enabled[33]) fprintf +#define dprintf_listbox if(debug_msg_enabled[32]) fprintf #else #ifdef DEBUG_LISTBOX #define dprintf_listbox fprintf @@ -811,9 +798,9 @@ extern short debug_msg_enabled[]; #define dprintf_listbox #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_mci if(debug_msg_enabled[34]) fprintf +#define dprintf_mci if(debug_msg_enabled[33]) fprintf #else #ifdef DEBUG_MCI #define dprintf_mci fprintf @@ -821,9 +808,9 @@ extern short debug_msg_enabled[]; #define dprintf_mci #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_mcianim if(debug_msg_enabled[35]) fprintf +#define dprintf_mcianim if(debug_msg_enabled[34]) fprintf #else #ifdef DEBUG_MCIANIM #define dprintf_mcianim fprintf @@ -831,9 +818,9 @@ extern short debug_msg_enabled[]; #define dprintf_mcianim #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_mciwave if(debug_msg_enabled[36]) fprintf +#define dprintf_mciwave if(debug_msg_enabled[35]) fprintf #else #ifdef DEBUG_MCIWAVE #define dprintf_mciwave fprintf @@ -841,9 +828,9 @@ extern short debug_msg_enabled[]; #define dprintf_mciwave #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_mdi if(debug_msg_enabled[37]) fprintf +#define dprintf_mdi if(debug_msg_enabled[36]) fprintf #else #ifdef DEBUG_MDI #define dprintf_mdi fprintf @@ -851,9 +838,9 @@ extern short debug_msg_enabled[]; #define dprintf_mdi #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_menu if(debug_msg_enabled[38]) fprintf +#define dprintf_menu if(debug_msg_enabled[37]) fprintf #else #ifdef DEBUG_MENU #define dprintf_menu fprintf @@ -861,9 +848,9 @@ extern short debug_msg_enabled[]; #define dprintf_menu #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_menucalc if(debug_msg_enabled[39]) fprintf +#define dprintf_menucalc if(debug_msg_enabled[38]) fprintf #else #ifdef DEBUG_MENUCALC #define dprintf_menucalc fprintf @@ -871,9 +858,9 @@ extern short debug_msg_enabled[]; #define dprintf_menucalc #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_message if(debug_msg_enabled[40]) fprintf +#define dprintf_message if(debug_msg_enabled[39]) fprintf #else #ifdef DEBUG_MESSAGE #define dprintf_message fprintf @@ -881,9 +868,9 @@ extern short debug_msg_enabled[]; #define dprintf_message #endif #endif - + #ifdef DEBUG_RUNTIME -#define dprintf_metafile if(debug_msg_enabled[41]) fprintf +#define dprintf_metafile if(debug_msg_enabled[40]) fprintf #else #ifdef DEBUG_METAFILE #define dprintf_metafile fprintf @@ -891,7 +878,17 @@ extern short debug_msg_enabled[]; #define dprintf_metafile #endif #endif - + +#ifdef DEBUG_RUNTIME +#define dprintf_midi if(debug_msg_enabled[41]) fprintf +#else +#ifdef DEBUG_MIDI +#define dprintf_midi fprintf +#else +#define dprintf_midi +#endif +#endif + #ifdef DEBUG_RUNTIME #define dprintf_mmio if(debug_msg_enabled[42]) fprintf #else @@ -901,7 +898,7 @@ extern short debug_msg_enabled[]; #define dprintf_mmio #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_mmtime if(debug_msg_enabled[43]) fprintf #else @@ -911,7 +908,7 @@ extern short debug_msg_enabled[]; #define dprintf_mmtime #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_module if(debug_msg_enabled[44]) fprintf #else @@ -921,7 +918,7 @@ extern short debug_msg_enabled[]; #define dprintf_module #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_msg if(debug_msg_enabled[45]) fprintf #else @@ -931,7 +928,7 @@ extern short debug_msg_enabled[]; #define dprintf_msg #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_msgbox if(debug_msg_enabled[46]) fprintf #else @@ -941,7 +938,7 @@ extern short debug_msg_enabled[]; #define dprintf_msgbox #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_nonclient if(debug_msg_enabled[47]) fprintf #else @@ -951,7 +948,7 @@ extern short debug_msg_enabled[]; #define dprintf_nonclient #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_palette if(debug_msg_enabled[48]) fprintf #else @@ -961,7 +958,7 @@ extern short debug_msg_enabled[]; #define dprintf_palette #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_profile if(debug_msg_enabled[49]) fprintf #else @@ -971,7 +968,7 @@ extern short debug_msg_enabled[]; #define dprintf_profile #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_prop if(debug_msg_enabled[50]) fprintf #else @@ -981,7 +978,7 @@ extern short debug_msg_enabled[]; #define dprintf_prop #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_reg if(debug_msg_enabled[51]) fprintf #else @@ -991,7 +988,7 @@ extern short debug_msg_enabled[]; #define dprintf_reg #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_region if(debug_msg_enabled[52]) fprintf #else @@ -1001,7 +998,7 @@ extern short debug_msg_enabled[]; #define dprintf_region #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_resource if(debug_msg_enabled[53]) fprintf #else @@ -1011,7 +1008,7 @@ extern short debug_msg_enabled[]; #define dprintf_resource #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_scroll if(debug_msg_enabled[54]) fprintf #else @@ -1021,7 +1018,7 @@ extern short debug_msg_enabled[]; #define dprintf_scroll #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_selectors if(debug_msg_enabled[55]) fprintf #else @@ -1031,7 +1028,7 @@ extern short debug_msg_enabled[]; #define dprintf_selectors #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_stress if(debug_msg_enabled[56]) fprintf #else @@ -1041,7 +1038,7 @@ extern short debug_msg_enabled[]; #define dprintf_stress #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_syscolor if(debug_msg_enabled[57]) fprintf #else @@ -1051,7 +1048,7 @@ extern short debug_msg_enabled[]; #define dprintf_syscolor #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_task if(debug_msg_enabled[58]) fprintf #else @@ -1061,7 +1058,7 @@ extern short debug_msg_enabled[]; #define dprintf_task #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_text if(debug_msg_enabled[59]) fprintf #else @@ -1071,7 +1068,7 @@ extern short debug_msg_enabled[]; #define dprintf_text #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_timer if(debug_msg_enabled[60]) fprintf #else @@ -1081,7 +1078,7 @@ extern short debug_msg_enabled[]; #define dprintf_timer #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_utility if(debug_msg_enabled[61]) fprintf #else @@ -1091,7 +1088,7 @@ extern short debug_msg_enabled[]; #define dprintf_utility #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_win if(debug_msg_enabled[62]) fprintf #else @@ -1101,7 +1098,7 @@ extern short debug_msg_enabled[]; #define dprintf_win #endif #endif - + #ifdef DEBUG_RUNTIME #define dprintf_winsock if(debug_msg_enabled[63]) fprintf #else @@ -1111,76 +1108,76 @@ extern short debug_msg_enabled[]; #define dprintf_winsock #endif #endif - - - + + #ifdef DEBUG_RUNTIME #ifdef DEBUG_DEFINE_VARIABLES static char *debug_msg_name[] = { -"accel", -"bitmap", -"callback", -"caret", -"catch", -"cdaudio", -"class", -"clipboard", -"clipping", -"combo", -"comm", -"cursor", -"dc", -"dialog", -"dll", -"dosfs", -"driver", -"edit", -"enum", -"event", -"exec", -"file", -"fixup", -"font", -"gdi", -"graphics", -"heap", -"icon", -"if", -"int", -"key", -"keyboard", -"ldt", -"listbox", -"mci", -"mcianim", -"mciwave", -"mdi", -"menu", -"menucalc", -"message", -"metafile", -"mmio", -"mmtime", -"module", -"msg", -"msgbox", -"nonclient", -"palette", -"profile", -"prop", -"reg", -"region", -"resource", -"scroll", -"selectors", -"stress", -"syscolor", -"task", -"text", -"timer", -"utility", -"win", -"winsock", -""}; + "accel", + "bitmap", + "callback", + "caret", + "catch", + "cdaudio", + "class", + "clipboard", + "clipping", + "combo", + "comm", + "cursor", + "dc", + "dialog", + "dll", + "dosfs", + "driver", + "edit", + "enum", + "event", + "exec", + "file", + "fixup", + "font", + "gdi", + "graphics", + "heap", + "icon", + "int", + "key", + "keyboard", + "ldt", + "listbox", + "mci", + "mcianim", + "mciwave", + "mdi", + "menu", + "menucalc", + "message", + "metafile", + "midi", + "mmio", + "mmtime", + "module", + "msg", + "msgbox", + "nonclient", + "palette", + "profile", + "prop", + "reg", + "region", + "resource", + "scroll", + "selectors", + "stress", + "syscolor", + "task", + "text", + "timer", + "utility", + "win", + "winsock", + "" +}; #endif #endif diff --git a/include/listbox.h b/include/listbox.h index e244781529e..70009436c7a 100644 --- a/include/listbox.h +++ b/include/listbox.h @@ -30,6 +30,7 @@ typedef struct tagHEADLIST { HWND hWndLogicParent; HFONT hFont; BOOL bRedrawFlag; + MDESC *Heap; } HEADLIST; typedef HEADLIST FAR* LPHEADLIST; diff --git a/include/resource.h b/include/resource.h index e889999faa3..88c3585a6dd 100644 --- a/include/resource.h +++ b/include/resource.h @@ -6,8 +6,6 @@ typedef struct resource_s { struct resource_s *next; HANDLE info_mem; /* this struct */ - int size_shift; - struct resource_nameinfo_s nameinfo; HANDLE rsc_mem; /* resource data */ /* */ HANDLE instance; /* resource instance */ diff --git a/include/scroll.h b/include/scroll.h dissimilarity index 98% index 96a6be9fe7d..f80eefdfdb2 100644 --- a/include/scroll.h +++ b/include/scroll.h @@ -1,35 +1,26 @@ -/* - * Scroll Bar definitions - */ - - -typedef struct tagHEADSSCROLL { - short CurVal; - short MinVal; - short MaxVal; - short MaxPix; - short CurPix; - short ThumbVal; - RECT rect; - RECT rectUp; - RECT rectDown; - BOOL ThumbActive; - BOOL TimerPending; - WORD ButtonDown; - WORD Direction; - DWORD dwStyle; - HWND hWndOwner; - BOOL bRedrawFlag; - } HEADSCROLL; -typedef HEADSCROLL FAR* LPHEADSCROLL; - - - -void ScrollBarButtonDown(HWND hWnd, int nBar, int x, int y); -void ScrollBarButtonUp(HWND hWnd, int nBar, int x, int y); -void ScrollBarMouseMove(HWND hWnd, int nBar, WORD wParam, int x, int y); -void StdDrawScrollBar(HWND hWnd, HDC hDC, int nBar, LPRECT lprect, LPHEADSCROLL lphs); -int CreateScrollBarStruct(HWND hWnd); -void NC_CreateScrollBars(HWND hWnd); - - +/* + * Scroll-bar class extra info + * + * Copyright 1993 Martin Ayotte + * Copyright 1994 Alexandre Julliard + */ + +#ifndef SCROLL_H +#define SCROLL_H + +#include "windows.h" + +typedef struct +{ + INT CurVal; /* Current scroll-bar value */ + INT MinVal; /* Minimum scroll-bar value */ + INT MaxVal; /* Maximum scroll-bar value */ + WORD unused; /* Unused word, for MS-Windows compatibility */ + WORD flags; /* EnableScrollBar flags */ +} SCROLLINFO; + +extern LONG ScrollBarWndProc( HWND hwnd, WORD uMsg, WORD wParam, LONG lParam ); + +extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar ); + +#endif /* SCROLL_H */ diff --git a/include/stddebug.h b/include/stddebug.h index 465bd2560c7..7c5ccbfb8d6 100644 --- a/include/stddebug.h +++ b/include/stddebug.h @@ -39,8 +39,9 @@ /* #define DEBUG_MODULE */ /* #define DEBUG_LDT */ /* #define DEBUG_HEAP */ +/* #define DEBUG_MCIANIM */ /* #define DEBUG_MCIWAVE */ -/* #define DEBUG_MCIWAVE */ +/* #define DEBUG_MIDI */ /* #define DEBUG_INT */ /* #define DEBUG_METAFILE */ /* #define DEBUG_GDI */ @@ -72,8 +73,8 @@ /* #define DEBUG_CATCH */ -# /* Do not remove this line or change anything below this line */ - +/* Do not remove this line or change anything below this line */ + #ifdef DEBUG_NONE #undef DEBUG_ACCEL #undef DEBUG_BITMAP @@ -103,7 +104,6 @@ #undef DEBUG_GRAPHICS #undef DEBUG_HEAP #undef DEBUG_ICON -#undef DEBUG_IF #undef DEBUG_INT #undef DEBUG_KEY #undef DEBUG_KEYBOARD @@ -117,6 +117,7 @@ #undef DEBUG_MENUCALC #undef DEBUG_MESSAGE #undef DEBUG_METAFILE +#undef DEBUG_MIDI #undef DEBUG_MMIO #undef DEBUG_MMTIME #undef DEBUG_MODULE @@ -140,8 +141,7 @@ #undef DEBUG_WIN #undef DEBUG_WINSOCK #endif - - + #ifdef DEBUG_ALL #define DEBUG_ACCEL #define DEBUG_BITMAP @@ -171,7 +171,6 @@ #define DEBUG_GRAPHICS #define DEBUG_HEAP #define DEBUG_ICON -#define DEBUG_IF #define DEBUG_INT #define DEBUG_KEY #define DEBUG_KEYBOARD @@ -185,6 +184,7 @@ #define DEBUG_MENUCALC #define DEBUG_MESSAGE #define DEBUG_METAFILE +#define DEBUG_MIDI #define DEBUG_MMIO #define DEBUG_MMTIME #define DEBUG_MODULE diff --git a/include/win.h b/include/win.h index 2af959af0a9..8e093bafe1c 100644 --- a/include/win.h +++ b/include/win.h @@ -42,9 +42,8 @@ typedef struct tagWND DWORD dwStyle; /* Window style (from CreateWindow) */ DWORD dwExStyle; /* Extended style (from CreateWindowEx) */ HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */ - void *VScroll; /* Vertical ScrollBar Struct Pointer */ - void *HScroll; /* Horizontal ScrollBar Struct Pointer */ - WORD scroll_flags; /* scrolls flags (vert & horz visible) */ + HANDLE hVScroll; /* Vertical scroll-bar info */ + HANDLE hHScroll; /* Horizontal scroll-bar info */ WORD wIDmenu; /* ID or hmenu (from CreateWindow) */ HANDLE hText; /* Handle of window text */ WORD flags; /* Misc. flags (see below) */ diff --git a/include/windows.h b/include/windows.h index 9691868a9fa..d4ef6e12f8d 100644 --- a/include/windows.h +++ b/include/windows.h @@ -2367,41 +2367,40 @@ int wsprintf(LPSTR a,LPSTR b,...); /* Implemented functions */ -F(HMENU,CreateMenu) -F(BOOL,GetInputState) -F(BOOL,SetDeskPattern) -F(LPSTR,GetDOSEnvironment) -F(DWORD,GetMessagePos) -F(LONG,GetMessageTime) -F(LONG,GetMessageExtraInfo) F(BOOL,AnyPopup) F(BOOL,CloseClipboard) F(BOOL,EmptyClipboard) +F(BOOL,GetInputState) F(BOOL,InSendMessage) +F(BOOL,SetDeskPattern) F(DWORD,GetCurrentTime) F(DWORD,GetDialogBaseUnits) +F(DWORD,GetMenuCheckMarkDimensions) +F(DWORD,GetMessagePos) F(DWORD,GetTickCount) F(HANDLE,GetCurrentTask) +F(HMENU,CreateMenu) F(HMENU,CreatePopupMenu) F(HWND,GetActiveWindow) F(HWND,GetCapture) F(HWND,GetClipboardOwner) -F(HWND,GetOpenClipboardWindow) F(HWND,GetClipboardViewer) F(HWND,GetDesktopHwnd) F(HWND,GetDesktopWindow) F(HWND,GetFocus) +F(HWND,GetOpenClipboardWindow) F(HWND,GetSysModalWindow) -F(DWORD,GetMenuCheckMarkDimensions) +F(LONG,GetMessageExtraInfo) +F(LONG,GetMessageTime) +F(LONG,GetVersion) F(LONG,GetWinFlags) F(LPINT,GetThresholdEvent) +F(LPSTR,GetDOSEnvironment) F(LPSTR,ValidateFreeSpaces) -F(void,ValidateCodeSegments) F(WORD,GetCaretBlinkTime) F(WORD,GetCurrentPDB) F(WORD,GetDoubleClickTime) F(WORD,GetNumTasks) -F(LONG,GetVersion) F(int,CountClipboardFormats) F(int,GetKBCodePage) F(int,GetThresholdStatus) @@ -2420,27 +2419,16 @@ F(void,ProfStart) F(void,ProfStop) F(void,ReleaseCapture) F(void,SwitchStackBack) +F(void,ValidateCodeSegments) F(void,WaitMessage) F(void,Yield) -Fa(BOOL,IsCharAlpha,char,ch) -Fa(BOOL,IsCharAlphaNumeric,char,ch) -Fa(BOOL,IsCharLower,char,ch) -Fa(BOOL,IsCharUpper,char,ch) -Fa(ATOM,RegisterClass,LPWNDCLASS,a) -Fa(BOOL,TranslateMessage,LPMSG,a) -Fa(void,PostQuitMessage,int,a) -Fa(BOOL,SetMessageQueue,int,a) -Fa(INT,_lclose,INT,a) -Fb(INT,_lopen,LPSTR,a,INT,b) -Fa(INT,lstrlen,LPCSTR,a) -Fa(LONG,DispatchMessage,LPMSG,msg) -Fa(void,UpdateWindow,HWND,a) Fa(ATOM,AddAtom,LPCSTR,a) Fa(ATOM,DeleteAtom,ATOM,a) Fa(ATOM,FindAtom,LPCSTR,a) Fa(ATOM,GlobalAddAtom,LPCSTR,a) Fa(ATOM,GlobalDeleteAtom,ATOM,a) Fa(ATOM,GlobalFindAtom,LPCSTR,a) +Fa(ATOM,RegisterClass,LPWNDCLASS,a) Fa(BOOL,BringWindowToTop,HWND,a) Fa(BOOL,DeleteDC,HDC,a) Fa(BOOL,DeleteMetaFile,HMETAFILE,a) @@ -2453,12 +2441,11 @@ Fa(BOOL,EnableHardwareInput,BOOL,a) Fa(BOOL,EndDeferWindowPos,HDWP,hWinPosInfo) Fa(BOOL,FreeModule,HANDLE,a) Fa(BOOL,FreeResource,HANDLE,a) -#ifndef GLOBAL_SOURCE -Fa(BOOL,GlobalUnWire,HANDLE,a) -Fa(BOOL,GlobalUnfix,HANDLE,a) -Fa(BOOL,GlobalUnlock,HANDLE,a) -#endif Fa(BOOL,InitAtomTable,WORD,a) +Fa(BOOL,IsCharAlpha,char,ch) +Fa(BOOL,IsCharAlphaNumeric,char,ch) +Fa(BOOL,IsCharLower,char,ch) +Fa(BOOL,IsCharUpper,char,ch) Fa(BOOL,IsClipboardFormatAvailable,WORD,a) Fa(BOOL,IsIconic,HWND,a) Fa(BOOL,IsRectEmpty,LPRECT,a) @@ -2473,32 +2460,27 @@ Fa(BOOL,OpenIcon,HWND,a) Fa(BOOL,RemoveFontResource,LPSTR,a) Fa(BOOL,SetDeskWallPaper,LPSTR,a) Fa(BOOL,SetErrorMode,WORD,a) +Fa(BOOL,SetMessageQueue,int,a) Fa(BOOL,SwapMouseButton,BOOL,a) +Fa(BOOL,TranslateMessage,LPMSG,a) Fa(BOOL,UnhookWindowsHookEx,HHOOK,a) Fa(BOOL,UnrealizeObject,HBRUSH,a) Fa(BYTE,GetTempDrive,BYTE,a) +Fa(COLORREF,GetBkColor,HDC,a) +Fa(COLORREF,GetSysColor,short,a) +Fa(COLORREF,GetTextColor,HDC,a) Fa(DWORD,GetAspectRatioFilter,HDC,a) Fa(DWORD,GetBitmapDimension,HBITMAP,a) -Fa(COLORREF,GetBkColor,HDC,a) Fa(DWORD,GetBrushOrg,HDC,a) Fa(DWORD,GetCurrentPosition,HDC,a) Fa(DWORD,GetDCOrg,HDC,a) Fa(DWORD,GetFreeSpace,WORD,a) -Fa(COLORREF,GetSysColor,short,a) -Fa(COLORREF,GetTextColor,HDC,a) Fa(DWORD,GetViewportExt,HDC,a) Fa(DWORD,GetViewportOrg,HDC,a) Fa(DWORD,GetWindowExt,HDC,a) Fa(DWORD,GetWindowOrg,HDC,a) -#ifndef GLOBAL_SOURCE -Fa(DWORD,GlobalCompact,DWORD,a) -Fa(DWORD,GlobalHandle,WORD,a) -Fa(DWORD,GlobalSize,HANDLE,a) -#endif Fa(DWORD,OemKeyScan,WORD,a) Fa(FARPROC,LocalNotify,FARPROC,a) -Fa(HDWP,BeginDeferWindowPos,INT,nNumWindows) -Fa(HMETAFILE,CloseMetaFile,HANDLE,a) Fa(HANDLE,CreateMetaFile,LPSTR,a) Fa(HANDLE,GetAtomHandle,ATOM,a) Fa(HANDLE,GetClipboardData,WORD,a) @@ -2508,11 +2490,6 @@ Fa(HANDLE,GetMetaFileBits,HANDLE,a) Fa(HANDLE,GetModuleHandle,LPSTR,a) Fa(HANDLE,GetStockObject,int,a) Fa(HANDLE,GetWindowTask,HWND,a) -#ifndef GLOBAL_SOURCE -Fa(HANDLE,GlobalFree,HANDLE,a) -Fa(HANDLE,GlobalLRUNewest,HANDLE,a) -Fa(HANDLE,GlobalLRUOldest,HANDLE,a) -#endif Fa(HANDLE,LoadLibrary,LPSTR,a) Fa(HANDLE,LocalFree,HANDLE,a) Fa(HANDLE,LocalHandle,WORD,a) @@ -2528,9 +2505,11 @@ Fa(HDC,CreateCompatibleDC,HDC,a) Fa(HDC,GetDC,HWND,a) Fa(HDC,GetDCState,HDC,a) Fa(HDC,GetWindowDC,HWND,a) +Fa(HDWP,BeginDeferWindowPos,INT,nNumWindows) Fa(HFONT,CreateFontIndirect,LOGFONT FAR*,a) Fa(HMENU,GetMenu,HWND,a) Fa(HMENU,LoadMenuIndirect,LPSTR,a) +Fa(HMETAFILE,CloseMetaFile,HANDLE,a) Fa(HPALETTE,CreatePalette,LPLOGPALETTE,a) Fa(HPEN,CreatePenIndirect,LOGPEN FAR*,a) Fa(HRGN,CreateEllipticRgnIndirect,LPRECT,a) @@ -2547,21 +2526,14 @@ Fa(HWND,SetClipboardViewer,HWND,a) Fa(HWND,SetFocus,HWND,a) Fa(HWND,SetSysModalWindow,HWND,a) Fa(HWND,WindowFromPoint,POINT,a) +Fa(INT,_lclose,INT,a) +Fa(INT,lstrlen,LPCSTR,a) +Fa(LONG,DispatchMessage,LPMSG,msg) Fa(LONG,SetSwapAreaSize,WORD,a) Fa(LPSTR,AnsiLower,LPSTR,a) Fa(LPSTR,AnsiNext,LPSTR,a) Fa(LPSTR,AnsiUpper,LPSTR,a) -#ifndef GLOBAL_SOURCE -Fa(LPSTR,GlobalLock,HANDLE,a) -Fa(LPSTR,GlobalWire,HANDLE,a) -#endif Fa(LPSTR,LockResource,HANDLE,a) -#ifndef GLOBAL_SOURCE -Fa(void,GlobalFix,HANDLE,a) -Fa(void,GlobalNotify,FARPROC,a) -#endif -Fa(void,LimitEmsPages,DWORD,a) -Fa(void,SetConvertHook,BOOL,a) Fa(UINT,GDIRealizePalette,HDC,a) Fa(UINT,RealizePalette,HDC,a) Fa(WORD,AllocDStoCSAlias,WORD,a) @@ -2569,15 +2541,16 @@ Fa(WORD,AllocSelector,WORD,a) Fa(WORD,ArrangeIconicWindows,HWND,a) Fa(WORD,EnumClipboardFormats,WORD,a) Fa(WORD,FreeSelector,WORD,a) +Fa(WORD,GetBkMode,HDC,a) Fa(WORD,GetDriveType,INT,a) +Fa(WORD,GetMapMode,HDC,a) Fa(WORD,GetMenuItemCount,HMENU,a) +Fa(WORD,GetPolyFillMode,HDC,a) +Fa(WORD,GetROP2,HDC,a) +Fa(WORD,GetRelAbs,HDC,a) +Fa(WORD,GetStretchBltMode,HDC,a) Fa(WORD,GetTaskQueue,HANDLE,a) Fa(WORD,GetTextAlign,HDC,a) -#ifndef GLOBAL_SOURCE -Fa(WORD,GlobalFlags,HANDLE,a) -Fa(WORD,GlobalPageLock,HANDLE,a) -Fa(WORD,GlobalPageUnlock,HANDLE,a) -#endif Fa(WORD,LocalCompact,WORD,a) Fa(WORD,LocalFlags,HANDLE,a) Fa(WORD,LocalSize,HANDLE,a) @@ -2593,16 +2566,10 @@ Fa(int,ClearCommBreak,int,a) Fa(int,CloseComm,int,a) Fa(int,CountVoiceNotes,int,a) Fa(int,GetAsyncKeyState,int,a) -Fa(WORD,GetBkMode,HDC,a) Fa(int,GetDlgCtrlID,HWND,a) Fa(int,GetKeyState,int,a) Fa(int,GetKeyboardType,int,a) -Fa(WORD,GetMapMode,HDC,a) Fa(int,GetModuleUsage,HANDLE,a) -Fa(WORD,GetPolyFillMode,HDC,a) -Fa(WORD,GetRelAbs,HDC,a) -Fa(WORD,GetROP2,HDC,a) -Fa(WORD,GetStretchBltMode,HDC,a) Fa(int,GetSystemMetrics,WORD,a) Fa(int,GetWindowTextLength,HWND,a) Fa(int,RestoreVisRgn,HDC,a) @@ -2623,39 +2590,36 @@ Fa(void,GetCaretPos,LPPOINT,a) Fa(void,GetCursorPos,LPPOINT,a) Fa(void,GetKeyboardState,BYTE FAR*,a) Fa(void,HideCaret,HWND,a) +Fa(void,LimitEmsPages,DWORD,a) Fa(void,MessageBeep,WORD,a) Fa(void,OutputDebugString,LPSTR,a) +Fa(void,PostQuitMessage,int,a) Fa(void,ReplyMessage,LONG,a) Fa(void,SetCaretBlinkTime,WORD,a) +Fa(void,SetConvertHook,BOOL,a) Fa(void,SetDoubleClickTime,WORD,a) Fa(void,SetKeyboardState,BYTE FAR*,a) Fa(void,SetRectEmpty,LPRECT,a) Fa(void,ShowCaret,HWND,a) Fa(void,SwapRecording,WORD,a) -Fb(BOOL,ExitWindows,DWORD,dwReserved,WORD,wReturnCode) -Fb(BOOL,GetBitmapDimensionEx,HBITMAP,a,LPSIZE,b) -Fb(BOOL,GetWindowPlacement,HWND,a,LPWINDOWPLACEMENT,b) -Fb(BOOL,SetWindowPlacement,HWND,a,LPWINDOWPLACEMENT,b) -Fb(BOOL,ShowWindow,HWND,a,int,b) -Fb(HDC,BeginPaint,HWND,a,LPPAINTSTRUCT,b) -Fb(LPSTR,lstrcat,LPSTR,a,LPCSTR,b ) -Fb(LPSTR,lstrcpy,LPSTR,a,LPCSTR,b ) -Fb(INT,_lcreat,LPSTR,a,INT,b) -Fb(INT,lstrcmp,LPCSTR,a,LPCSTR,b ) -Fb(INT,lstrcmpi,LPCSTR,a,LPCSTR,b ) -Fb(void,EndPaint,HWND,a,LPPAINTSTRUCT,b) -Fb(void,GetClientRect,HWND,a,LPRECT,b) -Fb(void,SetDCState,HDC,a,HDC,b) -Fb(BOOL,UnregisterClass,LPSTR,a,HANDLE,b) +Fa(void,UpdateWindow,HWND,a) Fb(BOOL,CallMsgFilter,LPMSG,a,short,b) Fb(BOOL,ChangeClipboardChain,HWND,a,HWND,b) Fb(BOOL,EnableWindow,HWND,a,BOOL,b) Fb(BOOL,EnumWindows,FARPROC,a,LONG,b) Fb(BOOL,EqualRect,LPRECT,a,LPRECT,b) Fb(BOOL,EqualRgn,HRGN,a,HRGN,b) +Fb(BOOL,ExitWindows,DWORD,dwReserved,WORD,wReturnCode) Fb(BOOL,FlashWindow,HWND,a,BOOL,b) +Fb(BOOL,GetBitmapDimensionEx,HBITMAP,a,LPSIZE,b) Fb(BOOL,GetBrushOrgEx,HDC,a,LPPOINT,b) +Fb(BOOL,GetCurrentPositionEx,HDC,a,LPPOINT,b) Fb(BOOL,GetTextMetrics,HDC,a,LPTEXTMETRIC,b) +Fb(BOOL,GetViewportExtEx,HDC,a,LPPOINT,b) +Fb(BOOL,GetViewportOrgEx,HDC,a,LPPOINT,b) +Fb(BOOL,GetWindowExtEx,HDC,a,LPPOINT,b) +Fb(BOOL,GetWindowOrgEx,HDC,a,LPPOINT,b) +Fb(BOOL,GetWindowPlacement,HWND,a,LPWINDOWPLACEMENT,b) Fb(BOOL,InvertRgn,HDC,a,HRGN,b) Fb(BOOL,IsChild,HWND,a,HWND,b) Fb(BOOL,IsDialogMessage,HWND,a,LPMSG,b) @@ -2671,20 +2635,19 @@ Fb(BOOL,ResizePalette,HPALETTE,a,WORD,b) Fb(BOOL,RestoreDC,HDC,a,short,b) Fb(BOOL,SetConvertParams,int,a,int,b) Fb(BOOL,SetMenu,HWND,a,HMENU,b) +Fb(BOOL,SetWindowPlacement,HWND,a,LPWINDOWPLACEMENT,b) +Fb(BOOL,ShowWindow,HWND,a,int,b) Fb(BOOL,TranslateMDISysAccel,HWND,a,LPMSG,b) Fb(BOOL,UnhookWindowsHook,short,a,HHOOK,b) +Fb(BOOL,UnregisterClass,LPSTR,a,HANDLE,b) Fb(DWORD,GetNearestColor,HDC,a,DWORD,b) Fb(DWORD,SetBkColor,HDC,a,COLORREF,b) Fb(DWORD,SetMapperFlags,HDC,a,DWORD,b) Fb(DWORD,SetTextColor,HDC,a,DWORD,b) Fb(FARPROC,GetProcAddress,HANDLE,a,LPSTR,b) Fb(FARPROC,MakeProcInstance,FARPROC,a,HANDLE,b) -Fb(HHOOK,SetWindowsHook,short,a,HOOKPROC,b) Fb(HANDLE,CopyMetaFile,HANDLE,a,LPSTR,b) Fb(HANDLE,GetProp,HWND,a,LPSTR,b) -#ifndef GLOBAL_SOURCE -Fb(HANDLE,GlobalAlloc,WORD,a,DWORD,b) -#endif Fb(HANDLE,LoadAccelerators,HANDLE,a,LPSTR,b) Fb(HANDLE,LoadModule,LPSTR,a,LPVOID,b) Fb(HANDLE,LoadResource,HANDLE,a,HANDLE,b) @@ -2696,26 +2659,31 @@ Fb(HBITMAP,LoadBitmap,HANDLE,a,LPSTR,b) Fb(HBRUSH,CreateDIBPatternBrush,HANDLE,a,WORD,b) Fb(HBRUSH,CreateHatchBrush,short,a,COLORREF,b) Fb(HCURSOR,LoadCursor,HANDLE,a,LPSTR,b) +Fb(HDC,BeginPaint,HWND,a,LPPAINTSTRUCT,b) +Fb(HHOOK,SetWindowsHook,short,a,HOOKPROC,b) Fb(HICON,LoadIcon,HANDLE,a,LPSTR,b) -Fb(HPALETTE,GDISelectPalette,HDC,a,HPALETTE,b) Fb(HMENU,GetSubMenu,HMENU,a,short,b) Fb(HMENU,GetSystemMenu,HWND,a,BOOL,b) Fb(HMENU,LoadMenu,HANDLE,a,LPSTR,b) Fb(HMENU,LookupMenuHandle,HMENU,a,INT,b) +Fb(HPALETTE,GDISelectPalette,HDC,a,HPALETTE,b) Fb(HWND,ChildWindowFromPoint,HWND,a,POINT,b) Fb(HWND,FindWindow,LPSTR,a,LPSTR,b) Fb(HWND,GetDlgItem,HWND,a,WORD,b) Fb(HWND,GetNextWindow,HWND,a,WORD,b) Fb(HWND,GetWindow,HWND,a,WORD,b) -Fb(BOOL,GetCurrentPositionEx,HDC,a,LPPOINT,b) -Fb(BOOL,GetViewportExtEx,HDC,a,LPPOINT,b) -Fb(BOOL,GetViewportOrgEx,HDC,a,LPPOINT,b) -Fb(BOOL,GetWindowExtEx,HDC,a,LPPOINT,b) -Fb(BOOL,GetWindowOrgEx,HDC,a,LPPOINT,b) Fb(HWND,SetParent,HWND,a,HWND,b) +Fb(INT,AnsiToOem,LPSTR,a,LPSTR,b) +Fb(INT,_lcreat,LPSTR,a,INT,b) +Fb(INT,_lopen,LPSTR,a,INT,b) +Fb(INT,lstrcmp,LPCSTR,a,LPCSTR,b ) +Fb(INT,lstrcmpi,LPCSTR,a,LPCSTR,b ) +Fb(LONG,EscapeCommFunction,int,a,int,b) Fb(LONG,GetClassLong,HWND,a,short,b) Fb(LONG,GetWindowLong,HWND,a,short,b) Fb(LPSTR,AnsiPrev,LPSTR,a,LPSTR,b) +Fb(LPSTR,lstrcat,LPSTR,a,LPCSTR,b ) +Fb(LPSTR,lstrcpy,LPSTR,a,LPCSTR,b ) Fb(WORD FAR*,SetCommEventMask,int,a,WORD,b) Fb(WORD,AnsiLowerBuff,LPSTR,a,WORD,b) Fb(WORD,AnsiUpperBuff,LPSTR,a,WORD,b) @@ -2731,24 +2699,21 @@ Fb(WORD,GetWindowsDirectory,LPSTR,a,WORD,b) Fb(WORD,IsDlgButtonChecked,HWND,a,WORD,b) Fb(WORD,LocalShrink,HANDLE,a,WORD,b) Fb(WORD,MapVirtualKey,WORD,a,WORD,b) -Fb(WORD,SetSystemPaletteUse,HDC,a,WORD,b) Fb(WORD,SetBkMode,HDC,a,WORD,b) Fb(WORD,SetMapMode,HDC,a,WORD,b) Fb(WORD,SetPolyFillMode,HDC,a,WORD,b) -Fb(WORD,SetRelAbs,HDC,a,WORD,b) Fb(WORD,SetROP2,HDC,a,WORD,b) +Fb(WORD,SetRelAbs,HDC,a,WORD,b) Fb(WORD,SetStretchBltMode,HDC,a,WORD,b) +Fb(WORD,SetSystemPaletteUse,HDC,a,WORD,b) Fb(WORD,SetTaskQueue,HANDLE,a,HANDLE,b) Fb(WORD,SetTextAlign,HDC,a,WORD,b) Fb(WORD,SizeofResource,HANDLE,a,HANDLE,b) Fb(WORD,WinExec,LPSTR,a,WORD,b) Fb(int,AccessResource,HANDLE,a,HANDLE,b) -Fb(INT,AnsiToOem,LPSTR,a,LPSTR,b) Fb(int,BuildCommDCB,LPSTR,a,DCB*,b) Fb(int,ConvertRequest,HWND,a,LPKANJISTRUCT,b) -Fb(void,CopyRect,LPRECT,a,LPRECT,b) Fb(int,EnumProps,HWND,a,FARPROC,b) -Fb(LONG,EscapeCommFunction,int,a,int,b) Fb(int,ExcludeUpdateRgn,HDC,a,HWND,b) Fb(int,FlushComm,int,a,int,b) Fb(int,GetClipBox,HDC,a,LPRECT,b) @@ -2768,8 +2733,11 @@ Fb(int,TransmitCommChar,int,a,char,b) Fb(int,UngetCommChar,int,a,char,b) Fb(short,SetTextCharacterExtra,HDC,a,short,b) Fb(void,ClientToScreen,HWND,a,LPPOINT,b) +Fb(void,CopyRect,LPRECT,a,LPRECT,b) Fb(void,DrawFocusRect,HDC,a,LPRECT,b) Fb(void,EndDialog,HWND,a,short,b) +Fb(void,EndPaint,HWND,a,LPPAINTSTRUCT,b) +Fb(void,GetClientRect,HWND,a,LPRECT,b) Fb(void,GetCodeInfo,FARPROC,lpProc,LPVOID,lpSegInfo) Fb(void,GetWindowRect,HWND,a,LPRECT,b) Fb(void,InvertRect,HDC,a,LPRECT,b) @@ -2779,30 +2747,27 @@ Fb(void,ProfSetup,int,a,int,b) Fb(void,ScreenToClient,HWND,a,LPPOINT,b) Fb(void,SetCaretPos,short,a,short,b) Fb(void,SetCursorPos,short,a,short,b) +Fb(void,SetDCState,HDC,a,HDC,b) Fb(void,SetWindowText,HWND,a,LPSTR,b) Fb(void,ShowOwnedPopups,HWND,a,BOOL,b) Fb(void,Throw,LPCATCHBUF,a,int,b) Fb(void,ValidateRect,HWND,a,LPRECT,b) Fb(void,ValidateRgn,HWND,a,HRGN,b) -Fc(BOOL,LineTo,HDC,a,short,b,short,c) -Fc(WORD,GetInternalWindowPos,HWND,a,LPRECT,b,LPPOINT,c) -Fc(LONG,_llseek,INT,a,LONG,b,INT,c) -Fc(INT,_lread,INT,a,LPSTR,b,WORD,c) -Fc(INT,_lwrite,INT,a,LPSTR,b,WORD,c) -Fc(int,FillRect,HDC,a,LPRECT,b,HBRUSH,c) -Fc(DWORD,MoveTo,HDC,a,short,b,short,c) Fc(BOOL,CheckMenuItem,HMENU,a,WORD,b,WORD,c) Fc(BOOL,DPtoLP,HDC,a,LPPOINT,b,int,c) Fc(BOOL,DeleteMenu,HMENU,a,WORD,b,WORD,c) Fc(BOOL,DlgDirSelect,HWND,a,LPSTR,b,int,c) Fc(BOOL,DlgDirSelectComboBox,HWND,a,LPSTR,b,int,c) Fc(BOOL,EnableMenuItem,HMENU,a,WORD,b,WORD,c) +Fc(BOOL,EnableScrollBar,HWND,a,INT,b,UINT,c) Fc(BOOL,EnumChildWindows,HWND,a,FARPROC,b,LONG,c) Fc(BOOL,EnumTaskWindows,HANDLE,a,FARPROC,b,LONG,c) Fc(BOOL,FillRgn,HDC,a,HRGN,b,HBRUSH,c) Fc(BOOL,GetClassInfo,HANDLE,a,LPSTR,b,LPWNDCLASS,c) Fc(BOOL,GetUpdateRect,HWND,a,LPRECT,b,BOOL,c) +Fc(BOOL,IntersectRect,LPRECT,a,LPRECT,b,LPRECT,c) Fc(BOOL,LPtoDP,HDC,a,LPPOINT,b,int,c) +Fc(BOOL,LineTo,HDC,a,short,b,short,c) Fc(BOOL,LocalInit,WORD,a,WORD,b,WORD,c) Fc(BOOL,Polygon,HDC,a,LPPOINT,b,int,c) Fc(BOOL,Polyline,HDC,a,LPPOINT,b,int,c) @@ -2810,12 +2775,12 @@ Fc(BOOL,PtInRegion,HRGN,a,short,b,short,c) Fc(BOOL,PtVisible,HDC,a,short,b,short,c) Fc(BOOL,RemoveMenu,HMENU,a,WORD,b,WORD,c) Fc(BOOL,SetProp,HWND,a,LPSTR,b,HANDLE,c) -Fc(BOOL,WriteProfileString,LPSTR,a,LPSTR,b,LPSTR,c) -Fc(BOOL,IntersectRect,LPRECT,a,LPRECT,b,LPRECT,c) -Fc(BOOL,UnionRect,LPRECT,a,LPRECT,b,LPRECT,c) Fc(BOOL,SubtractRect,LPRECT,a,LPRECT,b,LPRECT,c) +Fc(BOOL,UnionRect,LPRECT,a,LPRECT,b,LPRECT,c) +Fc(BOOL,WriteProfileString,LPSTR,a,LPSTR,b,LPSTR,c) Fc(DWORD,GetPixel,HDC,a,short,b,short,c) Fc(DWORD,GetTextExtent,HDC,a,LPSTR,b,short,c) +Fc(DWORD,MoveTo,HDC,a,short,b,short,c) Fc(DWORD,OffsetViewportOrg,HDC,a,short,b,short,c) Fc(DWORD,OffsetWindowOrg,HDC,a,short,b,short,c) Fc(DWORD,SetBitmapDimension,HBITMAP,a,short,b,short,c) @@ -2827,9 +2792,6 @@ Fc(DWORD,SetWindowOrg,HDC,a,short,b,short,c) Fc(FARPROC,SetResourceHandler,HANDLE,a,LPSTR,b,FARPROC,c) Fc(HANDLE,AllocResource,HANDLE,a,HANDLE,b,DWORD,c) Fc(HANDLE,FindResource,HANDLE,a,LPSTR,b,LPSTR,c) -#ifndef GLOBAL_SOURCE -Fc(HANDLE,GlobalReAlloc,HANDLE,a,DWORD,b,WORD,c) -#endif Fc(HANDLE,LocalReAlloc,HANDLE,a,WORD,b,WORD,c) Fc(HBITMAP,CreateCompatibleBitmap,HDC,a,short,b,short,c) Fc(HBITMAP,CreateDiscardableBitmap,HDC,a,short,b,short,c) @@ -2840,16 +2802,22 @@ Fc(HRGN,CreatePolygonRgn,LPPOINT,a,short,b,short,c) Fc(HWND,GetNextDlgGroupItem,HWND,a,HWND,b,BOOL,c) Fc(HWND,GetNextDlgTabItem,HWND,a,HWND,b,BOOL,c) Fc(INT,GetTextFace,HDC,a,INT,b,LPSTR,c) +Fc(INT,OpenFile,LPSTR,a,LPOFSTRUCT,b,WORD,c) +Fc(INT,_lread,INT,a,LPSTR,b,WORD,c) +Fc(INT,_lwrite,INT,a,LPSTR,b,WORD,c) Fc(LONG,GetBitmapBits,HBITMAP,a,LONG,b,LPSTR,c) Fc(LONG,SetBitmapBits,HBITMAP,a,LONG,b,LPSTR,c) Fc(LONG,SetClassLong,HWND,a,short,b,LONG,c) Fc(LONG,SetWindowLong,HWND,a,short,b,LONG,c) +Fc(LONG,_llseek,INT,a,LONG,b,INT,c) Fc(WORD,GetAtomName,ATOM,a,LPSTR,b,short,c) +Fc(WORD,GetInternalWindowPos,HWND,a,LPRECT,b,LPPOINT,c) Fc(WORD,GetMenuState,HMENU,a,WORD,b,WORD,c) Fc(WORD,GetProfileInt,LPSTR,a,LPSTR,b,int,c) Fc(WORD,GlobalGetAtomName,ATOM,a,LPSTR,b,short,c) Fc(WORD,SetClassWord,HWND,a,short,b,WORD,c) Fc(WORD,SetWindowWord,HWND,a,short,b,WORD,c) +Fc(int,FillRect,HDC,a,LPRECT,b,HBRUSH,c) Fc(int,FrameRect,HDC,a,LPRECT,b,HBRUSH,c) Fc(int,GetClassName,HWND,a,LPSTR,b,short,c) Fc(int,GetClipboardFormatName,WORD,a,LPSTR,b,short,c) @@ -2864,7 +2832,6 @@ Fc(int,MulDiv,int,a,int,b,int,c) Fc(int,OffsetClipRgn,HDC,a,short,b,short,c) Fc(int,OffsetRgn,HRGN,a,short,b,short,c) Fc(int,OpenComm,LPSTR,a,WORD,b,WORD,c) -Fc(INT,OpenFile,LPSTR,a,LPOFSTRUCT,b,WORD,c) Fc(int,ReadComm,int,a,LPSTR,b,int,c) Fc(int,SetEnvironment,LPSTR,a,LPSTR,b,WORD,c) Fc(int,SetVoiceEnvelope,int,a,int,b,int,c) @@ -2886,25 +2853,30 @@ Fc(void,SetSysColors,int,a,LPINT,b,COLORREF*,c) Fc(void,ShowScrollBar,HWND,a,WORD,b,BOOL,c) Fc(void,SwitchStackTo,WORD,a,WORD,b,WORD,c) Fd(BOOL,AppendMenu,HMENU,a,WORD,b,WORD,c,LPSTR,d) -Fd(BOOL,PostMessage,HWND,a,WORD,b,WORD,c,LONG,d) -Fd(LONG,SendMessage,HWND,a,WORD,b,WORD,c,LONG,d) -Fd(BOOL,GetMessage,LPMSG,msg,HWND,b,WORD,c,WORD,d) -Fd(BOOL,GetTextExtentPoint,HDC,a,LPSTR,b,short,c,LPSIZE,d) Fd(BOOL,DrawIcon,HDC,a,short,b,short,c,HICON,d) Fd(BOOL,EnumMetaFile,HDC,a,LOCALHANDLE,b,FARPROC,c,BYTE FAR*,d) Fd(BOOL,FloodFill,HDC,a,INT,b,INT,c,COLORREF,d) Fd(BOOL,GetCharWidth,HDC,a,WORD,b,WORD,c,LPINT,d) +Fd(BOOL,GetMessage,LPMSG,msg,HWND,b,WORD,c,WORD,d) +Fd(BOOL,GetTextExtentPoint,HDC,a,LPSTR,b,short,c,LPSIZE,d) Fd(BOOL,HiliteMenuItem,HWND,a,HMENU,b,WORD,c,WORD,d) Fd(BOOL,MoveToEx,HDC,a,short,b,short,c,LPPOINT,d) +Fd(BOOL,OffsetViewportOrgEx,HDC,a,short,b,short,c,LPPOINT,d) +Fd(BOOL,OffsetWindowOrgEx,HDC,a,short,b,short,c,LPPOINT,d) Fd(BOOL,PolyPolygon,HDC,a,LPPOINT,b,LPINT,c,WORD,d) Fd(BOOL,PostAppMessage,HANDLE,a,WORD,b,WORD,c,LONG,d) +Fd(BOOL,PostMessage,HWND,a,WORD,b,WORD,c,LONG,d) Fd(BOOL,RedrawWindow,HWND,a,LPRECT,b,HRGN,c,UINT,d) Fd(BOOL,SetBitmapDimensionEx,HBITMAP,a,short,b,short,c,LPSIZE,d) +Fd(BOOL,SetViewportExtEx,HDC,a,short,b,short,c,LPSIZE,d) +Fd(BOOL,SetViewportOrgEx,HDC,a,short,b,short,c,LPPOINT,d) +Fd(BOOL,SetWindowExtEx,HDC,a,short,b,short,c,LPSIZE,d) +Fd(BOOL,SetWindowOrgEx,HDC,a,short,b,short,c,LPPOINT,d) Fd(BOOL,WinHelp,HWND,hwndMain,LPSTR,lpszHelp,WORD,usCommand,DWORD,ulData) Fd(BOOL,WritePrivateProfileString,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d) -Fd(DWORD,DefHookProc,short,a,WORD,b,DWORD,c,HHOOK FAR*,d) -Fd(DWORD,CallNextHookEx,HHOOK,a,short,b,WPARAM,c,LPARAM,d) Fd(COLORREF,SetPixel,HDC,a,short,b,short,c,COLORREF,d) +Fd(DWORD,CallNextHookEx,HHOOK,a,short,b,WPARAM,c,LPARAM,d) +Fd(DWORD,DefHookProc,short,a,WORD,b,DWORD,c,HHOOK FAR*,d) Fd(HDC,CreateDC,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d) Fd(HDC,CreateIC,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d) Fd(HHOOK,SetWindowsHookEx,short,a,HOOKPROC,b,HINSTANCE,c,HTASK,d) @@ -2913,9 +2885,11 @@ Fd(HRGN,CreatePolyPolygonRgn,LPPOINT,a,LPINT,b,short,c,short,d) Fd(HRGN,CreateRectRgn,short,a,short,b,short,c,short,d) Fd(HWND,CreateDialog,HANDLE,a,LPCSTR,b,HWND,c,WNDPROC,d) Fd(HWND,CreateDialogIndirect,HANDLE,a,LPCSTR,b,HWND,c,WNDPROC,d) +Fd(INT,GetTempFileName,BYTE,a,LPCSTR,b,UINT,c,LPSTR,d) Fd(LONG,DefDlgProc,HWND,a,WORD,b,WORD,c,LONG,d) Fd(LONG,DefMDIChildProc,HWND,a,WORD,b,WORD,c,LONG,d) Fd(LONG,DefWindowProc,HWND,a,WORD,b,WORD,c,LONG,d) +Fd(LONG,SendMessage,HWND,a,WORD,b,WORD,c,LONG,d) Fd(WORD,GetDlgItemInt,HWND,a,WORD,b,BOOL FAR*,c,BOOL,d) Fd(WORD,GetPaletteEntries,HPALETTE,a,WORD,b,WORD,c,LPPALETTEENTRY,d) Fd(WORD,GetPrivateProfileInt,LPSTR,a,LPSTR,b,short,c,LPSTR,d) @@ -2923,19 +2897,12 @@ Fd(WORD,GetSystemPaletteEntries,HDC,a,WORD,b,WORD,c,LPPALETTEENTRY,d) Fd(WORD,SetPaletteEntries,HPALETTE,a,WORD,b,WORD,c,LPPALETTEENTRY,d) Fd(WORD,SetSystemTimer,HWND,a,WORD,d,WORD,b,FARPROC,c) Fd(WORD,SetTimer,HWND,a,WORD,d,WORD,b,FARPROC,c) -Fd(BOOL,SetViewportExtEx,HDC,a,short,b,short,c,LPSIZE,d) -Fd(BOOL,SetViewportOrgEx,HDC,a,short,b,short,c,LPPOINT,d) -Fd(BOOL,SetWindowExtEx,HDC,a,short,b,short,c,LPSIZE,d) -Fd(BOOL,SetWindowOrgEx,HDC,a,short,b,short,c,LPPOINT,d) -Fd(BOOL,OffsetViewportOrgEx,HDC,a,short,b,short,c,LPPOINT,d) -Fd(BOOL,OffsetWindowOrgEx,HDC,a,short,b,short,c,LPPOINT,d) Fd(int,CombineRgn,HRGN,a,HRGN,b,HRGN,c,short,d) Fd(int,DialogBox,HINSTANCE,a,LPCSTR,b,HWND,c,WNDPROC,d) Fd(int,DialogBoxIndirect,HANDLE,a,HANDLE,b,HWND,c,WNDPROC,d) Fd(int,EnumFonts,HDC,a,LPSTR,b,FARPROC,c,LPSTR,d) Fd(int,EnumObjects,HDC,a,int,b,FARPROC,c,LPSTR,d) Fd(int,GetDlgItemText,HWND,a,WORD,b,LPSTR,c,WORD,d) -Fd(INT,GetTempFileName,BYTE,a,LPCSTR,b,UINT,c,LPSTR,d) Fd(int,LoadString,HANDLE,a,WORD,b,LPSTR,c,int,d) Fd(int,MessageBox,HWND,a,LPSTR,b,LPSTR,c,WORD,d) Fd(int,SetScrollPos,HWND,a,int,b,int,c,BOOL,d) @@ -2948,18 +2915,16 @@ Fd(void,FillWindow,HWND,a,HWND,b,HDC,c,HBRUSH,d) Fd(void,GetScrollRange,HWND,a,int,b,LPINT,c,LPINT,d) Fd(void,MapWindowPoints,HWND,a,HWND,b,LPPOINT,c,WORD,d) Fd(void,PlayMetaFileRecord,HDC,a,LPHANDLETABLE,b,LPMETARECORD,c,WORD,d) -Fd(void,SetInternalWindowPos,HWND,a,WORD,b,LPRECT,c,LPPOINT,d) Fd(void,SetDlgItemInt,HWND,a,WORD,b,WORD,c,BOOL,d) -Fe(BOOL,Rectangle,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom) -Fe(int,DrawText,HDC,a,LPSTR,str,int,c,LPRECT,d,WORD,flag) -Fe(BOOL,PeekMessage,LPMSG,a,HWND,b,WORD,c,WORD,d,WORD,e) -Fe(LONG,CallWindowProc,WNDPROC,a,HWND,b,WORD,c,WORD,d,LONG,e) +Fd(void,SetInternalWindowPos,HWND,a,WORD,b,LPRECT,c,LPPOINT,d) Fe(BOOL,ChangeMenu,HMENU,a,WORD,b,LPSTR,c,WORD,d,WORD,e) Fe(BOOL,Ellipse,HDC,a,int,b,int,c,int,d,int,e) Fe(BOOL,ExtFloodFill,HDC,a,INT,b,INT,c,COLORREF,d,WORD,e) Fe(BOOL,FrameRgn,HDC,a,HRGN,b,HBRUSH,e,int,c,int,d) Fe(BOOL,InsertMenu,HMENU,a,WORD,b,WORD,c,WORD,d,LPSTR,e) Fe(BOOL,ModifyMenu,HMENU,a,WORD,b,WORD,c,WORD,d,LPSTR,e) +Fe(BOOL,PeekMessage,LPMSG,a,HWND,b,WORD,c,WORD,d,WORD,e) +Fe(BOOL,Rectangle,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom) Fe(BOOL,SetMenuItemBitmaps,HMENU,a,WORD,b,WORD,c,HBITMAP,d,HBITMAP,e) Fe(BOOL,TextOut,HDC,a,short,b,short,c,LPSTR,d,short,e) Fe(DWORD,GetTabbedTextExtent,HDC,a,LPSTR,b,int,c,int,d,LPINT,e) @@ -2968,12 +2933,14 @@ Fe(DWORD,ScaleWindowExt,HDC,a,short,b,short,c,short,d,short,e) Fe(HBITMAP,CreateBitmap,short,a,short,b,BYTE,c,BYTE,d,LPSTR,e) Fe(HWND,CreateDialogIndirectParam,HANDLE,a,LPCSTR,b,HWND,c,WNDPROC,d,LPARAM,e) Fe(HWND,CreateDialogParam,HANDLE,a,LPCSTR,b,HWND,c,WNDPROC,d,LPARAM,e) +Fe(LONG,CallWindowProc,WNDPROC,a,HWND,b,WORD,c,WORD,d,LONG,e) Fe(LONG,DefFrameProc,HWND,a,HWND,b,WORD,c,WORD,d,LONG,e) Fe(LONG,SendDlgItemMessage,HWND,a,WORD,b,WORD,c,WORD,d,LONG,e) Fe(int,DialogBoxIndirectParam,HANDLE,a,HANDLE,b,HWND,c,WNDPROC,d,LONG,e) Fe(int,DialogBoxParam,HANDLE,a,LPCSTR,b,HWND,c,WNDPROC,d,LONG,e) Fe(int,DlgDirList,HWND,a,LPSTR,b,int,c,int,d,WORD,e) Fe(int,DlgDirListComboBox,HWND,a,LPSTR,b,int,c,int,d,WORD,e) +Fe(int,DrawText,HDC,a,LPSTR,str,int,c,LPRECT,d,WORD,flag) Fe(int,Escape,HDC,a,int,b,int,c,LPSTR,d,LPSTR,e) Fe(int,ExcludeClipRect,HDC,a,short,b,short,c,short,d,short,e) Fe(int,ExcludeVisRect,HDC,a,short,b,short,c,short,d,short,e) @@ -2988,38 +2955,59 @@ Fe(void,ScrollWindow,HWND,a,short,b,short,c,LPRECT,d,LPRECT,e) Fe(void,SetRect,LPRECT,a,short,b,short,c,short,d,short,e) Fe(void,SetRectRgn,HRGN,a,short,b,short,c,short,d,short,e) Fe(void,SetScrollRange,HWND,a,int,b,int,c,int,d,BOOL,e) +Ff(BOOL,MoveWindow,HWND,a,short,b,short,c,short,d,short,e,BOOL,f) Ff(BOOL,PatBlt,HDC,a,short,b,short,c,short,d,short,e,DWORD,f) +Ff(BOOL,ScaleViewportExtEx,HDC,a,short,b,short,c,short,d,short,e,LPSIZE,f) +Ff(BOOL,ScaleWindowExtEx,HDC,a,short,b,short,c,short,d,short,e,LPSIZE,f) Ff(HBITMAP,CreateDIBitmap,HDC,a,LPBITMAPINFOHEADER,b,DWORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f) Ff(HRGN,CreateRoundRectRgn,short,a,short,b,short,c,short,d,short,e,short,f) Ff(short,GetPrivateProfileString,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d,short,e,LPSTR,f) Ff(void,LineDDA,short,a,short,b,short,c,short,d,FARPROC,e,long,f) -Ff(BOOL,MoveWindow,HWND,a,short,b,short,c,short,d,short,e,BOOL,f) -Ff(BOOL,ScaleViewportExtEx,HDC,a,short,b,short,c,short,d,short,e,LPSIZE,f) -Ff(BOOL,ScaleWindowExtEx,HDC,a,short,b,short,c,short,d,short,e,LPSIZE,f) Fg(BOOL,RoundRect,HDC,a,short,b,short,c,short,d,short,e,short,f,short,g) Fg(BOOL,ScrollDC,HDC,a,short,b,short,c,LPRECT,d,LPRECT,e,HRGN,f,LPRECT,g) +Fg(BOOL,SetWindowPos,HWND,a,HWND,b,short,c,short,d,short,e,short,f,WORD,g) Fg(BOOL,TrackPopupMenu,HMENU,a,WORD,b,short,c,short,d,short,e,HWND,f,LPRECT,g) Fg(HCURSOR,CreateCursor,HANDLE,a,short,b,short,c,short,d,short,e,LPSTR,f,LPSTR,g) Fg(HICON,CreateIcon,HANDLE,a,int,b,int,c,BYTE,d,BYTE,e,LPSTR,f,LPSTR,g) Fg(int,GetDIBits,HDC,a,HANDLE,a2,WORD,b,WORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f) Fg(int,SetDIBits,HDC,a,HANDLE,a2,WORD,b,WORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f) -Fg(BOOL,SetWindowPos,HWND,a,HWND,b,short,c,short,d,short,e,short,f,WORD,g) Fh(BOOL,ExtTextOut,HDC,a,short,b,short,c,WORD,d,LPRECT,e,LPSTR,f,WORD,g,LPINT,h) Fh(HDWP,DeferWindowPos,HDWP,hWinPosInfo,HWND,hWnd,HWND,hWndInsertAfter,INT,x,INT,y,INT,cx,INT,cy,WORD,wFlags) Fh(LONG,TabbedTextOut,HDC,a,short,b,short,c,LPSTR,d,short,e,short,f,LPINT,g,short,h) Fh(int,ScrollWindowEx,HWND,a,short,b,short,c,LPRECT,d,LPRECT,e,HRGN,f,LPRECT,g,WORD,h) Fi(BOOL,Arc,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd) -Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd) Fi(BOOL,BitBlt,HDC,a,short,b,short,c,short,d,short,e,HDC,f,short,g,short,h,DWORD,i) +Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd) Fi(BOOL,GrayString,HDC,a,HBRUSH,b,FARPROC,gsprc,LPARAM,lParam,INT,cch,INT,x,INT,y,INT,cx,INT,cy) Fi(BOOL,Pie,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd) -Fk(HWND,CreateWindow,LPSTR,szAppName,LPSTR,Label,DWORD,ol,short,x,short,y,short,w,short,h,HWND,d,HMENU,e,,HANDLE i,LPSTR,g) Fk(BOOL,StretchBlt,HDC,a,short,b,short,c,short,d,short,e,HDC,f,short,g,short,h,short,i,short,j,DWORD,k) +Fk(HWND,CreateWindow,LPSTR,szAppName,LPSTR,Label,DWORD,ol,short,x,short,y,short,w,short,h,HWND,d,HMENU,e,,HANDLE i,LPSTR,g) Fl(HWND,CreateWindowEx,DWORD,a,LPSTR,b,LPSTR,c,DWORD,d,short,e,short,f,short,g,short,h,HWND,i,HMENU,j,HANDLE,k,LPSTR,l) Fl(int,SetDIBitsToDevice,HDC,a,short,b,short,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,h,WORD,i,LPSTR,j,LPBITMAPINFO,k,WORD,l) Fm(int,StretchDIBits,HDC,a,WORD,b,WORD,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,h,WORD,i,LPSTR,j,LPBITMAPINFO,k,WORD,l,DWORD,m) Fn(HFONT,CreateFont,int,a,int,b,int,c,int,d,int,e,BYTE,f,BYTE,g,BYTE,h,BYTE,i,BYTE,j,BYTE,k,BYTE,l,BYTE,m,LPSTR,n) +#ifndef GLOBAL_SOURCE +Fa(BOOL,GlobalUnWire,HANDLE,a) +Fa(BOOL,GlobalUnfix,HANDLE,a) +Fa(BOOL,GlobalUnlock,HANDLE,a) +Fa(DWORD,GlobalCompact,DWORD,a) +Fa(DWORD,GlobalHandle,WORD,a) +Fa(DWORD,GlobalSize,HANDLE,a) +Fa(HANDLE,GlobalFree,HANDLE,a) +Fa(HANDLE,GlobalLRUNewest,HANDLE,a) +Fa(HANDLE,GlobalLRUOldest,HANDLE,a) +Fa(LPSTR,GlobalLock,HANDLE,a) +Fa(LPSTR,GlobalWire,HANDLE,a) +Fa(WORD,GlobalFlags,HANDLE,a) +Fa(WORD,GlobalPageLock,HANDLE,a) +Fa(WORD,GlobalPageUnlock,HANDLE,a) +Fa(void,GlobalFix,HANDLE,a) +Fa(void,GlobalNotify,FARPROC,a) +Fb(HANDLE,GlobalAlloc,WORD,a,DWORD,b) +Fc(HANDLE,GlobalReAlloc,HANDLE,a,DWORD,b,WORD,c) +#endif + #ifdef WINELIB #define WINELIB_UNIMP(x) fprintf (stderr, "WineLib: Unimplemented %s\n", x) #endif diff --git a/loader/ne_image.c b/loader/ne_image.c index 4e2e45b8882..8cf62a9ffe6 100644 --- a/loader/ne_image.c +++ b/loader/ne_image.c @@ -25,8 +25,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; #include "arch.h" #include "options.h" #include "stddebug.h" -/* #define DEBUG_FIXUP */ -/* #undef DEBUG_FIXUP */ #include "debug.h" extern HANDLE CreateNewTask(HINSTANCE hInst); @@ -202,7 +200,6 @@ GetModuleName(struct w_files * wpnt, int index, char *buffer) int FixupSegment(struct w_files * wpnt, int segment_num) { - int fd = wpnt->fd; struct mz_header_s *mz_header = wpnt->mz_header; struct ne_header_s *ne_header = wpnt->ne->ne_header; struct ne_segment_table_entry_s *seg_table = wpnt->ne->seg_table; @@ -237,14 +234,14 @@ FixupSegment(struct w_files * wpnt, int segment_num) if (i == 0) i = 0x10000; - status = lseek(fd, seg->seg_data_offset * + status = lseek(wpnt->fd, seg->seg_data_offset * (1 << ne_header->align_shift_count) + i, SEEK_SET); n_entries = 0; - read(fd, &n_entries, sizeof(short int)); + read(wpnt->fd, &n_entries, sizeof(short int)); rep = (struct relocation_entry_s *) malloc(n_entries * sizeof(struct relocation_entry_s)); - if (read(fd,rep, n_entries * sizeof(struct relocation_entry_s)) != + if (read(wpnt->fd, rep, n_entries * sizeof(struct relocation_entry_s)) != n_entries * sizeof(struct relocation_entry_s)) { myerror("Unable to read relocation information"); @@ -300,7 +297,7 @@ FixupSegment(struct w_files * wpnt, int segment_num) return -1; } - if (GetImportedName(fd, mz_header, ne_header, + if (GetImportedName(wpnt->fd, mz_header, ne_header, rep->target2, func_name) == NULL) { fprintf(stderr,"getimportedname failed"); diff --git a/loader/ne_resource.c b/loader/ne_resource.c index 9e665c0285a..aeeab19700b 100644 --- a/loader/ne_resource.c +++ b/loader/ne_resource.c @@ -15,19 +15,12 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; #include "dlls.h" #include "resource.h" #include "stddebug.h" -/* #define DEBUG_RESOURCE */ -/* #undef DEBUG_RESOURCE */ #include "debug.h" - - -static int ResourceFd = -1; -static HANDLE ResourceInst = 0; -static struct w_files *ResourceFileInfo; /********************************************************************** - * RSC_LoadNameTable + * NE_LoadNameTable */ -void RSC_LoadNameTable(void) +static void NE_LoadNameTable(struct w_files *wpnt) { struct resource_typeinfo_s typeinfo; struct resource_nameinfo_s nameinfo; @@ -37,26 +30,21 @@ void RSC_LoadNameTable(void) char *p; int i; unsigned short len; - off_t rtoff; off_t saved_pos; top = NULL; - /* * Move to beginning of resource table. */ - rtoff = (ResourceFileInfo->mz_header->ne_offset + - ResourceFileInfo->ne->ne_header->resource_tab_offset); - lseek(ResourceFd, rtoff, SEEK_SET); - + lseek(wpnt->fd, wpnt->mz_header->ne_offset + + wpnt->ne->ne_header->resource_tab_offset, SEEK_SET); + /* * Read block size. */ - if (read(ResourceFd, &size_shift, sizeof(size_shift)) != - sizeof(size_shift)) - { + if (read(wpnt->fd, &size_shift, sizeof(size_shift)) != sizeof(size_shift)) return; - } + size_shift = CONV_SHORT(size_shift); /* @@ -65,97 +53,48 @@ void RSC_LoadNameTable(void) typeinfo.type_id = 0xffff; while (typeinfo.type_id != 0) { - if (!load_typeinfo (ResourceFd, &typeinfo)) + if (read(wpnt->fd, &typeinfo, sizeof(typeinfo)) != sizeof(typeinfo)) break; if (typeinfo.type_id == 0) break; + if (typeinfo.type_id == 0x800f) { for (i = 0; i < typeinfo.count; i++) { - if (read(ResourceFd, &nameinfo, sizeof(nameinfo)) != - sizeof(nameinfo)) - { + if (read(wpnt->fd, &nameinfo, sizeof(nameinfo)) != sizeof(nameinfo)) break; - } - saved_pos = lseek(ResourceFd, 0, SEEK_CUR); - lseek(ResourceFd, (long) nameinfo.offset << size_shift, + saved_pos = lseek(wpnt->fd, 0, SEEK_CUR); + lseek(wpnt->fd, (long) nameinfo.offset << size_shift, SEEK_SET); - read(ResourceFd, &len, sizeof(len)); + read(wpnt->fd, &len, sizeof(len)); while (len) { new = (RESNAMTAB *) GlobalQuickAlloc(sizeof(*new)); new->next = top; top = new; - read(ResourceFd, &new->type_ord, 2); - read(ResourceFd, &new->id_ord, 2); - read(ResourceFd, read_buf, len - 6); + read(wpnt->fd, &new->type_ord, 2); + read(wpnt->fd, &new->id_ord, 2); + read(wpnt->fd, read_buf, len - 6); p = read_buf + strlen(read_buf) + 1; strncpy(new->id, p, MAX_NAME_LENGTH); new->id[MAX_NAME_LENGTH - 1] = '\0'; - read(ResourceFd, &len, sizeof(len)); + read(wpnt->fd, &len, sizeof(len)); } - - lseek(ResourceFd, saved_pos, SEEK_SET); + lseek(wpnt->fd, saved_pos, SEEK_SET); } - break; - } - else - { - lseek(ResourceFd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); - } - } - ResourceFileInfo->ne->resnamtab = top; -} - -/********************************************************************** - * OpenResourceFile - */ -int -OpenResourceFile(HANDLE instance) -{ - struct w_files *w; - char *res_file; - - if (ResourceInst == instance) - return ResourceFd; - - w = GetFileInfo(instance); - if (w == NULL) - return -1; - ResourceFileInfo = w; - res_file = w->filename; - - if (ResourceFd >= 0) - close(ResourceFd); - - ResourceInst = instance; - ResourceFd = open (res_file, O_RDONLY); -#if 1 -#ifndef WINELIB - if (w->ne->resnamtab == (RESNAMTAB *) -1) - { - RSC_LoadNameTable(); + } else + lseek(wpnt->fd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); } -#endif -#endif - - dprintf_resource(stddeb, "OpenResourceFile(%04X) // file='%s' hFile=%04X !\n", - instance, w->filename, ResourceFd); - return ResourceFd; + wpnt->ne->resnamtab = top; } -int load_typeinfo (int fd, struct resource_typeinfo_s *typeinfo) -{ - return read (fd, typeinfo, sizeof (*typeinfo)) == sizeof (*typeinfo); -} - -int type_match(int type_id1, int type_id2, int fd, off_t off) +static int type_match(int type_id1, int type_id2, int fd, off_t off) { off_t old_pos; unsigned char c; @@ -172,10 +111,12 @@ int type_match(int type_id1, int type_id2, int fd, off_t off) if ((type_id2 & 0x8000) != 0) return 0; dprintf_resource(stddeb, "type_compare: type_id2=%04X !\n", type_id2); + old_pos = lseek(fd, 0, SEEK_CUR); lseek(fd, off + type_id2, SEEK_SET); read(fd, &c, 1); - nbytes = CONV_CHAR_TO_LONG (c); + nbytes = CONV_CHAR_TO_LONG(c); + dprintf_resource(stddeb, "type_compare: namesize=%d\n", nbytes); read(fd, name, nbytes); lseek(fd, old_pos, SEEK_SET); @@ -187,9 +128,7 @@ int type_match(int type_id1, int type_id2, int fd, off_t off) /********************************************************************** * FindResourceByNumber */ -int -FindResourceByNumber(struct resource_nameinfo_s *result_p, - int type_id, int resource_id) +static int FindResourceByNumber(RESOURCE *r, int type_id, int resource_id) { struct resource_typeinfo_s typeinfo; struct resource_nameinfo_s nameinfo; @@ -197,58 +136,54 @@ FindResourceByNumber(struct resource_nameinfo_s *result_p, int i; off_t rtoff; - /* - * Move to beginning of resource table. - */ - rtoff = (ResourceFileInfo->mz_header->ne_offset + - ResourceFileInfo->ne->ne_header->resource_tab_offset); - lseek(ResourceFd, rtoff, SEEK_SET); - - /* - * Read block size. - */ - if (read(ResourceFd, &size_shift, sizeof(size_shift)) != - sizeof(size_shift)) - { + dprintf_resource(stddeb, "FindResourceByNumber: type_id =%x,m res_id = %x\n", + type_id, resource_id); + + /* Move to beginning of resource table */ + rtoff = (r->wpnt->mz_header->ne_offset + + r->wpnt->ne->ne_header->resource_tab_offset); + lseek(r->wpnt->fd, rtoff, SEEK_SET); + + /* Read block size */ + if (read(r->wpnt->fd, &size_shift, sizeof(size_shift)) != sizeof(size_shift)) { printf("FindResourceByNumber (%d) bad block size !\n",(int) resource_id); return -1; } size_shift = CONV_SHORT(size_shift); - /* - * Find resource. - */ + + /* Find resource */ for (;;) { - if (!load_typeinfo (ResourceFd, &typeinfo)){ + if (read(r->wpnt->fd, &typeinfo, sizeof(typeinfo)) != sizeof(typeinfo)) { printf("FindResourceByNumber (%X) bad typeinfo size !\n", resource_id); return -1; - } + } dprintf_resource(stddeb, "FindResourceByNumber type=%X count=%d ?=%ld searched=%08X\n", typeinfo.type_id, typeinfo.count, typeinfo.reserved, type_id); - if (typeinfo.type_id == 0) break; - if (type_match(type_id, typeinfo.type_id, ResourceFd, rtoff)) { + if (typeinfo.type_id == 0) + break; + if (type_match(type_id, typeinfo.type_id, r->wpnt->fd, rtoff)) { for (i = 0; i < typeinfo.count; i++) { #ifndef WINELIB - if (read(ResourceFd, &nameinfo, sizeof(nameinfo)) != - sizeof(nameinfo)) + if (read(r->wpnt->fd, &nameinfo, sizeof(nameinfo)) != sizeof(nameinfo)) #else - if (!load_nameinfo (ResourceFd, &nameinfo)) + if (!load_nameinfo(r->wpnt->fd, &nameinfo)) #endif { printf("FindResourceByNumber (%X) bad nameinfo size !\n", resource_id); return -1; - } + } dprintf_resource(stddeb, "FindResource: search type=%X id=%X // type=%X id=%X\n", type_id, resource_id, typeinfo.type_id, nameinfo.id); if (nameinfo.id == resource_id) { - memcpy(result_p, &nameinfo, sizeof(nameinfo)); - return size_shift; + r->size = nameinfo.length << size_shift; + r->offset = nameinfo.offset << size_shift; + return size_shift; } } } - else { - lseek(ResourceFd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); - } + else + lseek(r->wpnt->fd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); } return -1; } @@ -256,9 +191,7 @@ FindResourceByNumber(struct resource_nameinfo_s *result_p, /********************************************************************** * FindResourceByName */ -int -FindResourceByName(struct resource_nameinfo_s *result_p, - int type_id, char *resource_name) +static int FindResourceByName(RESOURCE *r, int type_id, char *resource_name) { struct resource_typeinfo_s typeinfo; struct resource_nameinfo_s nameinfo; @@ -269,65 +202,51 @@ FindResourceByName(struct resource_nameinfo_s *result_p, int i; off_t rtoff; - /* - * Check for loaded name table. - */ - if (ResourceFileInfo->ne->resnamtab != NULL) - { + /* Check for loaded name table */ + if (r->wpnt->ne->resnamtab != NULL) { RESNAMTAB *e; - for (e = ResourceFileInfo->ne->resnamtab; e != NULL; e = e->next) - { - if (e->type_ord == (type_id & 0x000f) && - strcasecmp(e->id, resource_name) == 0) + for (e = r->wpnt->ne->resnamtab; e != NULL; e = e->next) + if (e->type_ord == (type_id & 0x000f) && + strcasecmp(e->id, resource_name) == 0) { - return FindResourceByNumber(result_p, type_id, e->id_ord); + return FindResourceByNumber(r, type_id, e->id_ord); } - } - - return -1; + return -1; } - /* - * Move to beginning of resource table. - */ - rtoff = (ResourceFileInfo->mz_header->ne_offset + - ResourceFileInfo->ne->ne_header->resource_tab_offset); - lseek(ResourceFd, rtoff, SEEK_SET); - - /* - * Read block size. - */ - if (read(ResourceFd, &size_shift, sizeof(size_shift)) != - sizeof(size_shift)) + /* Move to beginning of resource table */ + rtoff = (r->wpnt->mz_header->ne_offset + + r->wpnt->ne->ne_header->resource_tab_offset); + lseek(r->wpnt->fd, rtoff, SEEK_SET); + + /* Read block size */ + if (read(r->wpnt->fd, &size_shift, sizeof(size_shift)) != sizeof(size_shift)) { printf("FindResourceByName (%s) bad block size !\n", resource_name); return -1; } size_shift = CONV_SHORT (size_shift); - /* - * Find resource. - */ + /* Find resource */ for (;;) { - if (!load_typeinfo (ResourceFd, &typeinfo)) - { + if (read(r->wpnt->fd, &typeinfo, sizeof(typeinfo)) != sizeof(typeinfo)) { printf("FindResourceByName (%s) bad typeinfo size !\n", resource_name); return -1; } dprintf_resource(stddeb, "FindResourceByName typeinfo.type_id=%X count=%d type_id=%X\n", typeinfo.type_id, typeinfo.count, type_id); - if (typeinfo.type_id == 0) break; - if (type_match(type_id, typeinfo.type_id, ResourceFd, rtoff)) + if (typeinfo.type_id == 0) + break; + if (type_match(type_id, typeinfo.type_id, r->wpnt->fd, rtoff)) { for (i = 0; i < typeinfo.count; i++) { #ifndef WINELIB - if (read(ResourceFd, &nameinfo, sizeof(nameinfo)) != - sizeof(nameinfo)) + if (read(r->wpnt->fd, &nameinfo, sizeof(nameinfo)) != sizeof(nameinfo)) #else - if (!load_nameinfo (ResourceFd, &nameinfo)) + if (!load_nameinfo (r->wpnt->fd, &nameinfo)) #endif { printf("FindResourceByName (%s) bad nameinfo size !\n", resource_name); @@ -337,28 +256,27 @@ FindResourceByName(struct resource_nameinfo_s *result_p, if ((nameinfo.id & 0x8000) != 0) continue; */ dprintf_resource(stddeb, "FindResourceByName // nameinfo.id=%04X !\n", nameinfo.id); - old_pos = lseek(ResourceFd, 0, SEEK_CUR); + old_pos = lseek(r->wpnt->fd, 0, SEEK_CUR); new_pos = rtoff + nameinfo.id; - lseek(ResourceFd, new_pos, SEEK_SET); - read(ResourceFd, &nbytes, 1); + lseek(r->wpnt->fd, new_pos, SEEK_SET); + read(r->wpnt->fd, &nbytes, 1); dprintf_resource(stddeb, "FindResourceByName // namesize=%d !\n", nbytes); nbytes = CONV_CHAR_TO_LONG (nbytes); - read(ResourceFd, name, nbytes); - lseek(ResourceFd, old_pos, SEEK_SET); + read(r->wpnt->fd, name, nbytes); + lseek(r->wpnt->fd, old_pos, SEEK_SET); name[nbytes] = '\0'; dprintf_resource(stddeb, "FindResourceByName type_id=%X (%d of %d) name='%s' resource_name='%s'\n", typeinfo.type_id, i + 1, typeinfo.count, name, resource_name); - if (strcasecmp(name, resource_name) == 0) - { - memcpy(result_p, &nameinfo, sizeof(nameinfo)); - return size_shift; + if (strcasecmp(name, resource_name) == 0) { + r->size = nameinfo.length << size_shift; + r->offset = nameinfo.offset << size_shift; + return size_shift; } } } - else { - lseek(ResourceFd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); - } + else + lseek(r->wpnt->fd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); } return -1; } @@ -369,109 +287,92 @@ FindResourceByName(struct resource_nameinfo_s *result_p, */ int GetRsrcCount(HINSTANCE hInst, int type_id) { + struct w_files *wpnt; struct resource_typeinfo_s typeinfo; struct resource_nameinfo_s nameinfo; unsigned short size_shift; off_t rtoff; - if (hInst == 0) return 0; + if (hInst == 0) + return 0; dprintf_resource(stddeb, "GetRsrcCount hInst=%04X typename=%08X\n", hInst, type_id); - if (OpenResourceFile(hInst) < 0) return 0; + if ((wpnt = GetFileInfo(hInst)) == NULL) + return 0; /* * Move to beginning of resource table. */ - rtoff = (ResourceFileInfo->mz_header->ne_offset + - ResourceFileInfo->ne->ne_header->resource_tab_offset); - lseek(ResourceFd, rtoff, SEEK_SET); + rtoff = (wpnt->mz_header->ne_offset + + wpnt->ne->ne_header->resource_tab_offset); + lseek(wpnt->fd, rtoff, SEEK_SET); /* * Read block size. */ - if (read(ResourceFd, &size_shift, sizeof(size_shift)) != sizeof(size_shift)) { + if (read(wpnt->fd, &size_shift, sizeof(size_shift)) != sizeof(size_shift)) { printf("GetRsrcCount // bad block size !\n"); return -1; - } + } size_shift = CONV_SHORT (size_shift); for (;;) { - if (!load_typeinfo (ResourceFd, &typeinfo)) { - printf("GetRsrcCount // bad typeinfo size !\n"); - return 0; - } - dprintf_resource(stddeb, "GetRsrcCount // typeinfo.type_id=%X count=%d type_id=%X\n", + if (read(wpnt->fd, &typeinfo, sizeof(typeinfo)) != sizeof(typeinfo)) { + printf("GetRsrcCount // bad typeinfo size !\n"); + return 0; + } + dprintf_resource(stddeb, "GetRsrcCount // typeinfo.type_id=%X count=%d type_id=%X\n", typeinfo.type_id, typeinfo.count, type_id); - if (typeinfo.type_id == 0) break; - if (type_match(type_id, typeinfo.type_id, ResourceFd, rtoff)) { - return typeinfo.count; - } - else { - lseek(ResourceFd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); - } - } + if (typeinfo.type_id == 0) + break; + if (type_match(type_id, typeinfo.type_id, wpnt->fd, rtoff)) + return typeinfo.count; + else + lseek(wpnt->fd, (typeinfo.count * sizeof(nameinfo)), SEEK_CUR); + } return 0; } /********************************************************************** * NE_FindResource [KERNEL.60] */ -int -NE_FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name, +int NE_FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name, RESOURCE *r) { - int type; + int type, x; dprintf_resource(stddeb, "NE_FindResource hInst=%04X typename=%p resname=%p\n", instance, type_name, resource_name); - ResourceFd = r->fd; - ResourceFileInfo = r->wpnt; + r->size = r->offset = 0; /* nametable loaded ? */ if (r->wpnt->ne->resnamtab == NULL) - RSC_LoadNameTable(); + NE_LoadNameTable(r->wpnt); if (((int) type_name & 0xffff0000) == 0) - { - type = (int) type_name; - } - else if (type_name[0] == '\0') - { - type = -1; - } - else if (type_name[0] == '#') - { - type = atoi(type_name + 1); - } - else - { type = (int) type_name; + else { + if (type_name[0] == '\0') + type = -1; + if (type_name[0] == '#') + type = atoi(type_name + 1); + else + type = (int) type_name; } + if (((int) resource_name & 0xffff0000) == 0) - { - r->size_shift = FindResourceByNumber(&r->nameinfo, type, - (int) resource_name | 0x8000); - } - else if (resource_name[0] == '\0') - { - r->size_shift = FindResourceByNumber(&r->nameinfo, type, -1); + x = FindResourceByNumber(r, type, (int) resource_name | 0x8000); + else { + if (resource_name[0] == '\0') + x = FindResourceByNumber(r, type, -1); + if (resource_name[0] == '#') + x = FindResourceByNumber(r, type, atoi(resource_name + 1)); + else + x = FindResourceByName(r, type, resource_name); } - else if (resource_name[0] == '#') - { - r->size_shift = FindResourceByNumber(&r->nameinfo, type, - atoi(resource_name + 1)); - } - else - { - r->size_shift = FindResourceByName(&r->nameinfo, type, resource_name); - } - - if (r->size_shift == -1) - { + if (x == -1) { printf("NE_FindResource hInst=%04X typename=%08X resname=%08X not found!\n", instance, (int) type_name, (int) resource_name); return 0; } - r->size = r->nameinfo.length << r->size_shift; - r->offset = r->nameinfo.offset << r->size_shift; return 1; } diff --git a/loader/resource.c b/loader/resource.c index 7a841ae5654..2c4238ba5b0 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -738,13 +738,13 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name) return hbitmap; /* Load from sysresbm */ dprintf_resource(stddeb,"Searching for %d\n",bmp_name); - for(it=sysresbmTable;it;it++){ + for(it=sysresbmTable;it->value;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; + if(!it->value)return 0; dprintf_resource(stddeb,"Found %s\n",it->name); lp=it->value; rsc_mem=(HANDLE)NULL; diff --git a/misc/Imakefile b/misc/Imakefile index c5bdec95621..140fcc3a90f 100644 --- a/misc/Imakefile +++ b/misc/Imakefile @@ -3,7 +3,6 @@ MODULE = misc SRCS = \ - audio.c \ atom.c \ clipboard.c \ comm.c \ @@ -16,12 +15,7 @@ SRCS = \ keyboard.c \ lstr.c \ main.c \ - mcianim.c \ - mcicda.c \ message.c \ - midi.c \ - mmaux.c \ - mmsystem.c \ network.c \ profile.c \ property.c \ diff --git a/misc/clipboard.c b/misc/clipboard.c index bef9f01b1a9..5e82d529df9 100644 --- a/misc/clipboard.c +++ b/misc/clipboard.c @@ -258,7 +258,7 @@ int GetClipboardFormatName(WORD wFormat, LPSTR retStr, short maxlen) { LPCLIPFORMAT lpFormat = ClipFormats; dprintf_clipboard(stddeb, - "GetClipboardFormat(%04X, %08X, %d) !\n", wFormat, retStr, maxlen); + "GetClipboardFormat(%04X, %p, %d) !\n", wFormat, retStr, maxlen); while(TRUE) { if (lpFormat == NULL) return 0; if (lpFormat->wFormatID == wFormat) break; @@ -280,8 +280,10 @@ int GetClipboardFormatName(WORD wFormat, LPSTR retStr, short maxlen) */ HWND SetClipboardViewer(HWND hWnd) { - dprintf_clipboard(stddeb,"SetClipboardFormat(%04X) !\n", hWnd); + HWND hwndPrev = hWndViewer; + dprintf_clipboard(stddeb,"SetClipboardViewer(%04X) !\n", hWnd); hWndViewer = hWnd; + return hwndPrev; } @@ -340,7 +342,7 @@ HWND GetOpenClipboardWindow() int GetPriorityClipboardFormat(WORD FAR *lpPriorityList, short nCount) { dprintf_clipboard(stdnimp, - "GetPriorityClipboardFormat(%08X, %d) !\n", lpPriorityList, nCount); + "GetPriorityClipboardFormat(%p, %d) !\n", lpPriorityList, nCount); } @@ -354,7 +356,8 @@ void CLIPBOARD_ReadSelection(Window w,Atom prop) { HANDLE hText; LPCLIPFORMAT lpFormat = ClipFormats; - if(prop==None)hText=NULL; + if(prop==None) + hText=0; else{ Atom atype=None; int aformat; @@ -365,11 +368,11 @@ void CLIPBOARD_ReadSelection(Window w,Atom prop) if(XGetWindowProperty(display,w,prop,0,0x3FFF,True,XA_STRING, &atype, &aformat, &nitems, &remain, &val)!=Success) printf("couldn't read property\n"); - dprintf_clipboard(stddeb,"Type %s,Format %d,nitems %d,value %s\n", + dprintf_clipboard(stddeb,"Type %s,Format %d,nitems %ld,value %s\n", XGetAtomName(display,atype),aformat,nitems,val); if(atype!=XA_STRING || aformat!=8){ fprintf(stderr,"Property not set\n"); - hText=NULL; + hText=0; } else { dprintf_clipboard(stddeb,"Selection is %s\n",val); hText=GlobalAlloc(GMEM_MOVEABLE, nitems); diff --git a/misc/comm.c b/misc/comm.c index 00a0d6a1e19..49c08cea2a0 100644 --- a/misc/comm.c +++ b/misc/comm.c @@ -1,5 +1,5 @@ /* - * DEC 93 Erik Bos (erik@trashcan.hacktic.nl) + * DEC 93 Erik Bos */ #include @@ -20,8 +20,8 @@ #include "windows.h" #include "comm.h" #include "stddebug.h" -/* #define DEBUG_COMM /* */ -/* #undef DEBUG_COMM /* */ +/* #define DEBUG_COMM */ +/* #undef DEBUG_COMM */ #include "debug.h" int commerror = 0, eventmask = 0; @@ -151,7 +151,7 @@ int BuildCommDCB(LPSTR device, DCB FAR *lpdcb) char *ptr, temp[256]; dprintf_comm(stddeb, - "BuildCommDCB: (%s), ptr %d\n", device, (long) lpdcb); + "BuildCommDCB: (%s), ptr %p\n", device, lpdcb); commerror = 0; if (!strncasecmp(device,"COM",3)) { @@ -469,7 +469,7 @@ int SetCommState(DCB FAR *lpdcb) struct DosDeviceStruct *ptr; dprintf_comm(stddeb, - "SetCommState: fd %d, ptr %d\n", lpdcb->Id, (long) lpdcb); + "SetCommState: fd %d, ptr %p\n", lpdcb->Id, lpdcb); if (tcgetattr(lpdcb->Id, &port) == -1) { commerror = WinError(); return -1; @@ -661,7 +661,7 @@ int GetCommState(int fd, DCB FAR *lpdcb) { struct termios port; - dprintf_comm(stddeb,"GetCommState: fd %d, ptr %d\n", fd, (long) lpdcb); + dprintf_comm(stddeb,"GetCommState: fd %d, ptr %p\n", fd, lpdcb); if (tcgetattr(fd, &port) == -1) { commerror = WinError(); return -1; @@ -824,7 +824,7 @@ int ReadComm(int fd, LPSTR lpvBuf, int cbRead) struct DosDeviceStruct *ptr; dprintf_comm(stddeb, - "ReadComm: fd %d, ptr %d, length %d\n", fd, (long) lpvBuf, cbRead); + "ReadComm: fd %d, ptr %p, length %d\n", fd, lpvBuf, cbRead); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return -1; @@ -865,8 +865,8 @@ int WriteComm(int fd, LPSTR lpvBuf, int cbWrite) int x, length; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"WriteComm: fd %d, ptr %d, length %d\n", - fd, (long) lpvBuf, cbWrite); + dprintf_comm(stddeb,"WriteComm: fd %d, ptr %p, length %d\n", + fd, lpvBuf, cbWrite); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return -1; diff --git a/misc/dos_fs.c b/misc/dos_fs.c index 2b5efb31461..ae19ea39614 100644 --- a/misc/dos_fs.c +++ b/misc/dos_fs.c @@ -1,6 +1,6 @@ /* * DOS-FS - * NOV 1993 Erik Bos (erik@(trashcan.)hacktic.nl) + * NOV 1993 Erik Bos * * FindFile by Bob, hacked for dos & unixpaths by Erik. * @@ -31,8 +31,6 @@ #include "autoconf.h" #include "comm.h" #include "stddebug.h" -/* #define DEBUG_DOSFS /* */ -/* #undef DEBIG_DOSFS /* */ #include "debug.h" #define WINE_INI_USER "~/.winerc" @@ -141,6 +139,12 @@ void DOS_InitFS(void) strcat(DosDrives[x].label, drive); DosDrives[x].disabled = 0; } + DosDrives[25].rootdir = "/"; + strcpy(DosDrives[25].cwd, "/"); + strcpy(DosDrives[25].label, "UNIX-FS"); + DosDrives[25].serialnumber = 0x12345678; + DosDrives[25].disabled = 0; + DOS_SetDefaultDrive(2); for (x=0; x!=MAX_DOS_DRIVES; x++) { @@ -431,7 +435,7 @@ char *GetDosFileName(char *unixfilename) } } } - sprintf(temp, "UNIX:%s", unixfilename); + sprintf(temp, "Z:%s", unixfilename); ToDos(temp); return(temp); } @@ -547,7 +551,7 @@ int DOS_GetFreeSpace(int drive, long *size, long *available) *size = info.f_bsize * info.f_blocks; *available = info.f_bavail * info.f_bsize; - + return 1; } @@ -578,14 +582,9 @@ char *FindFile(char *buffer, int buflen, char *filename, char **extensions, dprintf_dosfs(stddeb,"FindFile: looking for %s\n", filename); rootnamelen = strlen(filename); - if ((rootname = malloc(rootnamelen + 1)) == NULL) - return NULL; - strcpy(rootname, filename); + rootname = strdup(filename); ToUnix(rootname); - - if ((workingpath = malloc(strlen(path) + 1)) == NULL) - return NULL; - strcpy(workingpath, path); + workingpath = strdup(path); for(dirname = strtok(workingpath, ";"); dirname != NULL; @@ -649,7 +648,7 @@ char *WineIniFileName(void) { int fd; static char *filename = NULL; - char name[256]; + static char name[256]; if (filename) return filename; @@ -658,14 +657,12 @@ char *WineIniFileName(void) ExpandTildeString(name); if ((fd = open(name, O_RDONLY)) != -1) { close(fd); - filename = malloc(strlen(name) + 1); - strcpy(filename, name); + filename = name; return(filename); } if ((fd = open(WINE_INI_GLOBAL, O_RDONLY)) != -1) { close(fd); - filename = malloc(strlen(WINE_INI_GLOBAL) + 1); - strcpy(filename, WINE_INI_GLOBAL); + filename = WINE_INI_GLOBAL; return(filename); } fprintf(stderr,"wine: can't open configuration file %s or %s !\n", diff --git a/misc/driver.c b/misc/driver.c index 7e1b9fc8a50..425638f193c 100644 --- a/misc/driver.c +++ b/misc/driver.c @@ -47,7 +47,7 @@ void LoadStartupDrivers() */ LRESULT WINAPI SendDriverMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2) { - dprintf_driver(stdnimp,"SendDriverMessage(%04X, %04X, %08X, %08X);\n", + dprintf_driver(stdnimp,"SendDriverMessage(%04X, %04X, %08lX, %08lX);\n", hDriver, msg, lParam1, lParam2); } @@ -60,7 +60,7 @@ HDRVR OpenDriver(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam) LPDRIVERITEM lpnewdrv; LPDRIVERITEM lpdrv = lpDrvItemList; char DrvName[128]; - dprintf_driver(stddeb,"OpenDriver('%s', '%s', %08X);\n", + dprintf_driver(stddeb,"OpenDriver('%s', '%s', %08lX);\n", lpDriverName, lpSectionName, lParam); if (lpSectionName == NULL) lpSectionName = "drivers"; GetPrivateProfileString(lpSectionName, lpDriverName, @@ -106,7 +106,7 @@ LRESULT CloseDriver(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2) { LPDRIVERITEM lpdrv; dprintf_driver(stddeb, - "CloseDriver(%04X, %08X, %08X);\n", hDrvr, lParam1, lParam2); + "CloseDriver(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2); lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr); if (lpdrv != NULL && lpdrv->dis.hDriver == hDrvr) { if (lpdrv->lpPrevItem) @@ -177,7 +177,7 @@ LRESULT DefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, BOOL GetDriverInfo(HDRVR hDrvr, LPDRIVERINFOSTRUCT lpDrvInfo) { LPDRIVERITEM lpdrv; - dprintf_driver(stddeb,"GetDriverInfo(%04X, %08X);\n", hDrvr, lpDrvInfo); + dprintf_driver(stddeb,"GetDriverInfo(%04X, %p);\n", hDrvr, lpDrvInfo); if (lpDrvInfo == NULL) return FALSE; lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr); if (lpdrv == NULL) return FALSE; @@ -193,7 +193,7 @@ HDRVR GetNextDriver(HDRVR hDrvr, DWORD dwFlags) { LPDRIVERITEM lpdrv; HDRVR hRetDrv = 0; - dprintf_driver(stddeb,"GetNextDriver(%04X, %08X);\n", hDrvr, dwFlags); + dprintf_driver(stddeb,"GetNextDriver(%04X, %08lX);\n", hDrvr, dwFlags); if (hDrvr == 0) { if (lpDrvItemList == NULL) { dprintf_driver(stddeb, diff --git a/misc/exec.c b/misc/exec.c index 920cb273bda..c1b9605de18 100644 --- a/misc/exec.c +++ b/misc/exec.c @@ -147,7 +147,7 @@ HANDLE LoadModule(LPSTR modulefile, LPVOID lpParamBlk) { PARAMBLOCK *pblk = lpParamBlk; WORD *lpCmdShow; - dprintf_exec(stddeb,"LoadModule '%s' %08X\n", modulefile, lpParamBlk); + dprintf_exec(stddeb,"LoadModule '%s' %p\n", modulefile, lpParamBlk); if (lpParamBlk == NULL) return 0; lpCmdShow = (WORD *)pblk->lpCmdShow; return WinExec(pblk->lpCmdLine, lpCmdShow[1]); @@ -162,7 +162,6 @@ WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow) int c = 0; int x, x2; char *ArgV[20]; - LPFNWINMAIN lpfnMain; HINSTANCE hInst = 0; HANDLE hTask = 0; dprintf_exec(stddeb,"WinExec('%s', %04X)\n", lpCmdLine, nCmdShow); @@ -226,7 +225,7 @@ WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow) */ BOOL ExitWindows(DWORD dwReserved, WORD wRetCode) { - dprintf_exec(stdnimp,"EMPTY STUB !!! ExitWindows(%08X, %04X) !\n", + dprintf_exec(stdnimp,"EMPTY STUB !!! ExitWindows(%08lX, %04X) !\n", dwReserved, wRetCode); } diff --git a/misc/file.c b/misc/file.c index 2320a8b0e32..5a9eceed688 100644 --- a/misc/file.c +++ b/misc/file.c @@ -5,12 +5,10 @@ * * WARNING : Many options of OpenFile are not yet implemeted. * - * NOV 93 Erik Bos (erik@(trashcan.)hacktic.nl + * NOV 93 Erik Bos (erik@xs4all.nl) * - removed ParseDosFileName, and DosDrive structures. * - structures dynamically configured at runtime. * - _lopen modified to use GetUnixFileName. - * - * DEC 93 Erik Bos (erik@(trashcan.)hacktic.nl) * - Existing functions modified to use dosfs functions. * - Added _llseek, _lcreat, GetDriveType, GetTempDrive, * GetWindowsDirectory, GetSystemDirectory, GetTempFileName. @@ -79,7 +77,7 @@ INT _lread (INT hFile, LPSTR lpBuffer, WORD wBytes) int result; dprintf_file(stddeb, "_lread: handle %d, buffer = %ld, length = %d\n", - hFile, (int) lpBuffer, wBytes); + hFile, (long) lpBuffer, wBytes); result = read (hFile, lpBuffer, wBytes); @@ -97,7 +95,7 @@ INT _lwrite (INT hFile, LPSTR lpBuffer, WORD wBytes) int result; dprintf_file(stddeb, "_lwrite: handle %d, buffer = %ld, length = %d\n", - hFile, (int) lpBuffer, wBytes); + hFile, (long) lpBuffer, wBytes); result = write (hFile, lpBuffer, wBytes); diff --git a/misc/keyboard.c b/misc/keyboard.c index a42cb04560b..778dea1c317 100644 --- a/misc/keyboard.c +++ b/misc/keyboard.c @@ -117,7 +117,7 @@ int GetKeyNameText(LONG lParam, LPSTR lpBuffer, int nSize) { int i; - dprintf_keyboard(stddeb,"GetKeyNameText(%d,, %d)\n",lParam,nSize); + dprintf_keyboard(stddeb,"GetKeyNameText(%ld,,%d)\n",lParam,nSize); lParam >>= 16; lParam &= 0xff; diff --git a/misc/profile.c b/misc/profile.c index 12a961e5279..d4f5af10c85 100644 --- a/misc/profile.c +++ b/misc/profile.c @@ -245,7 +245,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName, return (Size - 2); } slen = min(strlen(key->KeyName) + 1, left); - dprintf_profile(stddeb,"GetSetProfile // strncpy(%08X, %08X, %d);\n", + dprintf_profile(stddeb,"GetSetProfile // strncpy(%p, %p, %d);\n", ReturnedString, key->Value, slen); strncpy (p, key->KeyName, slen); dprintf_profile(stddeb,"GetSetProfile // enum '%s' !\n", p); @@ -302,7 +302,7 @@ short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName, { int v; - dprintf_profile(stddeb,"GetPrivateProfileString ('%s', '%s', '%s', %08X, %d, %s\n", + dprintf_profile(stddeb,"GetPrivateProfileString ('%s', '%s', '%s', %p, %d, %s\n", AppName, KeyName, Default, ReturnedString, Size, FileName); v = GetSetProfile (0,AppName,KeyName,Default,ReturnedString,Size,FileName); if (AppName) diff --git a/miscemu/int21.c b/miscemu/int21.c index fae0a1b83d1..5756d8a3145 100644 --- a/miscemu/int21.c +++ b/miscemu/int21.c @@ -1175,7 +1175,7 @@ int do_int21(struct sigcontext_struct * context) case 0x0e: /* SELECT DEFAULT DRIVE */ if (!DOS_ValidDrive(DL)) { Error (InvalidDrive, EC_MediaError, EL_Disk); - return; + break; } else { DOS_SetDefaultDrive(DL); AX = MAX_DOS_DRIVES; @@ -1340,7 +1340,7 @@ int do_int21(struct sigcontext_struct * context) errno_to_doserr(); AL = ExtendedError; SetCflag; - return; + break; } Error(0,0,0); ResetCflag; diff --git a/miscemu/int31.c b/miscemu/int31.c index 6bdef308e8c..f38b3629825 100644 --- a/miscemu/int31.c +++ b/miscemu/int31.c @@ -37,7 +37,7 @@ BOOL DPMI_SetDescriptor(HANDLE pmSel, LPDESCRIPTOR lpDesc); int do_int31(struct sigcontext_struct *context) { LPDESCRIPTOR lpDesc; - dprintf_int(stddeb,"do_int31 // context->sc_eax=%04X\n", + dprintf_int(stddeb,"do_int31 // context->sc_eax=%08lX\n", context->sc_eax); switch(context->sc_eax) { @@ -82,7 +82,7 @@ BOOL DPMI_FreeSelector(HANDLE pmSel) BOOL DPMI_SetDescriptor(HANDLE pmSel, LPDESCRIPTOR lpDesc) { - dprintf_int(stdnimp,"DPMI_SetDescriptor(%04X, %08X); !\n", + dprintf_int(stdnimp,"DPMI_SetDescriptor(%04X, %p); !\n", pmSel, lpDesc); dprintf_int(stdnimp,"DPMI lpDesc->Limit=%u \n", lpDesc->Limit); dprintf_int(stdnimp,"DPMI lpDesc->addr_lo=%04X \n", lpDesc->addr_lo); diff --git a/multimedia/Imakefile b/multimedia/Imakefile new file mode 100644 index 00000000000..daed8c23b74 --- /dev/null +++ b/multimedia/Imakefile @@ -0,0 +1,20 @@ +#include "../Wine.tmpl" + +MODULE = multimedia + +SRCS = \ + audio.c \ + mcianim.c \ + mcicda.c \ + midi.c \ + mmaux.c \ + mmsystem.c + +OBJS = $(SRCS:.c=.o) + +WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS)) +DependTarget() + +includes:: + +install:: diff --git a/misc/audio.c b/multimedia/audio.c similarity index 97% rename from misc/audio.c rename to multimedia/audio.c index 42e63ee5ce3..3f7cd4ed6e9 100644 --- a/misc/audio.c +++ b/multimedia/audio.c @@ -304,7 +304,7 @@ DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) MCIWavDev[wDevID].nUseCount--; if (MCIWavDev[wDevID].nUseCount == 0) { if (MCIWavDev[wDevID].hFile != 0) { - close(MCIWavDev[wDevID].hFile); + mmioClose(MCIWavDev[wDevID].hFile, 0); MCIWavDev[wDevID].hFile = 0; } dwRet = wodMessage(0, WODM_CLOSE, 0, 0L, 0L); @@ -358,7 +358,7 @@ DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) case 0: break; default: - dprintf_mciwave(stddeb,"WAVE_mciPlay // process started ! return to caller...\n"); + dprintf_mciwave(stddeb,"WAVE_mciPlay // process started ! return to caller...\n"); return 0; } } @@ -388,6 +388,7 @@ DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) dprintf_mciwave(stddeb,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08X !\n", lpParms->dwCallback); mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); + exit(0); } return 0; #else @@ -1136,25 +1137,56 @@ TryAGAIN: } /************************************************************************** +* wodGetVolume [internal] +*/ +DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol) +{ +#ifdef linux + int mixer; + int volume; + dprintf_mciwave(stddeb,"wodGetVolume(%u, %08X);\n", wDevID, lpdwVol); + if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; + if (WOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'wodGetVolume' // can't read volume !\n"); + return MMSYSERR_NOTENABLED; + } + if ((mixer = open("/dev/mixer", O_RDONLY)) < 0) { + fprintf(stderr, "Linux 'wodGetVolume' // mixer device not available !\n"); + return MMSYSERR_NOTENABLED; + } + if (ioctl(mixer, SOUND_MIXER_READ_PCM, &volume) == -1) { + fprintf(stderr,"Linux 'wodGetVolume' // unable read mixer !\n"); + return MMSYSERR_NOTENABLED; + } + close(mixer); + *lpdwVol = MAKELONG(volume, volume); + return MMSYSERR_NOERROR; +#else + return MMSYSERR_NOTENABLED; +#endif +} + + +/************************************************************************** * wodSetVolume [internal] */ DWORD wodSetVolume(WORD wDevID, DWORD dwParam) { #ifdef linux int mixer; - int volume = 50; + int volume; dprintf_mciwave(stddeb,"wodSetVolume(%u, %08X);\n", wDevID, dwParam); + volume = LOWORD(dwParam); if (WOutDev[wDevID].unixdev == 0) { - fprintf(stderr,"Linux 'wodSetVolume' // can't set volume !\n"); + fprintf(stderr,"Linux 'wodSetVolume' // can't set volume !\n"); return MMSYSERR_NOTENABLED; } - if ((mixer = open("/dev/mixer", O_RDWR)) < 0) { - fprintf(stderr, - "Linux 'wodSetVolume' // mixer device not available !\n"); + if ((mixer = open("/dev/mixer", O_WRONLY)) < 0) { + fprintf(stderr, "Linux 'wodSetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, SOUND_MIXER_WRITE_PCM, &volume) == -1) { - fprintf(stderr,"Linux 'wodSetVolume' // unable set mixer !\n"); + fprintf(stderr,"Linux 'wodSetVolume' // unable set mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); @@ -1203,7 +1235,7 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case WODM_SETPLAYBACKRATE: return 0L; case WODM_GETVOLUME: - return 0L; + return wodGetVolume(wDevID, (LPDWORD)dwParam1); case WODM_SETVOLUME: return wodSetVolume(wDevID, dwParam1); case WODM_RESTART: @@ -1459,8 +1491,8 @@ DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { #ifdef linux - dprintf_mciwave(stddeb, - "widPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); + dprintf_mciwave(stddeb, + "widPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); if (WInDev[wDevID].unixdev == 0) { fprintf(stderr,"Linux 'widPrepare' // can't prepare !\n"); return MMSYSERR_NOTENABLED; @@ -1489,8 +1521,8 @@ DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { #ifdef linux - dprintf_mciwave(stddeb, - "widUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); + dprintf_mciwave(stddeb, + "widUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); if (WInDev[wDevID].unixdev == 0) { fprintf(stderr,"Linux 'widUnprepare' // can't unprepare !\n"); return MMSYSERR_NOTENABLED; diff --git a/misc/mcianim.c b/multimedia/mcianim.c similarity index 98% rename from misc/mcianim.c rename to multimedia/mcianim.c index 8a850f9949c..7a191d4e277 100644 --- a/misc/mcianim.c +++ b/multimedia/mcianim.c @@ -22,8 +22,9 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994"; #include "driver.h" #include "mmsystem.h" #include "stddebug.h" -/* #define DEBUG_ANIM /* */ -/* #undef DEBUG_ANIM /* */ +/* #define DEBUG_MCIANIM /* */ +/* #undef DEBUG_MCIANIM /* */ +#define DEBUG_MCIANIM #include "debug.h" #define MAX_ANIMDRV 2 @@ -69,6 +70,7 @@ DWORD ANIM_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) int cdrom; dprintf_mcianim(stddeb,"ANIM_mciOpen(%08X, %08X);\n", dwFlags, lpParms); + printf("ANIM_mciOpen(%08X, %08X);\n", dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; wDevID = lpParms->wDeviceID; if (AnimDev[wDevID].nUseCount > 0) { @@ -86,6 +88,7 @@ DWORD ANIM_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) } if (dwFlags & MCI_OPEN_ELEMENT) { dprintf_mcianim(stddeb,"ANIM_mciOpen // MCI_OPEN_ELEMENT !\n"); + printf("ANIM_mciOpen // MCI_OPEN_ELEMENT !\n"); /* return MCIERR_NO_ELEMENT_ALLOWED; */ } memcpy(&AnimDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS)); @@ -416,6 +419,7 @@ DWORD ANIM_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) int start, end; dprintf_mcianim(stddeb,"ANIM_mciPlay(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); + printf("ANIM_mciPlay(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; start = 0; end = AnimDev[wDevID].dwTotalLen; AnimDev[wDevID].nCurTrack = 1; diff --git a/misc/mcicda.c b/multimedia/mcicda.c similarity index 100% rename from misc/mcicda.c rename to multimedia/mcicda.c diff --git a/misc/midi.c b/multimedia/midi.c similarity index 67% rename from misc/midi.c rename to multimedia/midi.c index cc20a08dd86..d3342907b71 100644 --- a/misc/midi.c +++ b/multimedia/midi.c @@ -11,22 +11,28 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994"; #ifdef BUILTIN_MMSYSTEM -#define DEBUG_MCIMIDI - #include "stdio.h" #include "win.h" #include "user.h" #include "driver.h" #include "mmsystem.h" - #include #include + +#include "stddebug.h" +/* #define DEBUG_MIDI /* */ +/* #undef DEBUG_MIDI /* */ + +#define DEBUG_MIDI +#include "debug.h" + + #ifdef linux #include #endif #ifdef linux -#define MIDI_DEV "/dev/midi" +#define MIDI_DEV "/dev/sequencer" #ifdef SOUND_VERSION #define IOCTL(a,b,c) ioctl(a,b,&c) @@ -44,7 +50,7 @@ typedef struct { DWORD bufsize; MIDIOPENDESC midiDesc; WORD wFlags; - MIDIHDR lpQueueHdr; + LPMIDIHDR lpQueueHdr; DWORD dwTotalPlayed; } LINUX_MIDIIN; @@ -54,7 +60,7 @@ typedef struct { DWORD bufsize; MIDIOPENDESC midiDesc; WORD wFlags; - MIDIHDR lpQueueHdr; + LPMIDIHDR lpQueueHdr; DWORD dwTotalPlayed; } LINUX_MIDIOUT; @@ -64,6 +70,11 @@ typedef struct { WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ HANDLE hCallback; /* Callback handle for pending notification */ HMMIO hFile; /* mmio file handle open as Element */ + DWORD dwBeginData; + DWORD dwTotalLen; + WORD wFormat; + WORD nTracks; + WORD nTempo; MCI_OPEN_PARMS openParms; MIDIHDR MidiHdr; WORD dwStatus; @@ -86,6 +97,17 @@ DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms); DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms); DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms); +DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags); +DWORD modClose(WORD wDevID); +DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS lpCaps, DWORD dwSize); +DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize); +DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize); +DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize); +DWORD modData(WORD wDevID, DWORD dwParam); + +DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags); +DWORD midClose(WORD wDevID); +DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS lpCaps, DWORD dwSize); /************************************************************************** * MIDI_NotifyClient [internal] @@ -169,6 +191,152 @@ LRESULT MIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, #endif } + +/************************************************************************** +* MIDI_ReadByte [internal] +*/ +DWORD MIDI_ReadByte(UINT wDevID, BYTE FAR *lpbyt) +{ + if (lpbyt != NULL) { + if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)lpbyt, + (long) sizeof(BYTE)) == (long) sizeof(BYTE)) { + return 0; + } + } + printf("MIDI_ReadByte // error reading wDevID=%d \n", wDevID); + return MCIERR_INTERNAL; +} + + +/************************************************************************** +* MIDI_ReadWord [internal] +*/ +DWORD MIDI_ReadWord(UINT wDevID, LPWORD lpw) +{ + BYTE hibyte, lobyte; + if (lpw != NULL) { + if (MIDI_ReadByte(wDevID, &hibyte) == 0) { + if (MIDI_ReadByte(wDevID, &lobyte) == 0) { + *lpw = ((WORD)hibyte << 8) + lobyte; + return 0; + } + } + } + printf("MIDI_ReadWord // error reading wDevID=%d \n", wDevID); + return MCIERR_INTERNAL; +} + + +/************************************************************************** +* MIDI_ReadLong [internal] +*/ +DWORD MIDI_ReadLong(UINT wDevID, LPDWORD lpdw) +{ + WORD hiword, loword; + BYTE hibyte, lobyte; + if (lpdw != NULL) { + if (MIDI_ReadWord(wDevID, &hiword) == 0) { + if (MIDI_ReadWord(wDevID, &loword) == 0) { + *lpdw = MAKELONG(loword, hiword); + return 0; + } + } + } + printf("MIDI_ReadLong // error reading wDevID=%d \n", wDevID); + return MCIERR_INTERNAL; +} + + +/************************************************************************** +* MIDI_ReadVaryLen [internal] +*/ +DWORD MIDI_ReadVaryLen(UINT wDevID, LPDWORD lpdw) +{ + BYTE byte; + DWORD value; + if (lpdw == NULL) return MCIERR_INTERNAL; + if (MIDI_ReadByte(wDevID, &byte) != 0) { + printf("MIDI_ReadVaryLen // error reading wDevID=%d \n", wDevID); + return MCIERR_INTERNAL; + } + value = (DWORD)(byte & 0x7F); + while (byte & 0x80) { + if (MIDI_ReadByte(wDevID, &byte) != 0) { + printf("MIDI_ReadVaryLen // error reading wDevID=%d \n", wDevID); + return MCIERR_INTERNAL; + } + value = (value << 7) + (byte & 0x7F); + } + *lpdw = value; +/* + printf("MIDI_ReadVaryLen // val=%08lX \n", value); +*/ + return 0; +} + + +/************************************************************************** +* MIDI_ReadMThd [internal] +*/ +DWORD MIDI_ReadMThd(UINT wDevID, DWORD dwOffset) +{ + DWORD toberead; + FOURCC fourcc; + dprintf_midi(stddeb, "MIDI_ReadMThd(%04X, %08X);\n", wDevID, dwOffset); + if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) { + printf("MIDI_ReadMThd // can't seek at %08X begin of 'MThd' \n", dwOffset); + return MCIERR_INTERNAL; + } + if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc, + (long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) { + return MCIERR_INTERNAL; + } + if (MIDI_ReadLong(wDevID, &toberead) != 0) { + return MCIERR_INTERNAL; + } + if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].wFormat) != 0) { + return MCIERR_INTERNAL; + } + if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTracks) != 0) { + return MCIERR_INTERNAL; + } + if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTempo) != 0) { + return MCIERR_INTERNAL; + } + printf("MIDI_ReadMThd // toberead=%08X, wFormat=%04X nTracks=%04X nTempo=%04X\n", + toberead, MCIMidiDev[wDevID].wFormat, + MCIMidiDev[wDevID].nTracks, + MCIMidiDev[wDevID].nTempo); + toberead -= 3 * sizeof(WORD); +/* + ntrks = read16bit (); + Mf_division = division = read16bit (); +*/ + return 0; +} + + +DWORD MIDI_ReadMTrk(UINT wDevID, DWORD dwOffset) +{ + DWORD toberead; + FOURCC fourcc; + if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) { + printf("MIDI_ReadMTrk // can't seek at %08X begin of 'MThd' \n", dwOffset); + } + if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc, + (long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) { + return MCIERR_INTERNAL; + } + if (MIDI_ReadLong(wDevID, &toberead) != 0) { + return MCIERR_INTERNAL; + } + printf("MIDI_ReadMTrk // toberead=%08X\n", toberead); + toberead -= 3 * sizeof(WORD); + MCIMidiDev[wDevID].dwTotalLen = toberead; + return 0; +} + + /************************************************************************** * MIDI_mciOpen [internal] */ @@ -180,9 +348,11 @@ DWORD MIDI_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) OFSTRUCT OFstruct; MIDIOPENDESC MidiDesc; DWORD dwRet; + DWORD dwOffset; char str[128]; LPSTR ptr; -#ifdef DEBUG_MCIMIDI + DWORD toberead; +#ifdef DEBUG_MIDI printf("MIDI_mciOpen(%08X, %08X)\n", dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; @@ -221,6 +391,8 @@ DWORD MIDI_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) memcpy(&MCIMidiDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS)); MCIMidiDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID; MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; + MCIMidiDev[wDevID].dwBeginData = 0; + MCIMidiDev[wDevID].dwTotalLen = 0; MidiDesc.hMidi = 0; if (MCIMidiDev[wDevID].hFile != 0) { MMCKINFO mmckInfo; @@ -228,21 +400,32 @@ DWORD MIDI_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) if (mmioDescend(MCIMidiDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) { return MCIERR_INTERNAL; } -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); #endif - if (ckMainRIFF.ckid != FOURCC_RIFF) return MCIERR_INTERNAL; - if (ckMainRIFF.fccType != mmioFOURCC('R', 'M', 'I', 'D') && - ckMainRIFF.fccType != mmioFOURCC('M', 'T', 'h', 'd')) { + dwOffset = 0; + if (ckMainRIFF.ckid == mmioFOURCC('R', 'M', 'I', 'D')) { + printf("MIDI_mciOpen // is a 'RMID' file \n"); + dwOffset = ckMainRIFF.dwDataOffset; + } + if (ckMainRIFF.ckid != mmioFOURCC('M', 'T', 'h', 'd')) { + printf("MIDI_mciOpen // unknown format !\n"); return MCIERR_INTERNAL; } - mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a'); - if (mmioDescend(MCIMidiDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) { + if (MIDI_ReadMThd(wDevID, dwOffset) != 0) { + printf("MIDI_mciOpen // can't read 'MThd' header \n"); return MCIERR_INTERNAL; } -#ifdef DEBUG_MCIMIDI + dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR); + if (MIDI_ReadMTrk(wDevID, dwOffset) != 0) { + printf("MIDI_mciOpen // can't read 'MTrk' header \n"); + return MCIERR_INTERNAL; + } + dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR); + MCIMidiDev[wDevID].dwBeginData = dwOffset; +#ifdef DEBUG_MIDI printf("MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); @@ -264,7 +447,7 @@ DWORD MIDI_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) { #ifdef linux DWORD dwRet; -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms); #endif if (MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) { @@ -274,8 +457,9 @@ DWORD MIDI_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) MCIMidiDev[wDevID].nUseCount--; if (MCIMidiDev[wDevID].nUseCount == 0) { if (MCIMidiDev[wDevID].hFile != 0) { - close(MCIMidiDev[wDevID].hFile); + mmioClose(MCIMidiDev[wDevID].hFile, 0); MCIMidiDev[wDevID].hFile = 0; + printf("MIDI_mciClose // hFile closed !\n"); } dwRet = modMessage(0, MODM_CLOSE, 0, 0L, 0L); if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL; @@ -298,8 +482,10 @@ DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) int count; int start, end; LPMIDIHDR lpMidiHdr; + DWORD dwData; + LPWORD ptr; DWORD dwRet; -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciPlay(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (MCIMidiDev[wDevID].hFile == 0) { @@ -333,8 +519,9 @@ DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) } /**/ lpMidiHdr = &MCIMidiDev[wDevID].MidiHdr; - lpMidiHdr->lpData = (LPSTR) malloc(64000); - lpMidiHdr->dwBufferLength = 32000; + lpMidiHdr->lpData = (LPSTR) malloc(1200); + if (lpMidiHdr->lpData == NULL) return MCIERR_INTERNAL; + lpMidiHdr->dwBufferLength = 1024; lpMidiHdr->dwUser = 0L; lpMidiHdr->dwFlags = 0L; dwRet = modMessage(0, MODM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); @@ -343,14 +530,21 @@ DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) { printf("MIDI_mciPlay // MCIMidiDev[wDevID].dwStatus=%p %d\n", &MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus); + ptr = (LPWORD)lpMidiHdr->lpData; + for (count = 0; count < lpMidiHdr->dwBufferLength; count++) { + if (MIDI_ReadVaryLen(wDevID, &dwData) != 0) break; + *ptr = LOWORD(dwData); + } +/* count = mmioRead(MCIMidiDev[wDevID].hFile, lpMidiHdr->lpData, lpMidiHdr->dwBufferLength); +*/ if (count < 1) break; lpMidiHdr->dwBytesRecorded = count; -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%08X dwBytesRecorded=%u\n", lpMidiHdr, lpMidiHdr->dwBytesRecorded); #endif -/* dwRet = modMessage(0, MODM_LONGDATA, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); */ + dwRet = modMessage(0, MODM_LONGDATA, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); } dwRet = modMessage(0, MODM_UNPREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); if (lpMidiHdr->lpData != NULL) { @@ -359,7 +553,7 @@ DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) } MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08X !\n", lpParms->dwCallback); #endif mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), @@ -383,7 +577,7 @@ DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms) int start, end; LPMIDIHDR lpMidiHdr; DWORD dwRet; -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciRecord(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (MCIMidiDev[wDevID].hFile == 0) { @@ -401,8 +595,8 @@ DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms) printf("MIDI_mciRecord // MCI_TO=%d \n", end); } lpMidiHdr = &MCIMidiDev[wDevID].MidiHdr; - lpMidiHdr->lpData = (LPSTR) malloc(64000); - lpMidiHdr->dwBufferLength = 32000; + lpMidiHdr->lpData = (LPSTR) malloc(1200); + lpMidiHdr->dwBufferLength = 1024; lpMidiHdr->dwUser = 0L; lpMidiHdr->dwFlags = 0L; dwRet = midMessage(0, MIDM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); @@ -426,7 +620,7 @@ DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms) } MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08X !\n", lpParms->dwCallback); #endif mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), @@ -445,7 +639,7 @@ DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms) DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #ifdef linux -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; @@ -465,7 +659,7 @@ DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #ifdef linux -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; @@ -482,7 +676,7 @@ DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #ifdef linux -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; @@ -499,11 +693,11 @@ DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { #ifdef linux -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciSet // dwTimeFormat=%08X\n", lpParms->dwTimeFormat); printf("MIDI_mciSet // dwAudio=%08X\n", lpParms->dwAudio); #endif @@ -569,7 +763,7 @@ DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) { #ifdef linux -#ifdef DEBUG_MCIMIDI +#ifdef DEBUG_MIDI printf("MIDI_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); #endif if (lpParms == NULL) return MCIERR_INTERNAL; @@ -748,8 +942,54 @@ DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS lpCaps, DWORD dwSize) */ DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { - printf("modOpen(%u, %08X, %08X);\n", wDevID, lpDesc, dwFlags); +#ifdef linux + int midi; + dprintf_midi(stddeb, + "midOpen(%u, %08X, %08X);\n", wDevID, lpDesc, dwFlags); + if (lpDesc == NULL) { + fprintf(stderr,"Linux 'midOpen' // Invalid Parameter !\n"); + return MMSYSERR_INVALPARAM; + } + if (wDevID >= MAX_MIDIINDRV) { + fprintf(stderr,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n"); + return MMSYSERR_ALLOCATED; + } + MidiInDev[wDevID].unixdev = 0; + midi = open (MIDI_DEV, O_RDONLY, 0); + if (midi == -1) { + fprintf(stderr,"Linux 'midOpen' // can't open !\n"); + return MMSYSERR_NOTENABLED; + } + MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); + switch(MidiInDev[wDevID].wFlags) { + case DCB_NULL: + fprintf(stderr,"Linux 'midOpen' // CALLBACK_NULL !\n"); + break; + case DCB_WINDOW: + dprintf_midi(stddeb, + "Linux 'midOpen' // CALLBACK_WINDOW !\n"); + break; + case DCB_TASK: + dprintf_midi(stddeb, + "Linux 'midOpen' // CALLBACK_TASK !\n"); + break; + case DCB_FUNCTION: + dprintf_midi(stddeb, + "Linux 'midOpen' // CALLBACK_FUNCTION !\n"); + break; + } + MidiInDev[wDevID].lpQueueHdr = NULL; + MidiInDev[wDevID].unixdev = midi; + MidiInDev[wDevID].dwTotalPlayed = 0; + MidiInDev[wDevID].bufsize = 0x3FFF; + if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { + fprintf(stderr,"Linux 'midOpen' // can't notify client !\n"); + return MMSYSERR_INVALPARAM; + } + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** @@ -757,8 +997,23 @@ DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) */ DWORD midClose(WORD wDevID) { - printf("midClose(%u);\n", wDevID); +#ifdef linux + dprintf_midi(stddeb,"midClose(%u);\n", wDevID); + if (MidiInDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'midClose' // can't close !\n"); + return MMSYSERR_NOTENABLED; + } + close(MidiInDev[wDevID].unixdev); + MidiInDev[wDevID].unixdev = 0; + MidiInDev[wDevID].bufsize = 0; + if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { + fprintf(stderr,"Linux 'midClose' // can't notify client !\n"); + return MMSYSERR_INVALPARAM; + } + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** @@ -871,8 +1126,56 @@ DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS lpCaps, DWORD dwSize) */ DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { - printf("modOpen(%u, %08X, %08X);\n", wDevID, lpDesc, dwFlags); +#ifdef linux + int midi; + dprintf_midi(stddeb, + "modOpen(%u, %08X, %08X);\n", wDevID, lpDesc, dwFlags); + if (lpDesc == NULL) { + fprintf(stderr,"Linux 'modOpen' // Invalid Parameter !\n"); + return MMSYSERR_INVALPARAM; + } + if (wDevID >= MAX_MIDIOUTDRV) { + fprintf(stderr,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n"); + return MMSYSERR_ALLOCATED; + } + MidiOutDev[wDevID].unixdev = 0; + midi = open (MIDI_DEV, O_WRONLY, 0); + if (midi == -1) { + fprintf(stderr,"Linux 'modOpen' // can't open !\n"); + return MMSYSERR_NOTENABLED; + } + MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); + switch(MidiOutDev[wDevID].wFlags) { + case DCB_NULL: + fprintf(stderr,"Linux 'modOpen' // CALLBACK_NULL !\n"); + break; + case DCB_WINDOW: + dprintf_midi(stddeb, + "Linux 'modOpen' // CALLBACK_WINDOW !\n"); + break; + case DCB_TASK: + dprintf_midi(stddeb, + "Linux 'modOpen' // CALLBACK_TASK !\n"); + break; + case DCB_FUNCTION: + dprintf_midi(stddeb, + "Linux 'modOpen' // CALLBACK_FUNCTION !\n"); + break; + } + MidiOutDev[wDevID].lpQueueHdr = NULL; + MidiOutDev[wDevID].unixdev = midi; + MidiOutDev[wDevID].dwTotalPlayed = 0; + MidiOutDev[wDevID].bufsize = 0x3FFF; + if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { + fprintf(stderr,"Linux 'modOpen' // can't notify client !\n"); + return MMSYSERR_INVALPARAM; + } + dprintf_midi(stddeb, + "Linux 'modOpen' // Succesful unixdev=%d !\n", midi); + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } @@ -881,16 +1184,43 @@ DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) */ DWORD modClose(WORD wDevID) { - printf("modClose(%u);\n", wDevID); +#ifdef linux + dprintf_midi(stddeb,"modClose(%u);\n", wDevID); + if (MidiOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'modClose' // can't close !\n"); + return MMSYSERR_NOTENABLED; + } + close(MidiOutDev[wDevID].unixdev); + MidiOutDev[wDevID].unixdev = 0; + MidiOutDev[wDevID].bufsize = 0; + if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { + fprintf(stderr,"Linux 'modClose' // can't notify client !\n"); + return MMSYSERR_INVALPARAM; + } + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** * modData [internal] */ -DWORD modData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) +DWORD modData(WORD wDevID, DWORD dwParam) { - printf("modData(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); + WORD event; + dprintf_midi(stddeb, + "modData(%u, %08X);\n", wDevID, dwParam); + if (MidiOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'modData' // can't play !\n"); + return MIDIERR_NODEVICE; + } + event = LOWORD(dwParam); + if (write (MidiOutDev[wDevID].unixdev, + &event, sizeof(WORD)) != sizeof(WORD)) { + dprintf_midi(stddeb, + "modData() // error writting unixdev !\n"); + } return MMSYSERR_NOTENABLED; } @@ -899,8 +1229,49 @@ DWORD modData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { +#ifdef linux + int count; + LPWORD ptr; + dprintf_midi(stddeb, + "modLongData(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); printf("modLongData(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); + if (MidiOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'modLongData' // can't play !\n"); + return MIDIERR_NODEVICE; + } + if (lpMidiHdr->lpData == NULL) return MIDIERR_UNPREPARED; + if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED; + if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; + lpMidiHdr->dwFlags &= ~MHDR_DONE; + lpMidiHdr->dwFlags |= MHDR_INQUEUE; + dprintf_midi(stddeb, + "modLongData() // dwBytesRecorded %u !\n", lpMidiHdr->dwBytesRecorded); +/* + count = write (MidiOutDev[wDevID].unixdev, + lpMidiHdr->lpData, lpMidiHdr->dwBytesRecorded); +*/ + ptr = (LPWORD)lpMidiHdr->lpData; + for (count = 0; count < lpMidiHdr->dwBytesRecorded; count++) { + if (write (MidiOutDev[wDevID].unixdev, ptr, + sizeof(WORD)) != sizeof(WORD)) break; + ptr++; + } + if (count != lpMidiHdr->dwBytesRecorded) { + dprintf_midi(stddeb, + "modLongData() // error writting unixdev #%d ! (%d != %d)\n", + MidiOutDev[wDevID].unixdev, count, lpMidiHdr->dwBytesRecorded); + return MMSYSERR_NOTENABLED; + } + lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; + lpMidiHdr->dwFlags |= MHDR_DONE; + if (MIDI_NotifyClient(wDevID, MOM_DONE, 0L, 0L) != MMSYSERR_NOERROR) { + fprintf(stderr,"Linux 'modLongData' // can't notify client !\n"); + return MMSYSERR_INVALPARAM; + } + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** @@ -908,8 +1279,26 @@ DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { - printf("modPrepare(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); +#ifdef linux + dprintf_midi(stddeb, + "modPrepare(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); + if (MidiOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'modPrepare' // can't prepare !\n"); + return MMSYSERR_NOTENABLED; + } + if (MidiOutDev[wDevID].lpQueueHdr != NULL) { + fprintf(stderr,"Linux 'modPrepare' // already prepare !\n"); + return MMSYSERR_NOTENABLED; + } + MidiOutDev[wDevID].dwTotalPlayed = 0; + MidiOutDev[wDevID].lpQueueHdr = lpMidiHdr; + if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; + lpMidiHdr->dwFlags |= MHDR_PREPARED; + lpMidiHdr->dwFlags &= ~MHDR_DONE; + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** @@ -917,8 +1306,17 @@ DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { - printf("modUnprepare(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); +#ifdef linux + dprintf_midi(stddeb, + "modUnprepare(%u, %08X, %08X);\n", wDevID, lpMidiHdr, dwSize); + if (MidiOutDev[wDevID].unixdev == 0) { + fprintf(stderr,"Linux 'modUnprepare' // can't unprepare !\n"); + return MMSYSERR_NOTENABLED; + } + return MMSYSERR_NOERROR; +#else return MMSYSERR_NOTENABLED; +#endif } /************************************************************************** @@ -955,7 +1353,7 @@ DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case MODM_CLOSE: return modClose(wDevID); case MODM_DATA: - return modData(wDevID, (LPMIDIHDR)dwParam1, dwParam2); + return modData(wDevID, dwParam1); case MODM_LONGDATA: return modLongData(wDevID, (LPMIDIHDR)dwParam1, dwParam2); case MODM_PREPARE: diff --git a/misc/mmaux.c b/multimedia/mmaux.c similarity index 73% rename from misc/mmaux.c rename to multimedia/mmaux.c index 1c4cc063c2a..ef69eed2f77 100644 --- a/misc/mmaux.c +++ b/multimedia/mmaux.c @@ -119,13 +119,41 @@ DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol) #ifdef linux int mixer; int volume; + int cmd; printf("AUX_GetVolume(%u, %08X);\n", wDevID, lpdwVol); if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { printf("Linux 'AUX_GetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } - if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) { + switch(wDevID) { + case 0: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n"); + cmd = SOUND_MIXER_READ_PCM; + break; + case 1: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n"); + cmd = SOUND_MIXER_READ_SYNTH; + break; + case 2: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n"); + cmd = SOUND_MIXER_READ_CD; + break; + case 3: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n"); + cmd = SOUND_MIXER_READ_LINE; + break; + case 4: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n"); + cmd = SOUND_MIXER_READ_MIC; + break; + case 5: + default: + printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n"); + cmd = SOUND_MIXER_READ_VOLUME; + break; + } + if (ioctl(mixer, cmd, &volume) == -1) { printf("Linux 'AUX_GetVolume' // unable read mixer !\n"); return MMSYSERR_NOTENABLED; } @@ -144,13 +172,42 @@ DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) { #ifdef linux int mixer; - int volume = 50; + int volume; + int cmd; printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam); + volume = LOWORD(dwParam); if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { printf("Linux 'AUX_SetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } - if (ioctl(mixer, SOUND_MIXER_WRITE_LINE, &volume) == -1) { + switch(wDevID) { + case 0: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n"); + cmd = SOUND_MIXER_WRITE_PCM; + break; + case 1: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n"); + cmd = SOUND_MIXER_WRITE_SYNTH; + break; + case 2: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n"); + cmd = SOUND_MIXER_WRITE_CD; + break; + case 3: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n"); + cmd = SOUND_MIXER_WRITE_LINE; + break; + case 4: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n"); + cmd = SOUND_MIXER_WRITE_MIC; + break; + case 5: + default: + printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n"); + cmd = SOUND_MIXER_WRITE_VOLUME; + break; + } + if (ioctl(mixer, cmd, &volume) == -1) { printf("Linux 'AUX_SetVolume' // unable set mixer !\n"); return MMSYSERR_NOTENABLED; } diff --git a/misc/mmsystem.c b/multimedia/mmsystem.c similarity index 98% rename from misc/mmsystem.c rename to multimedia/mmsystem.c index db60012bd96..e9322fd716b 100644 --- a/misc/mmsystem.c +++ b/multimedia/mmsystem.c @@ -53,6 +53,14 @@ UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize); LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, DWORD dwParam1, DWORD dwParam2); +LRESULT WAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, + DWORD dwParam1, DWORD dwParam2); +LRESULT MIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, + DWORD dwParam1, DWORD dwParam2); +LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, + DWORD dwParam1, DWORD dwParam2); +LRESULT ANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, + DWORD dwParam1, DWORD dwParam2); /************************************************************************** * MMSYSTEM_WEP [MMSYSTEM.1] @@ -708,6 +716,10 @@ DWORD mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) dwRet = MIDI_DriverProc(mciDrv[wDevID].wDeviceID, 0, MCI_CLOSE, dwParam, (DWORD)lpParms); break; + case MCI_DEVTYPE_ANIMATION: + dwRet = ANIM_DriverProc(mciDrv[wDevID].wDeviceID, 0, + MCI_CLOSE, dwParam, (DWORD)lpParms); + break; default: printf("mciClose() // unknown type=%04X !\n", mciDrv[wDevID].wType); } @@ -756,6 +768,9 @@ DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2) case MCI_DEVTYPE_SEQUENCER: return MIDI_DriverProc(mciDrv[wDevID].wDeviceID, hDrv, wMsg, dwParam1, dwParam2); + case MCI_DEVTYPE_ANIMATION: + return ANIM_DriverProc(mciDrv[wDevID].wDeviceID, hDrv, + wMsg, dwParam1, dwParam2); default: printf("mciSendCommand() // unknown type=%04X !\n", mciDrv[wDevID].wType); @@ -1691,6 +1706,7 @@ UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) GlobalLock(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; + if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE; USER_HEAP_FREE(HIWORD((DWORD)lpWaveInHdr->lpData)); lpWaveInHdr->lpData = NULL; lpWaveInHdr->lpNext = NULL; @@ -2039,7 +2055,10 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin) LPMMIOINFO lpmminfo; printf("mmioSeek(%04X, %08X, %d);\n", hmmio, lOffset, iOrigin); lpmminfo = (LPMMIOINFO)GlobalLock(hmmio); - if (lpmminfo == NULL) return 0; + if (lpmminfo == NULL) { + printf("mmioSeek // can't lock hmmio=%04X !\n", hmmio); + return 0; + } count = _llseek(LOWORD(lpmminfo->dwReserved2), lOffset, iOrigin); GlobalUnlock(hmmio); return count; diff --git a/objects/bitblt.c b/objects/bitblt.c index 05f17df7362..fa58dad4ab3 100644 --- a/objects/bitblt.c +++ b/objects/bitblt.c @@ -27,6 +27,47 @@ extern Colormap COLOR_WinColormap; /*********************************************************************** + * BITBLT_GetImage + */ +static XImage *BITBLT_GetImage( HDC hdc, int x, int y, int width, int height ) +{ + XImage *image; + RECT rect; + DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); + + GetClipBox( hdc, &rect ); + OffsetRect( &rect, dc->w.DCOrgX, dc->w.DCOrgY ); + if ((x >= rect.left) && (y >= rect.top) + && (x+width < rect.right) && (y+height < rect.bottom)) + { + image = XGetImage( display, dc->u.x.drawable, x, y, width, height, + AllPlanes, ZPixmap ); + } + else /* Get only the visible sub-image */ + { + int width_bytes = ((dc->w.bitsPerPixel == 24 ? 32 : dc->w.bitsPerPixel) + * width + 31) / 32 * 4; + char *data = malloc( height * width_bytes ); + image = XCreateImage( display, DefaultVisualOfScreen(screen), + dc->w.bitsPerPixel, ZPixmap, 0, data, + width, height, 32, width_bytes ); + if (image && !IsRectEmpty(&rect)) + { + int x1, y1, x2, y2; + x1 = max( x, rect.left ); + y1 = max( y, rect.top ); + x2 = min( x + width, rect.right ); + y2 = min( y + height, rect.bottom ); + if ((x1 < x2) && (y1 < y2)) + XGetSubImage( display, dc->u.x.drawable, x1, y1, x2-x1, y2-y1, + AllPlanes, ZPixmap, image, x1-x, y1-y ); + } + } + return image; +} + + +/*********************************************************************** * PatBlt (GDI.29) */ BOOL PatBlt( HDC hdc, short left, short top, @@ -161,17 +202,17 @@ BOOL BitBlt( HDC hdcDest, short xDest, short yDest, short width, short height, HBRUSH cur_brush=SelectObject(hdcDest, GetStockObject(BLACK_BRUSH)); SelectObject(hdcDest, cur_brush); /* FillRect(hdcBrush, &r, cur_brush);*/ - sxi=XGetImage(display, dcSrc->u.x.drawable, min(xs1,xs2), min(ys1,ys2), - abs(xs2-xs1), abs(ys2-ys1), AllPlanes, ZPixmap); - dxi=XGetImage(display, dcDest->u.x.drawable, min(xd1,xd2),min(yd1,yd2), - abs(xs2-xs1), abs(ys2-ys1), AllPlanes, ZPixmap); + sxi = BITBLT_GetImage( hdcSrc, min(xs1,xs2), min(ys1,ys2), + abs(xs2-xs1), abs(ys2-ys1) ); + dxi = BITBLT_GetImage( hdcDest, min(xd1,xd2), min(yd1,yd2), + abs(xs2-xs1), abs(ys2-ys1) ); /* dcBrush = (DC *) GDI_GetObjPtr( hdcBrush, DC_MAGIC );*/ /* bxi=XGetImage(display, dcBrush->u.x.drawable, min(xd1,xd2),min(yd1,yd2), abs(xs2-xs1), abs(ys2-ys1), AllPlanes, ZPixmap);*/ /* FIXME: It's really not necessary to do this on the visible screen */ FillRect(hdcDest, &r, cur_brush); - bxi=XGetImage(display, dcDest->u.x.drawable, min(xd1,xd2),min(yd1,yd2), - abs(xs2-xs1), abs(ys2-ys1), AllPlanes, ZPixmap); + bxi = BITBLT_GetImage( hdcDest, min(xd1,xd2), min(yd1,yd2), + abs(xs2-xs1), abs(ys2-ys1) ); for (i=0; iw.bitsPerPixel)); i++) { entry.pixel = i; @@ -507,8 +548,7 @@ BOOL StretchBlt( HDC hdcDest, short xDest, short yDest, short widthDest, short h * the pixels */ - sxi = XGetImage(display, dcSrc->u.x.drawable, xs1, ys1, - widthSrc, heightSrc, AllPlanes, ZPixmap); + sxi = BITBLT_GetImage( hdcSrc, xs1, ys1, widthSrc, heightSrc ); dxi = XCreateImage(display, DefaultVisualOfScreen(screen), screenDepth, ZPixmap, 0, NULL, widthDest, heightDest, diff --git a/objects/bitmap.c b/objects/bitmap.c index b4054fc5ec8..14bdd1f302e 100644 --- a/objects/bitmap.c +++ b/objects/bitmap.c @@ -13,10 +13,10 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "gdi.h" #include "bitmap.h" #include "stddebug.h" -/* #define DEBUG_GDI /* */ -/* #undef DEBUG_GDI /* */ -/* #define DEBUG_BITMAP /* */ -/* #define DEBUG_BITMAP /* */ +/* #define DEBUG_GDI */ +/* #undef DEBUG_GDI */ +/* #define DEBUG_BITMAP */ +/* #define DEBUG_BITMAP */ #include "debug.h" /* GCs used for B&W and color bitmap operations */ diff --git a/objects/brush.c b/objects/brush.c index cc3797a30a4..4403353e512 100644 --- a/objects/brush.c +++ b/objects/brush.c @@ -11,8 +11,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "prototypes.h" #include "metafile.h" #include "stddebug.h" -/* #define DEBUG_GDI /* */ -/* #undef DEBUG_GDI /* */ +/* #define DEBUG_GDI */ +/* #undef DEBUG_GDI */ #include "debug.h" #define NB_HATCH_STYLES 6 diff --git a/objects/color.c b/objects/color.c index acd145fe840..545169b8187 100644 --- a/objects/color.c +++ b/objects/color.c @@ -232,7 +232,7 @@ WORD COLOR_ToPhysical( DC *dc, COLORREF color ) WORD index = 0; WORD *mapping; - if (!dc->u.x.pal.hMapping) return 0; + if (dc && !dc->u.x.pal.hMapping) return 0; switch(color >> 24) { case 0: /* RGB */ @@ -242,11 +242,20 @@ WORD COLOR_ToPhysical( DC *dc, COLORREF color ) index = color & 0xffff; break; case 2: /* PALETTERGB */ - index = GetNearestPaletteIndex( dc->w.hPalette, color ); + if (dc) index = GetNearestPaletteIndex( dc->w.hPalette, color ); + else index = 0; break; } - if (index >= dc->u.x.pal.mappingSize) return 0; - mapping = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hMapping ); + if (dc) + { + if (index >= dc->u.x.pal.mappingSize) return 0; + mapping = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hMapping ); + } + else + { + if (index >= NB_RESERVED_COLORS) return 0; + mapping = (WORD *) GDI_HEAP_ADDR( hSysColorTranslation ); + } return mapping[index]; } diff --git a/objects/dib.c b/objects/dib.c index a37509bc705..afb79be56b7 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -16,6 +16,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "stddebug.h" /* #define DEBUG_ICON /* */ /* #undef DEBUG_ICON /* */ +/* #define DEBUG_BITMAP /* */ +/* #undef DEBUG_BIYMAP /* */ #include "debug.h" extern const int DC_XROPfunction[]; @@ -49,7 +51,8 @@ static XImage *DIB_DIBmpToImage( BITMAPINFOHEADER * bmp, void * bmpData ) { extern void _XInitImageFuncPtrs( XImage* ); XImage * image; - int bytesPerLine = (bmp->biWidth * bmp->biBitCount + 31) / 32 * 4; + int bytesPerLine = ((bmp->biBitCount == 24 ? 32 : bmp->biBitCount) + * bmp->biWidth + 31) / 32 * 4; image = XCreateImage( display, DefaultVisualOfScreen( screen ), bmp->biBitCount, ZPixmap, 0, bmpData, @@ -220,61 +223,185 @@ static void DIB_SetImageBits_8( WORD lines, BYTE *bits, WORD width, } /*********************************************************************** - * DIB_SetImageBits_RLE8 + * DIB_SetImageBits_RLE8 * * SetDIBits for an 8-bit deep compressed DIB. + * + * This function rewritten 941113 by James Youngman. WINE blew out when I + * first ran it because my desktop wallpaper is a (large) RLE8 bitmap. + * + * This was because the algorithm assumed that all RLE8 bitmaps end with the + * 'End of bitmap' escape code. This code is very much laxer in what it + * allows to end the expansion. Possibly too lax. See the note by + * case RleDelta. BTW, MS's documentation implies that a correct RLE8 + * bitmap should end with RleEnd, but on the other hand, software exists + * that produces ones that don't and Windows 3.1 doesn't complain a bit + * about it. + * + * (No) apologies for my English spelling. [Emacs users: c-indent-level=4]. + * James A. Youngman + * [JAY] */ -static void DIB_SetImageBits_RLE8( WORD lines, BYTE *bits, WORD width, - WORD *colors, XImage *bmpImage ) -{ - int x = 0, i, length; - BYTE *begin = bits; - lines--; - while (1) { - length = *bits++; - if (length) { /* encoded */ - while (length--) { - XPutPixel(bmpImage, x++, lines, colors[*bits]); - if (x > width) { - x = 0; - if (lines) - lines--; - } - } - bits++; - } else { - length = *bits++; - switch (length) { - case 0: /* eol */ - x = 0; - lines--; - continue; - - case 1: /* eopicture */ - return; - - case 2: /* delta */ - x += *bits++; - lines -= *bits++; - continue; +enum Rle8_EscapeCodes +{ + /* + * Apologies for polluting your file's namespace... + */ + RleEol = 0, /* End of line */ + RleEnd = 1, /* End of bitmap */ + RleDelta = 2 /* Delta */ +}; + +static void DIB_SetImageBits_RLE8(WORD lines, + BYTE *bits, + WORD width, + WORD *colors, + XImage *bmpImage) +{ + int x; /* X-positon on each line. Increases. */ + int line; /* Line #. Starts at lines-1, decreases */ + BYTE *pIn = bits; /* Pointer to current position in bits */ + BYTE length; /* The length pf a run */ + BYTE color_index; /* index into colors[] as read from bits */ + BYTE escape_code; /* See enum Rle8_EscapeCodes.*/ + WORD color; /* value of colour[color_index] */ + + if (lines == 0) /* Let's hope this doesn't happen. */ + return; + + /* + * Note that the bitmap data is stored by Windows starting at the + * bottom line of the bitmap and going upwards. Within each line, + * the data is stored left-to-right. That's the reason why line + * goes from lines-1 to 0. [JAY] + */ + + x = 0; + line = lines-1; + do + { + length = *pIn++; + + /* + * If the length byte is not zero (which is the escape value), + * We have a run of length pixels all the same colour. The colour + * index is stored next. + * + * If the length byte is zero, we need to read the next byte to + * know what to do. [JAY] + */ + if (length != 0) + { + /* + * [Run-Length] Encoded mode + */ + color_index = (*pIn++); /* Get the colour index. */ + color = colors[color_index]; + + while(length--) + XPutPixel(bmpImage, x++, line, color); + } + else + { + /* + * Escape codes (may be an absolute sequence though) + */ + escape_code = (*pIn++); + switch(escape_code) + { + case RleEol: /* =0, end of line */ + { + x = 0; + line--; + break; + } + + case RleEnd: /* =1, end of bitmap */ + { + /* + * Not all RLE8 bitmaps end with this + * code. For example, Paint Shop Pro + * produces some that don't. That's (I think) + * what caused the previous implementation to + * fail. [JAY] + */ + line=0; /* Cause exit from do loop. */ + } + + case RleDelta: /* =2, a delta */ + { + /* + * Note that deltaing to line 0 + * will cause an exit from the loop, + * which may not be what is intended. + * The fact that there is a delta in the bits + * almost certainly implies that there is data + * to follow. You may feel that we should + * jump to the top of the loop to avoid exiting + * in this case. + * + * TODO: Decide what to do here in that case. [JAY] + */ + x += (*pIn++); + line -= (*pIn++); + if (line == 0) + { + dprintf_bitmap(stddeb, + "DIB_SetImageBits_RLE8(): " + "Delta to last line of bitmap " + "(wrongly??) causes loop exit\n"); + } + break; + } + + default: /* >2, switch to absolute mode */ + { + /* + * Absolute Mode + */ + length = escape_code; + while(length--) + { + color_index = (*pIn++); + XPutPixel(bmpImage, x++, line, + colors[color_index]); + } + + /* + * If you think for a moment you'll realise that the + * only time we could ever possibly read an odd + * number of bytes is when there is a 0x00 (escape), + * a value >0x02 (absolute mode) and then an odd- + * length run. Therefore this is the only place we + * need to worry about it. Everywhere else the + * bytes are always read in pairs. [JAY] + */ + if (escape_code & 1) + (*pIn++); /* Get and throw away the pad byte. */ + break; + } + } /* switch (escape_code) : Escape sequence */ + } /* process either an encoded sequence or an escape sequence */ + + /* We expect to come here more than once per line. */ + } while (line > 0); /* Do this until the bitmap is filled */ + + /* + * Everybody comes here at the end. + * Check how we exited the loop and print a message if it's a bit odd. + * [JAY] + */ + if ( (*(pIn-2) != 0/*escape*/) || (*(pIn-1)!= RleEnd) ) + { + dprintf_bitmap(stddeb, "DIB_SetImageBits_RLE8(): End-of-bitmap " + "without (strictly) proper escape code. Last two " + "bytes were: %02X %02X.\n", + (int)*(pIn-2), + (int)*(pIn-1)); + } +} - default: /* absolute */ - for (i = length; i ; i--) { - XPutPixel(bmpImage, x++, lines, - colors[*bits++]); - if (x > width) { - x = 0; - if (lines) - lines--; - } - } - if ((bits - begin) & 1) - bits++; - } - } - } -} /*********************************************************************** * DIB_SetImageBits_24 @@ -342,7 +469,8 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits, /* Transfer the pixels */ - widthBytes = (info->bmiHeader.biWidth * depth + 31) / 32 * 4; + widthBytes = ((depth == 24 ? 32 : depth) * info->bmiHeader.biWidth + 31) + / 32 * 4; bmpData = malloc( lines * widthBytes ); bmpImage = XCreateImage( display, DefaultVisualOfScreen(screen), depth, ZPixmap, 0, bmpData, diff --git a/objects/font.c b/objects/font.c index 2e6480bec2a..f051b8a1340 100644 --- a/objects/font.c +++ b/objects/font.c @@ -13,8 +13,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "user.h" #include "gdi.h" #include "stddebug.h" -/* #define DEBUG_FONT /* */ -/* #undef DEBUG_FONT /* */ +/* #define DEBUG_FONT */ +/* #undef DEBUG_FONT */ #include "debug.h" #define MAX_FONTS 256 @@ -157,7 +157,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc ) family = FONT_TranslateName( "decorative" ); break; default: - family = FontNames[0].x11; + family = "*-*"; break; } @@ -248,7 +248,7 @@ HFONT CreateFontIndirect( LOGFONT * font ) fontPtr = (FONTOBJ *) GDI_HEAP_ADDR( hfont ); memcpy( &fontPtr->logfont, font, sizeof(LOGFONT) ); AnsiLower( fontPtr->logfont.lfFaceName ); - dprintf_font(stddeb,"CreateFontIndirect(%08X); return %04X\n",font,hfont); + dprintf_font(stddeb,"CreateFontIndirect(%p); return %04x\n",font,hfont); return hfont; } @@ -288,7 +288,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) X_PHYSFONT * stockPtr; HFONT prevHandle = dc->w.hFont; XFontStruct * fontStruct; - dprintf_font(stddeb,"FONT_SelectObject(%04X, %04X, %08X); !\n", + dprintf_font(stddeb,"FONT_SelectObject(%p, %04x, %p)\n", dc, hfont, font); /* Load font if necessary */ @@ -487,7 +487,7 @@ BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC metrics ) */ DWORD SetMapperFlags(HDC hDC, DWORD dwFlag) { - dprintf_font(stdnimp,"SetmapperFlags(%04X, %08X) // Empty Stub !\n", + dprintf_font(stdnimp,"SetmapperFlags(%04X, %08lX) // Empty Stub !\n", hDC, dwFlag); return 0L; } @@ -555,8 +555,8 @@ BOOL RemoveFontResource( LPSTR str ) */ int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz) { - int i, j; - dprintf_font(stddeb,"ParseFontParms('%s', %d, %08X, %d);\n", + int i; + dprintf_font(stddeb,"ParseFontParms('%s', %d, %p, %d);\n", lpFont, wParmsNo, lpRetStr, wMaxSiz); if (lpFont == NULL) return 0; if (lpRetStr == NULL) return 0; @@ -589,7 +589,7 @@ void InitFontsList() char *family, *weight, *charset; char **names; char slant, spacing; - int i, width, count; + int i, count; LPLOGFONT lpNewFont; weight = "medium"; slant = 'r'; diff --git a/objects/gdiobj.c b/objects/gdiobj.c index e521619733a..992c9350ce5 100644 --- a/objects/gdiobj.c +++ b/objects/gdiobj.c @@ -12,8 +12,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "gdi.h" #include "prototypes.h" #include "stddebug.h" -/* #define DEBUG_GDI /* */ -/* #undef DEBUG_GDI /* */ +/* #define DEBUG_GDI */ +/* #undef DEBUG_GDI */ #include "debug.h" MDESC *GDI_Heap = NULL; @@ -345,7 +345,7 @@ HANDLE GetStockObject( int obj ) int GetObject( HANDLE handle, int count, LPSTR buffer ) { GDIOBJHDR * ptr = NULL; - dprintf_gdi(stddeb, "GetObject: %04x %d %08x\n", handle, count, buffer ); + dprintf_gdi(stddeb, "GetObject: %04x %d %p\n", handle, count, buffer ); if (!count) return 0; if (handle >= FIRST_STOCK_HANDLE) diff --git a/objects/oembitmap.c b/objects/oembitmap.c index f33d60b3bd2..0c5a96c6871 100644 --- a/objects/oembitmap.c +++ b/objects/oembitmap.c @@ -22,20 +22,43 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994"; #ifdef USE_XPM - /* Known symbolic names for colors. Use these whenever possible. */ -struct sys_colors_symbols + +#define NB_COLOR_SYMBOLS 5 + + /* This is the list of the symbolic colors. All the colors used */ + /* in the xpm files must be included in this list. If you need */ + /* to add new colors, add them just before "black", and add the */ + /* color identifier in OBM_Sys_Colors_Symbols below. */ + /* Warning: black and white must always be the last 2 colors. */ + +static XpmColorSymbol OBM_Color_Symbols[NB_COLOR_SYMBOLS+2] = +{ + { "button_face", NULL, 0 }, /* COLOR_BTNFACE */ + { "button_shadow", NULL, 0 }, /* COLOR_BTNSHADOW */ + { "button_highlight", NULL, 0 }, /* COLOR_BTNHIGHLIGHT */ + { "button_text", NULL, 0 }, /* COLOR_BTNTEXT */ + { "window_frame", NULL, 0 }, /* COLOR_WINDOWFRAME */ + { "black", NULL, 0 }, + { "white", NULL, 0 } +}; + +static const int OBM_Sys_Colors_Symbols[NB_COLOR_SYMBOLS] = { - char *symbol; - WORD syscolor; + COLOR_BTNFACE, + COLOR_BTNSHADOW, + COLOR_BTNHIGHLIGHT, + COLOR_BTNTEXT, + COLOR_WINDOWFRAME }; -static const struct sys_colors_symbols OBM_Color_Symbols[] = + /* Don't change this list! */ +static XpmColorSymbol OBM_BW_Symbols[2] = { - { "button_face", COLOR_BTNFACE }, - { "button_shadow", COLOR_BTNSHADOW }, - { "button_highlight", COLOR_BTNHIGHLIGHT } + { "white", NULL, 0 }, + { "black", NULL, 1 } }; + /* Include OEM pixmaps */ #include "bitmaps/obm_lfarrowi" #include "bitmaps/obm_rgarrowi" @@ -165,11 +188,36 @@ static const struct #endif /* USE_XPM */ +extern WORD COLOR_ToPhysical( DC *dc, COLORREF color ); /* color.c */ extern Colormap COLOR_WinColormap; /*********************************************************************** + * OBM_InitColorSymbols + */ +#ifdef USE_XPM +static void OBM_InitColorSymbols() +{ + int i; + static int already_done = 0; + + if (already_done) return; + + /* Init the system colors */ + for (i = 0; i < NB_COLOR_SYMBOLS; i++) + { + OBM_Color_Symbols[i].pixel = COLOR_ToPhysical( NULL, + GetSysColor(OBM_Sys_Colors_Symbols[i])); + } + /* Init black and white */ + OBM_Color_Symbols[i++].pixel = COLOR_ToPhysical( NULL, RGB(0,0,0) ); + OBM_Color_Symbols[i++].pixel = COLOR_ToPhysical( NULL, RGB(255,255,255) ); + already_done = 1; +} +#endif /* USE_XPM */ + +/*********************************************************************** * OBM_LoadOEMBitmap */ HBITMAP OBM_LoadOEMBitmap( WORD id ) @@ -181,21 +229,28 @@ HBITMAP OBM_LoadOEMBitmap( WORD id ) 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; + int err; - attrs.valuemask = XpmColormap | XpmDepth; - attrs.colormap = COLOR_WinColormap; + OBM_InitColorSymbols(); + attrs.valuemask = XpmColormap | XpmDepth | XpmColorSymbols; + attrs.colormap = COLOR_WinColormap; if (OBM_Pixmaps_Data[id].color) attrs.depth = bpp = screenDepth; else attrs.depth = bpp = 1; + attrs.colorsymbols = (bpp > 1) ? OBM_Color_Symbols : OBM_BW_Symbols; + attrs.numsymbols = (bpp > 1) ? NB_COLOR_SYMBOLS + 2 : 2; - if (XpmCreatePixmapFromData( display, rootWindow, - OBM_Pixmaps_Data[id].data, - &pixmap, NULL, &attrs ) != XpmSuccess) + if ((err = XpmCreatePixmapFromData( display, rootWindow, + OBM_Pixmaps_Data[id].data, + &pixmap, NULL, + &attrs )) != XpmSuccess) { - fprintf( stderr, "Error creating pixmap\n" ); + fprintf( stderr, "Error %d creating pixmap %d\n", + err, OBM_FIRST+id ); pixmap = 0; } else diff --git a/objects/palette.c b/objects/palette.c index 7761c2e211a..7a8cde46ded 100644 --- a/objects/palette.c +++ b/objects/palette.c @@ -9,11 +9,6 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993,1994"; #include #include #include -/* -#ifdef linux -#include -#endif -*/ #if !defined (MAXINT) #include @@ -23,8 +18,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993,1994"; #include #include "gdi.h" #include "stddebug.h" -/* #define DEBUG_PALETTE /* */ -/* #undef DEBUG_PALETTE /* */ +/* #define DEBUG_PALETTE */ +/* #undef DEBUG_PALETTE */ #include "debug.h" extern void COLOR_SetMapping( DC *dc, HANDLE map, WORD size ); /* color.c */ @@ -160,7 +155,7 @@ WORD GetNearestPaletteIndex( HPALETTE hpalette, COLORREF color ) } entry++; } - dprintf_palette(stddeb,"GetNearestPaletteIndex(%x,%06x) : returning %d\n", + dprintf_palette(stddeb,"GetNearestPaletteIndex(%x,%06lx): returning %d\n", hpalette, color, index ); return index; } diff --git a/objects/pen.c b/objects/pen.c index 00eba87da77..df5f55c8ed3 100644 --- a/objects/pen.c +++ b/objects/pen.c @@ -9,8 +9,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "gdi.h" #include "metafile.h" #include "stddebug.h" -/* #define DEBUG_GDI /* */ -/* #undef DEBUG_GDI /* */ +/* #define DEBUG_GDI */ +/* #undef DEBUG_GDI */ #include "debug.h" extern WORD COLOR_ToPhysical( DC *dc, COLORREF color ); @@ -21,7 +21,7 @@ extern WORD COLOR_ToPhysical( DC *dc, COLORREF color ); HPEN CreatePen( short style, short width, COLORREF color ) { LOGPEN logpen = { style, { width, 0 }, color }; - dprintf_gdi(stddeb, "CreatePen: %d %d %06x\n", style, width, color ); + dprintf_gdi(stddeb, "CreatePen: %d %d %06lx\n", style, width, color ); return CreatePenIndirect( &logpen ); } diff --git a/objects/text.c b/objects/text.c index e45973edc7a..d07d2b9678b 100644 --- a/objects/text.c +++ b/objects/text.c @@ -158,9 +158,12 @@ static char *TEXT_NextLine(HDC hdc, char *str, int *count, char *dest, { if (format & DT_WORDBREAK) { - *len = wb_j; - *count = wb_count - 1; - return (&str[wb_i]); + if (wb_j) + { + *len = wb_j; + *count = wb_count - 1; + return (&str[wb_i]); + } } else { diff --git a/rc/Imakefile b/rc/Imakefile index 73836edb1b8..02e885f5441 100644 --- a/rc/Imakefile +++ b/rc/Imakefile @@ -8,21 +8,24 @@ MODULE = rc 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 -o $* -v -p $* + gcc -E -x c -P $(CFLAGS) $*.rct | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | ./winerc -o $* -v -p $* $(RM) $*.rct +XCOMM This would be nicer, but it breaks gcc (2.5.8 on Linux) --AJ +XCOMM gcc -E -x c -P $(CFLAGS) -imacros ../include/windows.h $*.rc | ./winerc -o $* -v -p $* + RCSRCS = sysres.rc sysresbm.rc RCOBJS = $(RCSRCS:.rc=.o) WineRelocatableTarget($(TOP)/$(MODULE),,$(RCOBJS)) -sysres.c: winerc $(TOP)/include/windows.h +$(RCOBJS): winerc $(TOP)/include/windows.h includes:: clean:: - $(RM) sysres.c + $(RM) $(RCSRCS:.rc=.c) XCOMM Rules to build the winerc program @@ -34,7 +37,14 @@ SRCS = \ OBJS = $(SRCS:.c=.o) +#ifdef i386BsdArchitecture +#endif +#if defined(i386BsdArchitecture) || defined(i386FreeBsd) || defined(FreeBSDArchitecture) +LOCAL_LIBRARIES = -ll +#endif +#ifdef LinuxArchitecture LOCAL_LIBRARIES = -lfl +#endif depend:: rc.tab.c rc.tab.h lex.yy.c @@ -46,7 +56,7 @@ ComplexProgramTarget(winerc) rc.tab.c rc.tab.h: rc.y $(YACC) -b rc -d --debug rc.y -lex.yy.c: rc.l +lex.yy.c: rc.l rc.tab.h $(LEX) -I rc.l diff --git a/rc/sysres.rc b/rc/sysres.rc index f14e2e65eb9..8cb979132a5 100644 --- a/rc/sysres.rc +++ b/rc/sysres.rc @@ -1,3 +1,5 @@ +#if #LANG(En) + SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE { MENUITEM "&Restore", 61728 @@ -260,3 +262,8 @@ FONT 8, "Helv" PUSHBUTTON "Cancel", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP } +#endif /*LANG=En*/ + +#if #LANG(De) +#include "sysres_De.rc" +#endif diff --git a/rc/sysres.rc b/rc/sysres_De.rc similarity index 53% copy from rc/sysres.rc copy to rc/sysres_De.rc index f14e2e65eb9..9e54d4704b3 100644 --- a/rc/sysres.rc +++ b/rc/sysres_De.rc @@ -1,262 +1,262 @@ -SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE -{ - MENUITEM "&Restore", 61728 - MENUITEM "&Move", 61456 - MENUITEM "&Size", 61440 - MENUITEM "Mi&nimize", 61472 - MENUITEM "Ma&ximize", 61488 - MENUITEM SEPARATOR - MENUITEM "&Close\tAlt-F4", 61536 - MENUITEM SEPARATOR - MENUITEM "&Switch to ...\tCtrl-Esc", 61744 - MENUITEM SEPARATOR - MENUITEM "&About WINE ...", 61761 -} - - -2 DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 170 -STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME -{ - PUSHBUTTON "Credit & License", 6, 30, 150, 40, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 60, 250, 40, 14, WS_GROUP | WS_TABSTOP - DEFPUSHBUTTON "Ok", 1, 80, 150, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP -} - - -STOP_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 -STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME -{ - ICON "SYSIDI_HAND", -1, 16, 16, 0, 0 -} - - -QUESTION_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 -STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME -{ - ICON "SYSIDI_QUESTION", -1, 16, 16, 0, 0 -} - - -EXCLAMATION_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 -STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME -{ - ICON "SYSIDI_EXCLAMATION", -1, 16, 16, 0, 0 -} - - -SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 50, 44, 213, 149 -STYLE DS_LOCALEDIT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "about X" -FONT 10, "System" -{ - DEFPUSHBUTTON "OK", 1, 86, 130, 40, 14 - CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE | WS_DISABLED, 4, 35, 205, 90 - LTEXT "Text", 100, 11, 40, 190, 80, SS_NOPREFIX | WS_GROUP - ICON "WINEICON", -1, 185, 10, 18, 20 -} - - -3 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Open" -FONT 8, "Helv" -{ - LTEXT "File &Name:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP - LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "&Directories:", -1, 110, 6, 92, 9 - LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP - LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "List Files of &Type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "Dri&ves:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Open", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Read Only", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -} - - -4 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Save As ..." -FONT 8, "Helv" -{ - LTEXT "File &Name:", 1090, 6, 6, 76, 9 - EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP - LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "&Directories:", -1, 110, 6, 92, 9 - LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP - LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "List Files of &Type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "Dri&ves:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Save As", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Read Only", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -} - - -11 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Open" -FONT 8, "Helv" -{ - LTEXT "File &Name:", 1090, 6, 6, 76, 9 - LTEXT "", 1152, 6, 16, 90, 12 - LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "&Directories:", -1, 110, 6, 92, 9 - LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP - LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "List Files of &Type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "Dri&ves:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Open", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Read Only", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -} - - -12 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Save As ..." -FONT 8, "Helv" -{ - LTEXT "File &Name:", 1090, 6, 6, 76, 9 - LTEXT "", 1152, 6, 16, 90, 12 - LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "&Directories:", -1, 110, 6, 92, 9 - LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP - LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "List Files of &Type:", 1089, 6, 104, 90, 9 - COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP - LTEXT "Dri&ves:", 1091, 110, 104, 92, 9 - COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Save As", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "&Read Only", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -} - - -5 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Print" -FONT 8, "Helv" -{ - LTEXT "Printer:", 1088, 6, 6, 40, 9 - LTEXT "", 1089, 60, 6, 150, 9 - GROUPBOX "Print Range", 1072, 6, 30, 160, 65, BS_GROUPBOX - RADIOBUTTON "&All", 1056, 16, 45, 60, 12 - RADIOBUTTON "S&election", 1057, 16, 60, 60, 12 - RADIOBUTTON "&Pages", 1058, 16, 75, 60, 12 - DEFPUSHBUTTON "Print", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Setup", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP - LTEXT "&From:", 1090, 60, 80, 30, 9 - LTEXT "&To:", 1091, 120, 80, 30, 9 - LTEXT "Print &Quality:", 1092, 6, 100, 76, 9 - COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - CHECKBOX "Print to Fi&le", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Condensed", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -} - - -6 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Print Setup" -FONT 8, "Helv" -{ - GROUPBOX "Printer", 1072, 6, 10, 180, 65, BS_GROUPBOX - RADIOBUTTON "&Default Printer", 1056, 16, 20, 80, 12 - LTEXT "[none]", 1088, 35, 35, 120, 9 - RADIOBUTTON "Specific &Printer", 1057, 16, 50, 80, 12 - COMBOBOX 1136, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Setup", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP - GROUPBOX "Orientation", 1073, 6, 85, 100, 50, BS_GROUPBOX - RADIOBUTTON "Po&rtrait", 1058, 50, 100, 40, 12 - RADIOBUTTON "&Landscape", 1059, 50, 115, 40, 12 - ICON "LANDSCAP", 1097, 10, 95, 32, 32 - ICON "PORTRAIT", 1098, 10, 95, 32, 32 - GROUPBOX "Paper", 1074, 120, 85, 180, 50, BS_GROUPBOX - LTEXT "Si&ze", 1089, 130, 95, 30, 9 - LTEXT "&Source", 1090, 130, 110, 30, 9 - COMBOBOX 1137, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP - COMBOBOX 1138, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP -} - - -7 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Font" -FONT 8, "Helv" -{ - LTEXT "Font:", 1088, 6, 6, 40, 9 - LTEXT "", 1089, 60, 6, 150, 9 - DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP -} - - -8 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Color" -FONT 8, "Helv" -{ - LTEXT "&Basic Colors:", 1088, 6, 6, 40, 9 - LTEXT "&Custom Colors:", 1089, 6, 126, 40, 9 - LTEXT "Color|Sol&id", 1090, 100, 146, 40, 9 - LTEXT "&Hue:", 1091, 150, 126, 40, 9 - LTEXT "&Sat:", 1092, 150, 146, 40, 9 - LTEXT "&Lum:", 1093, 150, 166, 40, 9 - LTEXT "&Red:", 1094, 150, 126, 40, 9 - LTEXT "&Green:", 1095, 150, 146, 40, 9 - LTEXT "Bl&ue:", 1096, 150, 166, 40, 9 - DEFPUSHBUTTON "Ok", 1, 6, 182, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Add to Custom Colors", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Delete Custom Colors", 1025, 6, 164, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 76, 182, 56, 14, WS_GROUP | WS_TABSTOP -} - - -9 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Find" -FONT 8, "Helv" -{ - LTEXT "Fi&nd What:", 1088, 6, 6, 40, 9 - LTEXT "", 1089, 60, 6, 150, 9 - CHECKBOX "Match &Whole Word Only", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Match &Case", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - GROUPBOX "Direction", 1072, 90, 40, 80, 40, BS_GROUPBOX - RADIOBUTTON "&Up", 1056, 100, 50, 50, 12 - RADIOBUTTON "&Down", 1057, 150, 50, 50, 12 - DEFPUSHBUTTON "&Find Next", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP -} - - -10 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Replace" -FONT 8, "Helv" -{ - LTEXT "Fi&nd What:", 1088, 6, 6, 40, 9 - LTEXT "", 1089, 60, 6, 150, 9 - LTEXT "Re&place With:", 1090, 6, 26, 40, 9 - LTEXT "", 1091, 60, 26, 150, 9 - CHECKBOX "Match &Whole Word Only", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Match &Case", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - DEFPUSHBUTTON "&Find Next", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP - PUSHBUTTON "&Replace", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Replace &All", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP -} - +SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE +{ + MENUITEM "&Wiederherstellen", 61728 + MENUITEM "&Verschieben", 61456 + MENUITEM "&Größe", 61440 + MENUITEM "Mi&nimieren", 61472 + MENUITEM "Ma&ximieren", 61488 + MENUITEM SEPARATOR + MENUITEM "&Schließen\tAlt-F4", 61536 + MENUITEM SEPARATOR + MENUITEM "&Wechseln zu ...\tCtrl-Esc", 61744 + MENUITEM SEPARATOR + MENUITEM "&Über WINE ...", 61761 +} + + +2 DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 170 +STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME +{ + PUSHBUTTON "Kredit & Lizenz", 6, 30, 150, 40, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbruch", 2, 60, 250, 40, 14, WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Ok", 1, 80, 150, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP +} + + +STOP_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 +STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME +{ + ICON "SYSIDI_HAND", -1, 16, 16, 0, 0 +} + + +QUESTION_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 +STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME +{ + ICON "SYSIDI_QUESTION", -1, 16, 16, 0, 0 +} + + +EXCLAMATION_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 80, 80, 150, 75 +STYLE WS_POPUP | WS_VISIBLE | WS_DLGFRAME +{ + ICON "SYSIDI_EXCLAMATION", -1, 16, 16, 0, 0 +} + + +SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 50, 44, 213, 149 +STYLE DS_LOCALEDIT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Über X" +FONT 10, "System" +{ + DEFPUSHBUTTON "OK", 1, 86, 130, 40, 14 + CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE | WS_DISABLED, 4, 35, 205, 90 + LTEXT "Text", 100, 11, 40, 190, 80, SS_NOPREFIX | WS_GROUP + ICON "WINEICON", -1, 185, 10, 18, 20 +} + + +3 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Öffnen" +FONT 8, "Helv" +{ + LTEXT "Datei&name:", 1090, 6, 6, 76, 9 + EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Verzeichnisse:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "Liste der Datei&typen:", 1089, 6, 104, 90, 9 + COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Laufwerke:", 1091, 110, 104, 92, 9 + COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Öffnen", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Hilfe", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Schreibgeschützt", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +4 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Speichern als ..." +FONT 8, "Helv" +{ + LTEXT "Datei&name:", 1090, 6, 6, 76, 9 + EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Verzeichnisse:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "Liste der Datei&typen:", 1089, 6, 104, 90, 9 + COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Laufwerke:", 1091, 110, 104, 92, 9 + COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Speichern als", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Schreibgeschützt", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +11 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Öffnen" +FONT 8, "Helv" +{ + LTEXT "Datei&name:", 1090, 6, 6, 76, 9 + LTEXT "", 1152, 6, 16, 90, 12 + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Verzeichnisse:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "Liste der Datei&typen:", 1089, 6, 104, 90, 9 + COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Laufwerke:", 1091, 110, 104, 92, 9 + COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Öffnen", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Schreibgeschützt", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +12 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Speichern als ..." +FONT 8, "Helv" +{ + LTEXT "Datei&name:", 1090, 6, 6, 76, 9 + LTEXT "", 1152, 6, 16, 90, 12 + LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "&Verzeichnisse:", -1, 110, 6, 92, 9 + LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP + LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP + LTEXT "Liste der Datei&typen:", 1089, 6, 104, 90, 9 + COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP + LTEXT "&Laufwerke:", 1091, 110, 104, 92, 9 + COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Speichern als", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Help", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "&Schreibgeschützt", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +5 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Drucken" +FONT 8, "Helv" +{ + LTEXT "Drucker:", 1088, 6, 6, 40, 9 + LTEXT "", 1089, 60, 6, 150, 9 + GROUPBOX "Druckbereicht", 1072, 6, 30, 160, 65, BS_GROUPBOX + RADIOBUTTON "&Alles", 1056, 16, 45, 60, 12 + RADIOBUTTON "A&uswahl", 1057, 16, 60, 60, 12 + RADIOBUTTON "&Seiten", 1058, 16, 75, 60, 12 + DEFPUSHBUTTON "Drucken", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Einrichten", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "&Von:", 1090, 60, 80, 30, 9 + LTEXT "&Bis:", 1091, 120, 80, 30, 9 + LTEXT "Druck&qualität:", 1092, 6, 100, 76, 9 + COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + CHECKBOX "In &Datei drucken", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Verdichtet", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +} + + +6 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Druckereinrichtung" +FONT 8, "Helv" +{ + GROUPBOX "Drucker", 1072, 6, 10, 180, 65, BS_GROUPBOX + RADIOBUTTON "&Standarddrucker", 1056, 16, 20, 80, 12 + LTEXT "[keiner]", 1088, 35, 35, 120, 9 + RADIOBUTTON "Bestimmter &Drucker", 1057, 16, 50, 80, 12 + COMBOBOX 1136, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Einrichten", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP + GROUPBOX "Orientierung", 1073, 6, 85, 100, 50, BS_GROUPBOX + RADIOBUTTON "&Hochformat", 1058, 50, 100, 40, 12 + RADIOBUTTON "&Querformat", 1059, 50, 115, 40, 12 + ICON "LANDSCAP", 1097, 10, 95, 32, 32 + ICON "PORTRAIT", 1098, 10, 95, 32, 32 + GROUPBOX "Paper", 1074, 120, 85, 180, 50, BS_GROUPBOX + LTEXT "&GrÖße", 1089, 130, 95, 30, 9 + LTEXT "P&apierquelle", 1090, 130, 110, 30, 9 + COMBOBOX 1137, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP + COMBOBOX 1138, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP +} + + +7 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Font" +FONT 8, "Helv" +{ + LTEXT "Font:", 1088, 6, 6, 40, 9 + LTEXT "", 1089, 60, 6, 150, 9 + DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP +} + + +8 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Farbe" +FONT 8, "Helv" +{ + LTEXT "&Standardfarben:", 1088, 6, 6, 40, 9 + LTEXT "S&elbstdefinierte Farben:", 1089, 6, 126, 40, 9 + LTEXT "Farbe|Re&in", 1090, 100, 146, 40, 9 + LTEXT "&Ton:", 1091, 150, 126, 40, 9 + LTEXT "&Sättigung:", 1092, 150, 146, 40, 9 + LTEXT "&Helligkeit:", 1093, 150, 166, 40, 9 + LTEXT "&Rot:", 1094, 150, 126, 40, 9 + LTEXT "&Grün:", 1095, 150, 146, 40, 9 + LTEXT "Bl&au:", 1096, 150, 166, 40, 9 + DEFPUSHBUTTON "Ok", 1, 6, 182, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Selbstdefinierte Farbe &hinzufügen", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Selbstdefinierte Farbe &entfernen", 1025, 6, 164, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 76, 182, 56, 14, WS_GROUP | WS_TABSTOP +} + + +9 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Suchen" +FONT 8, "Helv" +{ + LTEXT "S&uchen nach:", 1088, 6, 6, 40, 9 + LTEXT "", 1089, 60, 6, 150, 9 + CHECKBOX "Nur ganze &Worte", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Beachte Groß/Kleinschreibung", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + GROUPBOX "Richtung", 1072, 90, 40, 80, 40, BS_GROUPBOX + RADIOBUTTON "&Hoch", 1056, 100, 50, 50, 12 + RADIOBUTTON "&Runter", 1057, 150, 50, 50, 12 + DEFPUSHBUTTON "&Nächsten finden", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP +} + + +10 DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ersetzen" +FONT 8, "Helv" +{ + LTEXT "S&uchen nach:", 1088, 6, 6, 40, 9 + LTEXT "", 1089, 60, 6, 150, 9 + LTEXT "Ersetzen &durch:", 1090, 6, 26, 40, 9 + LTEXT "", 1091, 60, 26, 150, 9 + CHECKBOX "Nur ganze &Worte", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Beachte Groß/Kleinschreibung", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "&Nächsten finden", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Ersetzen", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Alle ersetzen", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP +} + diff --git a/rc/sysresbm.rc b/rc/sysresbm.rc index f47131d451d..1165f22d64c 100644 --- a/rc/sysresbm.rc +++ b/rc/sysresbm.rc @@ -1,3 +1,4 @@ +#ifndef USE_XPM 32514 CURSOR LOADONCALL MOVEABLE DISCARDABLE { '00 00 02 00 01 00 20 20 00 00 00 00 00 00 30 01' @@ -617,20 +618,20 @@ LANDSCAP ICON LOADONCALL MOVEABLE DISCARDABLE '00 00 00 BF BF 00 BF 00 00 00 BF 00 BF 00 BF BF' '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' - '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF 00 FF 00 FF FF FF 00' - '00 00 FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF' - 'FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00 00 00' - 'FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00' - '00 00 FF FF 00 00 00 00 00 FF FF 00 00 00 FF FF' - 'F0 00 00 00 0F FF FF 00 00 00 FF FF FF 00 00 00' - 'FF FF FF 00 00 00 FF FF FF F0 00 0F FF FF FF 00' - '00 00 FF FF FF FF 00 FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00' + '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00' + '00 00 08 88 88 88 88 88 88 88 80 00 00 00 0F 88' + '88 88 88 88 88 88 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F 77 77 00 77 00 77 78 80 00' + '00 00 0F 77 77 00 00 00 77 78 80 00 00 00 0F 77' + '77 00 00 00 77 78 80 00 00 00 0F 77 77 00 00 00' + '77 78 80 00 00 00 0F 77 77 00 00 00 77 78 80 00' + '00 00 0F 77 00 00 00 00 00 78 80 00 00 00 0F 77' + '70 00 00 00 07 78 80 00 00 00 0F 77 77 00 00 00' + '77 78 80 00 00 00 0F 77 77 70 00 07 77 78 80 00' + '00 00 0F 77 77 77 00 77 77 78 80 00 00 00 0F 77' + '77 77 77 77 77 78 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F FF FF FF FF FF FF FF 80 00' + '00 00 00 00 00 00 00 00 00 00 00 00 00 00' } @@ -643,20 +644,20 @@ LANDSCAP ICON LOADONCALL MOVEABLE DISCARDABLE '00 00 00 BF BF 00 BF 00 00 00 BF 00 BF 00 BF BF' '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' - '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF 00 FF FF FF FF 00' - '00 00 FF FF FF F0 00 0F FF FF FF 00 00 00 FF FF' - 'FF 00 00 00 FF FF FF 00 00 00 FF FF F0 00 00 00' - '0F FF FF 00 00 00 FF FF 00 00 00 00 00 FF FF 00' - '00 00 FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF' - 'FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00 00 00' - 'FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00' - '00 00 FF FF FF 00 FF 00 FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00' + '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00' + '00 00 08 88 88 88 88 88 88 88 80 00 00 00 0F 88' + '88 88 88 88 88 88 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F 77 77 77 00 77 77 78 80 00' + '00 00 0F 77 77 70 00 07 77 78 80 00 00 00 0F 77' + '77 00 00 00 77 78 80 00 00 00 0F 77 70 00 00 00' + '07 78 80 00 00 00 0F 77 00 00 00 00 00 78 80 00' + '00 00 0F 77 77 00 00 00 77 78 80 00 00 00 0F 77' + '77 00 00 00 77 78 80 00 00 00 0F 77 77 00 00 00' + '77 78 80 00 00 00 0F 77 77 00 00 00 77 78 80 00' + '00 00 0F 77 77 00 77 00 77 78 80 00 00 00 0F 77' + '77 77 77 77 77 78 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F FF FF FF FF FF FF FF 80 00' + '00 00 00 00 00 00 00 00 00 00 00 00 00 00' } @@ -669,20 +670,20 @@ LANDSCAP ICON LOADONCALL MOVEABLE DISCARDABLE '00 00 00 BF BF 00 BF 00 00 00 BF 00 BF 00 BF BF' '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' - '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF F0 FF FF FF FF 00' - '00 00 FF FF FF FF F0 0F FF FF FF 00 00 00 FF FF' - '00 00 00 00 FF FF FF 00 00 00 FF FF 00 00 00 00' - '0F FF FF 00 00 00 FF FF F0 00 00 00 00 FF FF 00' - '00 00 FF FF F0 00 00 00 00 FF FF 00 00 00 FF FF' - '00 00 00 00 0F FF FF 00 00 00 FF FF 00 00 00 00' - 'FF FF FF 00 00 00 FF FF FF FF F0 0F FF FF FF 00' - '00 00 FF FF FF FF F0 FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00' + '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00' + '00 00 08 88 88 88 88 88 88 88 80 00 00 00 0F 87' + '77 77 77 77 77 78 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F 77 77 77 70 77 77 78 80 00' + '00 00 0F 77 77 77 70 07 77 78 80 00 00 00 0F 77' + '00 00 00 00 77 78 80 00 00 00 0F 77 00 00 00 00' + '07 78 80 00 00 00 0F 77 70 00 00 00 00 78 80 00' + '00 00 0F 77 70 00 00 00 00 78 80 00 00 00 0F 77' + '00 00 00 00 07 78 80 00 00 00 0F 77 00 00 00 00' + '77 78 80 00 00 00 0F 77 77 77 70 07 77 78 80 00' + '00 00 0F 77 77 77 70 77 77 78 80 00 00 00 0F 77' + '77 77 77 77 77 78 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F FF FF FF FF FF FF FF 80 00' + '00 00 00 00 00 00 00 00 00 00 00 00 00 00' } @@ -695,20 +696,20 @@ LANDSCAP ICON LOADONCALL MOVEABLE DISCARDABLE '00 00 00 BF BF 00 BF 00 00 00 BF 00 BF 00 BF BF' '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' - '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF F0 FF FF FF FF FF 00' - '00 00 FF FF FF 00 FF FF FF FF FF 00 00 00 FF FF' - 'F0 00 00 00 00 FF FF 00 00 00 FF FF 00 00 00 00' - '00 FF FF 00 00 00 FF F0 00 00 00 00 0F FF FF 00' - '00 00 FF F0 00 00 00 00 0F FF FF 00 00 00 FF FF' - '00 00 00 00 00 FF FF 00 00 00 FF FF F0 00 00 00' - '00 FF FF 00 00 00 FF FF FF 00 FF FF FF FF FF 00' - '00 00 FF FF FF F0 FF FF FF FF FF 00 00 00 FF FF' - 'FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF' - 'FF FF FF 00 00 00 FF FF FF FF FF FF FF FF FF 00' - '00 00 FF FF FF FF FF FF FF FF FF 00 00 00' + '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00' + '00 00 08 88 88 88 88 88 88 88 80 00 00 00 0F 88' + '88 88 88 88 88 88 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F 77 77 70 77 77 77 78 80 00' + '00 00 0F 77 77 00 77 77 77 78 80 00 00 00 0F 77' + '70 00 00 00 00 78 80 00 00 00 0F 77 00 00 00 00' + '00 78 80 00 00 00 0F 70 00 00 00 00 07 78 80 00' + '00 00 0F 70 00 00 00 00 07 78 80 00 00 00 0F 77' + '00 00 00 00 00 78 80 00 00 00 0F 77 70 00 00 00' + '00 78 80 00 00 00 0F 77 77 00 77 77 77 78 80 00' + '00 00 0F 77 77 70 77 77 77 78 80 00 00 00 0F 77' + '77 77 77 77 77 78 80 00 00 00 0F 77 77 77 77 77' + '77 78 80 00 00 00 0F FF FF FF FF FF FF FF 80 00' + '00 00 00 00 00 00 00 00 00 00 00 00 00 00' } @@ -1848,4 +1849,4 @@ OBMCLOSE BITMAP LOADONCALL MOVEABLE 'FF FF FF FF FF FF FF 80 00 00 00 00 00 00 00 00' '00 00 00 00 00 00' } - +#endif diff --git a/rc/winerc.c b/rc/winerc.c index aa7911a9ba5..b20ca32e6eb 100644 --- a/rc/winerc.c +++ b/rc/winerc.c @@ -31,7 +31,7 @@ main(int argc,char *argv[]) extern char* optarg; int optc,lose,ret; lose=0; -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__FreeBSD__) while((optc=getopt(argc,argv,"dp:vo:"))!=EOF) #else while((optc=getopt(argc,argv,"dp:vo:",0))!=EOF) diff --git a/tools/make_debug b/tools/make_debug dissimilarity index 82% index 1d0ee5ae303..e7d5460e305 100755 --- a/tools/make_debug +++ b/tools/make_debug @@ -1,120 +1,161 @@ -#!/bin/sh -# -# This script scans the whole source code for symbols of the form dprintf_xxx, -# generates the necessary macro definitions and puts them into the files -# include/stddebug.h and include/debug.h . This script must be started with -# cwd = rootdir of the Wine-distribution. -# -# Michael Patra -# -makedepend -s"# /* Do not remove this line or change anything below this line */" -finclude/debug.h -echo " " >> include/debug.h -grep -h dprintf_ */*.c | tr -d '[:blank:]' | cut -d"(" -f1 | \ - cut -d"_" -f2 | sort | uniq > temp.$$ -echo " " >> include/debug.h -echo "#ifdef DEBUG_NONE_EXT" >> include/debug.h -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#undef DEBUG_$y" >> include/debug.h -done -} -echo "#endif" >> include/debug.h -echo " " >> include/debug.h -echo " " >> include/debug.h -echo "#ifdef DEBUG_ALL_EXT" >> include/debug.h -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#define DEBUG_$y" >> include/debug.h -done -} -echo "#endif" >> include/debug.h -echo " " >> include/debug.h -echo " " >> include/debug.h -echo "#ifdef DEBUG_RUNTIME" >> include/debug.h -echo "#ifdef DEBUG_DEFINE_VARIABLES" >> include/debug.h -echo "short debug_msg_enabled[]={" >> include/debug.h -i=0; -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#ifdef DEBUG_$y" >> include/debug.h - echo "1," >> include/debug.h - echo "#else" >> include/debug.h - echo "0," >> include/debug.h - echo "#endif" >> include/debug.h -done -} -echo "0};" >> include/debug.h -echo "#else" >> include/debug.h -echo "extern short debug_msg_enabled[];" >> include/debug.h -echo "#endif" >> include/debug.h -echo "#endif" >> include/debug.h -echo " " >> include/debug.h -echo " " >> include/debug.h -i=0 -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#ifdef DEBUG_RUNTIME" >> include/debug.h - echo "#define dprintf_$x if(debug_msg_enabled[$i]) fprintf" >> include/debug.h - echo "#else" >> include/debug.h - echo "#ifdef DEBUG_$y" >> include/debug.h - echo "#define dprintf_$x fprintf" >> include/debug.h - echo "#else" >> include/debug.h - echo "#define dprintf_$x" >> include/debug.h - echo "#endif" >> include/debug.h - echo "#endif" >> include/debug.h - echo " " >> include/debug.h - let i=$i+1 -done -} -makedepend -s"# /* Do not remove this line or change anything below this line */" -finclude/stddebug.h -echo " " >> include/stddebug.h -echo "#ifdef DEBUG_NONE" >> include/stddebug.h -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#undef DEBUG_$y" >> include/stddebug.h -done -} -echo "#endif" >> include/stddebug.h -echo " " >> include/stddebug.h -echo " " >> include/stddebug.h -echo "#ifdef DEBUG_ALL" >> include/stddebug.h -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - echo "#define DEBUG_$y" >> include/stddebug.h -done -} -echo "#endif" >> include/stddebug.h -echo " " >> include/debug.h -echo " " >> include/debug.h -echo "#ifdef DEBUG_RUNTIME" >> include/debug.h -echo "#ifdef DEBUG_DEFINE_VARIABLES" >> include/debug.h -echo "static char *debug_msg_name[] = {" >> include/debug.h -cat temp.$$ | -{ -while read x -do - echo "\"$x\"," >> include/debug.h -done -} -echo "\"\"};" >> include/debug.h -echo "#endif" >> include/debug.h -echo "#endif" >> include/debug.h -rm temp.$$ +#!/bin/sh +# +# This script scans the whole source code for symbols of the form dprintf_xxx, +# generates the necessary macro definitions and puts them into the files +# include/stddebug.h and include/debug.h . This script must be started with +# cwd = rootdir of the Wine-distribution. +# +# Michael Patra +# +DEBUG_H=include/debug.h +STDDEBUG_H=include/stddebug.h + +mv $DEBUG_H $DEBUG_H.old +mv $STDDEBUG_H $STDDEBUG_H.old + +# Build the list of debug identifiers +grep -h dprintf_ */*.c | sed 's/.*dprintf_\([A-Za-z0-9_]*\).*/\1/g' | \ + sort | uniq > temp.$$ + +# Build debug.h + +sed '/^\/\* Do not remove this line or change anything below this line \*\//q'\ + <$DEBUG_H.old >$DEBUG_H +cat <<++EOF++ >> $DEBUG_H + +#ifdef DEBUG_NONE_EXT +++EOF++ + +cat temp.$$ | tr a-z A-Z | +{ +while read x +do + echo "#undef DEBUG_$x" >> $DEBUG_H +done +} + +cat <<++EOF++ >>$DEBUG_H +#endif + +#ifdef DEBUG_ALL_EXT +++EOF++ + +cat temp.$$ | tr a-z A-Z | +{ +while read x +do + echo "#define DEBUG_$x" >> $DEBUG_H +done +} + +cat <<++EOF++ >>$DEBUG_H +#endif + +#ifdef DEBUG_RUNTIME +#ifdef DEBUG_DEFINE_VARIABLES +short debug_msg_enabled[]={ +++EOF++ + +cat temp.$$ | tr a-z A-Z | +{ +while read x +do + cat <<++EOF++ >>$DEBUG_H +#ifdef DEBUG_$x + 1, +#else + 0, +#endif +++EOF++ + +done +} + +cat <<++EOF++ >>$DEBUG_H + 0 +}; +#else +extern short debug_msg_enabled[]; +#endif +#endif + +++EOF++ + +i=0 +cat temp.$$ | +{ +while read x +do + y=`echo $x | tr a-z A-Z` + cat <<++EOF++ >>$DEBUG_H +#ifdef DEBUG_RUNTIME +#define dprintf_$x if(debug_msg_enabled[$i]) fprintf +#else +#ifdef DEBUG_$y +#define dprintf_$x fprintf +#else +#define dprintf_$x +#endif +#endif + +++EOF++ + let i=$i+1 +done +} + +cat <<++EOF++ >>$DEBUG_H + +#ifdef DEBUG_RUNTIME +#ifdef DEBUG_DEFINE_VARIABLES +static char *debug_msg_name[] = { +++EOF++ + +cat temp.$$ | +{ +while read x +do + echo " \"$x\"," >> $DEBUG_H +done +} + +cat <<++EOF++ >>$DEBUG_H + "" +}; +#endif +#endif +++EOF++ + +# Build stddebug.h + +sed '/^\/\* Do not remove this line or change anything below this line \*\//q'\ + <$STDDEBUG_H.old >$STDDEBUG_H + +cat <<++EOF++ >>$STDDEBUG_H + +#ifdef DEBUG_NONE +++EOF++ + +cat temp.$$ | tr a-z A-Z | +{ +while read x +do + echo "#undef DEBUG_$x" >> $STDDEBUG_H +done +} + +cat <<++EOF++ >>$STDDEBUG_H +#endif + +#ifdef DEBUG_ALL +++EOF++ + +cat temp.$$ | tr a-z A-Z | +{ +while read x +do + echo "#define DEBUG_$x" >> $STDDEBUG_H +done +} +echo "#endif" >> $STDDEBUG_H + +rm temp.$$ $DEBUG_H.old $STDDEBUG_H.old diff --git a/windows/defwnd.c b/windows/defwnd.c index 2022e635a95..a23d764127d 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -14,8 +14,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; #include "user.h" #include "syscolor.h" #include "stddebug.h" -/* #define DEBUG_MESSAGE /* */ -/* #undef DEBUG_MESSAGE /* */ +/* #define DEBUG_MESSAGE */ +/* #undef DEBUG_MESSAGE */ #include "debug.h" @@ -62,7 +62,7 @@ LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam ) int len; WND * wndPtr = WIN_FindWndPtr( hwnd ); - dprintf_message(stddeb, "DefWindowProc: %d %d %d %08x\n", + dprintf_message(stddeb, "DefWindowProc: %d %d %d %08lx\n", hwnd, msg, wParam, lParam ); switch(msg) @@ -72,8 +72,6 @@ LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam ) CREATESTRUCT * createStruct = (CREATESTRUCT *)lParam; if (createStruct->lpszName) DEFWND_SetText( hwnd, createStruct->lpszName ); - if ((createStruct->style & WS_VSCROLL) || - (createStruct->style & WS_HSCROLL)) NC_CreateScrollBars(hwnd); return 1; } @@ -99,9 +97,9 @@ LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam ) case WM_NCDESTROY: if (wndPtr->hText) USER_HEAP_FREE(wndPtr->hText); - wndPtr->hText = 0; - if (wndPtr->VScroll) free(wndPtr->VScroll); - if (wndPtr->HScroll) free(wndPtr->HScroll); + if (wndPtr->hVScroll) USER_HEAP_FREE(wndPtr->hVScroll); + if (wndPtr->hHScroll) USER_HEAP_FREE(wndPtr->hHScroll); + wndPtr->hText = wndPtr->hVScroll = wndPtr->hHScroll = 0; return 0; case WM_PAINT: diff --git a/windows/dialog.c b/windows/dialog.c index 6f8a3a32803..c5c10967234 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -356,6 +356,11 @@ HWND CreateDialogIndirectParam( HINSTANCE hInst, LPCSTR dlgTemplate, header->cx * xUnit / 4, header->cy * yUnit / 8, hwnd, header->id, hInst, NULL ); } + /* Make the control last one in Z-order, so that controls remain + in the order in which they were created */ + SetWindowPos( hwndCtrl, HWND_BOTTOM, 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); + /* Send initialisation messages to the control */ if (hFont) SendMessage( hwndCtrl, WM_SETFONT, hFont, 0 ); if (SendMessage( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON) @@ -449,7 +454,7 @@ int DialogBoxParam( HINSTANCE hInst, LPCSTR dlgTemplate, { HWND hwnd; - dprintf_dialog(stddeb, "DialogBoxParam: %d,'%x',%d,%p,%d\n", + dprintf_dialog(stddeb, "DialogBoxParam: %d,'%p',%d,%p,%ld\n", hInst, dlgTemplate, owner, dlgProc, param ); hwnd = CreateDialogParam( hInst, dlgTemplate, owner, dlgProc, param ); if (hwnd) return DIALOG_DoDialogBox( hwnd, owner ); @@ -554,7 +559,7 @@ BOOL IsDialogMessage( HWND hwndDlg, LPMSG msg ) if (!(dlgCode & DLGC_WANTTAB)) { SendMessage( hwndDlg, WM_NEXTDLGCTL, - !(GetKeyState(VK_SHIFT) & 0x80), 0 ); + (GetKeyState(VK_SHIFT) & 0x80), 0 ); return TRUE; } break; @@ -563,7 +568,7 @@ BOOL IsDialogMessage( HWND hwndDlg, LPMSG msg ) case VK_DOWN: if (!(dlgCode & DLGC_WANTARROWS)) { - SetFocus(GetNextDlgGroupItem(hwndDlg,GetFocus(),TRUE)); + SetFocus(GetNextDlgGroupItem(hwndDlg,GetFocus(),FALSE)); return TRUE; } break; @@ -572,7 +577,7 @@ BOOL IsDialogMessage( HWND hwndDlg, LPMSG msg ) case VK_UP: if (!(dlgCode & DLGC_WANTARROWS)) { - SetFocus(GetNextDlgGroupItem(hwndDlg,GetFocus(),FALSE)); + SetFocus(GetNextDlgGroupItem(hwndDlg,GetFocus(),TRUE)); return TRUE; } break; @@ -752,13 +757,24 @@ WORD IsDlgButtonChecked( HWND hwnd, WORD id ) */ void CheckRadioButton( HWND hwndDlg, WORD firstID, WORD lastID, WORD checkID ) { - HWND button = GetDlgItem( hwndDlg, lastID ); - while (button != 0) + HWND button = GetWindow( hwndDlg, GW_CHILD ); + WND *wndPtr; + + while (button) + { + if (!(wndPtr = WIN_FindWndPtr( button ))) return; + if ((wndPtr->wIDmenu == firstID) || (wndPtr->wIDmenu == lastID)) break; + button = wndPtr->hwndNext; + } + if (!button) return; + + if (wndPtr->wIDmenu == lastID) + lastID = firstID; /* Buttons are in reverse order */ + while (button) { - WND * wndPtr = WIN_FindWndPtr( button ); - if (!wndPtr) break; + if (!(wndPtr = WIN_FindWndPtr( button ))) return; SendMessage( button, BM_SETCHECK, (wndPtr->wIDmenu == checkID), 0 ); - if (wndPtr->wIDmenu == firstID) break; + if (wndPtr->wIDmenu == lastID) break; button = wndPtr->hwndNext; } } @@ -823,8 +839,7 @@ HWND GetNextDlgGroupItem( HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious ) /* Now we will have to find the start of the group */ - hwndStart = 0; - hwnd = dlgPtr->hwndChild; + hwndStart = hwnd = dlgPtr->hwndChild; while (hwnd) { wndPtr = WIN_FindWndPtr( hwnd ); diff --git a/windows/graphics.c b/windows/graphics.c index 27ea3095add..c052efe85a1 100644 --- a/windows/graphics.c +++ b/windows/graphics.c @@ -652,14 +652,15 @@ BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest, /********************************************************************** * GRAPH_DrawReliefRect (Not a MSWin Call) */ -void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int thickness, BOOL pressed ) +void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size, + int shadow_size, BOOL pressed ) { HBRUSH hbrushOld; int i; hbrushOld = SelectObject( hdc, pressed ? sysColorObjects.hbrushBtnShadow : sysColorObjects.hbrushBtnHighlight ); - for (i = 0; i < thickness; i++) + for (i = 0; i < highlight_size; i++) { PatBlt( hdc, rect->left + i, rect->top, 1, rect->bottom - rect->top - i, PATCOPY ); @@ -669,7 +670,7 @@ void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int thickness, BOOL pressed ) SelectObject( hdc, pressed ? sysColorObjects.hbrushBtnHighlight : sysColorObjects.hbrushBtnShadow ); - for (i = 0; i < thickness; i++) + for (i = 0; i < shadow_size; i++) { PatBlt( hdc, rect->right - i - 1, rect->top + i, 1, rect->bottom - rect->top - i, PATCOPY ); @@ -882,7 +883,7 @@ BOOL ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, WORD fillType ) XImage *image; DC *dc; - dprintf_graphics( stddeb, "ExtFloodFill %x %d,%d %06x %d\n", + dprintf_graphics( stddeb, "ExtFloodFill %x %d,%d %06lx %d\n", hdc, x, y, color, fillType ); dc = (DC *) GDI_GetObjPtr(hdc, DC_MAGIC); if (!dc) diff --git a/windows/message.c b/windows/message.c index 6a6f90ae597..304a8f93686 100644 --- a/windows/message.c +++ b/windows/message.c @@ -21,8 +21,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994"; #include "sysmetrics.h" #include "hook.h" #include "stddebug.h" -/* #define DEBUG_MSG /* */ -/* #undef DEBUG_MSG /* */ +/* #define DEBUG_MSG */ +/* #undef DEBUG_MSG */ #include "debug.h" @@ -240,8 +240,8 @@ static BOOL MSG_TranslateMouseMsg( MSG *msg, BOOL remove ) MAKELONG( msg->pt.x, msg->pt.y ) ); while ((hittest_result == HTTRANSPARENT) && (msg->hwnd)) { - msg->hwnd = GetParent(msg->hwnd); - if (!msg->hwnd) + msg->hwnd = WINPOS_NextWindowFromPoint( msg->hwnd, msg->pt ); + if (msg->hwnd) hittest_result = SendMessage( msg->hwnd, WM_NCHITTEST, 0, MAKELONG( msg->pt.x, msg->pt.y ) ); } @@ -934,7 +934,7 @@ LONG DispatchMessage( LPMSG msg ) LONG retval; int painting; - dprintf_msg(stddeb, "Dispatch message hwnd=%08x msg=0x%x w=%d l=%d time=%u pt=%d,%d\n", + dprintf_msg(stddeb, "Dispatch message hwnd=%04x msg=0x%x w=%d l=%ld time=%lu pt=%d,%d\n", msg->hwnd, msg->message, msg->wParam, msg->lParam, msg->time, msg->pt.x, msg->pt.y ); diff --git a/windows/nonclient.c b/windows/nonclient.c index 77eda75d62b..929c1f1e08e 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -9,12 +9,13 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994"; #include "win.h" #include "class.h" #include "message.h" +#include "scroll.h" #include "sysmetrics.h" #include "user.h" #include "syscolor.h" #include "stddebug.h" -/* #define DEBUG_NONCLIENT /* */ -/* #undef DEBUG_NONCLIENT /* */ +/* #define DEBUG_NONCLIENT */ +/* #undef DEBUG_NONCLIENT */ #include "debug.h" @@ -40,7 +41,9 @@ extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth, extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt ); /* menu.c */ extern void MENU_TrackKbdMenuBar( HWND hwnd, WORD wParam ); /* menu.c */ extern WORD MENU_DrawMenuBar( HDC hDC, LPRECT lprect, - HWND hwnd, BOOL suppress_draw ); /* menu.c */ + HWND hwnd, BOOL suppress_draw ); /* menu.c */ +extern void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, + WORD msg, POINT pt); /* scroll.c */ /* Some useful macros */ @@ -545,7 +548,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint ) { HDC hdc; - RECT rect, rect2; + RECT rect; WND *wndPtr = WIN_FindWndPtr( hwnd ); @@ -631,33 +634,19 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint ) rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint ); } - if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) { - if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->VScroll != NULL) && - (wndPtr->scroll_flags & 0x0001)) { - int bottom = rect.bottom; - if ((wndPtr->dwStyle & WS_HSCROLL) && (wndPtr->scroll_flags & 0x0001)) - bottom -= SYSMETRICS_CYHSCROLL; - SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL, - rect.top, rect.right+1, bottom+1); - StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, wndPtr->VScroll); - } - if ((wndPtr->dwStyle & WS_HSCROLL) && wndPtr->HScroll != NULL && - (wndPtr->scroll_flags & 0x0002)) { - int right = rect.right; - if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->scroll_flags & 0x0001)) - right -= SYSMETRICS_CYVSCROLL; - SetRect(&rect2, rect.left-1, rect.bottom - SYSMETRICS_CYHSCROLL, - right+1, rect.bottom+1); - StdDrawScrollBar(hwnd, hdc, SB_HORZ, &rect2, wndPtr->HScroll); - } + /* Draw the scroll-bars */ - if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->dwStyle & WS_HSCROLL) && - (wndPtr->scroll_flags & 0x0003) == 0x0003) { - RECT r = rect; - r.left = r.right - SYSMETRICS_CXVSCROLL + 1; - r.top = r.bottom - SYSMETRICS_CYHSCROLL + 1; - FillRect( hdc, &r, sysColorObjects.hbrushScrollbar ); - } + if (wndPtr->dwStyle & WS_VSCROLL) SCROLL_DrawScrollBar(hwnd, hdc, SB_VERT); + if (wndPtr->dwStyle & WS_HSCROLL) SCROLL_DrawScrollBar(hwnd, hdc, SB_HORZ); + + /* Draw the "size-box" */ + + if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->dwStyle & WS_HSCROLL)) + { + RECT r = rect; + r.left = r.right - SYSMETRICS_CXVSCROLL + 1; + r.top = r.bottom - SYSMETRICS_CYHSCROLL + 1; + FillRect( hdc, &r, sysColorObjects.hbrushScrollbar ); } ReleaseDC( hwnd, hdc ); @@ -1041,8 +1030,10 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) */ static void NC_TrackScrollBar( HWND hwnd, WORD wParam, POINT pt ) { - MSG msg; - WORD scrollbar; + MSG msg; + WORD scrollbar; + WND *wndPtr = WIN_FindWndPtr( hwnd ); + if ((wParam & 0xfff0) == SC_HSCROLL) { if ((wParam & 0x0f) != HTHSCROLL) return; @@ -1054,25 +1045,35 @@ static void NC_TrackScrollBar( HWND hwnd, WORD wParam, POINT pt ) scrollbar = SB_VERT; } - ScreenToClient( hwnd, &pt ); - ScrollBarButtonDown( hwnd, scrollbar, pt.x, pt.y ); + pt.x -= wndPtr->rectWindow.left; + pt.y -= wndPtr->rectWindow.top; SetCapture( hwnd ); + SCROLL_HandleScrollEvent( hwnd, scrollbar, WM_LBUTTONDOWN, pt ); do { - MSG_GetHardwareMessage( &msg ); - ScreenToClient( hwnd, &msg.pt ); + GetMessage( &msg, 0, 0, 0 ); switch(msg.message) { case WM_LBUTTONUP: - ScrollBarButtonUp( hwnd, scrollbar, msg.pt.x, msg.pt.y ); - break; case WM_MOUSEMOVE: - ScrollBarMouseMove(hwnd, scrollbar, msg.wParam, msg.pt.x,msg.pt.y); + case WM_SYSTIMER: + pt = MAKEPOINT(msg.lParam); + pt.x += wndPtr->rectClient.left - wndPtr->rectWindow.left; + pt.y += wndPtr->rectClient.top - wndPtr->rectWindow.top; + SCROLL_HandleScrollEvent( hwnd, scrollbar, msg.message, pt ); break; + default: + TranslateMessage( &msg ); + DispatchMessage( &msg ); + break; } + if (!IsWindow( hwnd )) + { + ReleaseCapture(); + break; + } } while (msg.message != WM_LBUTTONUP); - ReleaseCapture(); } /*********************************************************************** @@ -1234,7 +1235,6 @@ LONG NC_HandleSysCommand( HWND hwnd, WORD wParam, POINT pt ) case SC_VSCROLL: case SC_HSCROLL: - if (wndPtr->dwStyle & WS_CHILD) ClientToScreen(wndPtr->hwndParent, &pt); NC_TrackScrollBar( hwnd, wParam, pt ); break; diff --git a/windows/painting.c b/windows/painting.c index f1ffd3fad1b..0076881a902 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -6,6 +6,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; +#include #include #include "win.h" @@ -29,16 +30,21 @@ HDC BeginPaint( HWND hwnd, LPPAINTSTRUCT lps ) if (!hrgnUpdate) /* Create an empty region */ if (!(hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 ))) return 0; - if (!(lps->hdc = GetDCEx( hwnd, hrgnUpdate, - DCX_INTERSECTRGN | DCX_USESTYLE ))) return 0; - GetRgnBox( InquireVisRgn(lps->hdc), &lps->rcPaint ); - if (wndPtr->hrgnUpdate || (wndPtr->flags & WIN_INTERNAL_PAINT)) MSG_DecPaintCount( wndPtr->hmemTaskQ ); wndPtr->hrgnUpdate = 0; wndPtr->flags &= ~(WIN_NEEDS_BEGINPAINT | WIN_INTERNAL_PAINT); + if (!(lps->hdc = GetDCEx( hwnd, hrgnUpdate, + DCX_INTERSECTRGN | DCX_USESTYLE ))) + { + fprintf( stderr, "GetDCEx() failed in BeginPaint(), hwnd=%d\n", hwnd ); + DeleteObject( hrgnUpdate ); + return 0; + } + GetRgnBox( InquireVisRgn(lps->hdc), &lps->rcPaint ); + SendMessage( hwnd, WM_NCPAINT, hrgnUpdate, 0 ); DeleteObject( hrgnUpdate ); diff --git a/windows/win.c b/windows/win.c index 9d6bd2e7570..142e2794a79 100644 --- a/windows/win.c +++ b/windows/win.c @@ -199,6 +199,7 @@ static void WIN_DestroyWindow( HWND hwnd ) CLASS *classPtr = CLASS_FindClassPtr( wndPtr->hClass ); if (!wndPtr || !classPtr) return; + WIN_UnlinkWindow( hwnd ); /* Remove the window from the linked list */ wndPtr->dwMagic = 0; /* Mark it as invalid */ if ((wndPtr->hrgnUpdate) || (wndPtr->flags & WIN_INTERNAL_PAINT)) { @@ -260,9 +261,8 @@ BOOL WIN_CreateDesktopWindow() wndPtr->dwStyle = WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; wndPtr->dwExStyle = 0; wndPtr->hdce = 0; - wndPtr->VScroll = NULL; - wndPtr->HScroll = NULL; - wndPtr->scroll_flags = 0; + wndPtr->hVScroll = 0; + wndPtr->hHScroll = 0; wndPtr->wIDmenu = 0; wndPtr->hText = 0; wndPtr->flags = 0; @@ -380,15 +380,14 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName, wndPtr->lpfnWndProc = classPtr->wc.lpfnWndProc; wndPtr->dwStyle = style; wndPtr->dwExStyle = exStyle; - wndPtr->wIDmenu = 0; + wndPtr->wIDmenu = 0; wndPtr->hText = 0; wndPtr->flags = 0; - wndPtr->VScroll = NULL; - wndPtr->HScroll = NULL; - wndPtr->scroll_flags = 0; + wndPtr->hVScroll = 0; + wndPtr->hHScroll = 0; wndPtr->hSysMenu = 0; - wndPtr->hProp = 0; - wndPtr->hTask = 0; + wndPtr->hProp = 0; + wndPtr->hTask = 0; if (classPtr->wc.cbWndExtra) memset( wndPtr->wExtra, 0, classPtr->wc.cbWndExtra ); @@ -556,9 +555,6 @@ BOOL DestroyWindow( HWND hwnd ) /* Remove the window from current task windows list */ RemoveWindowFromTask(GetCurrentTask(), hwnd); - /* Remove the window from the linked list */ - WIN_UnlinkWindow( hwnd ); - /* Destroy the window */ WIN_DestroyWindow( hwnd ); diff --git a/windows/winpos.c b/windows/winpos.c index 7d1c574af64..80d3badd569 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -102,7 +102,6 @@ HWND WindowFromPoint( POINT pt ) return hwndRet; } - /******************************************************************* * ChildWindowFromPoint (USER.191) */ @@ -400,6 +399,32 @@ BOOL SetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl ) /******************************************************************* + * WINPOS_NextWindowFromPoint + * + * Looks for next enabled window that is + * a) sibling of hwnd, later in Z-order and encloses pt, or + * b) parent of hwnd + */ +HWND WINPOS_NextWindowFromPoint( HWND hwnd, POINT pt ) +{ + WND *wndPtr = WIN_FindWndPtr( hwnd ); + + if (!wndPtr->hwndParent) return hwnd; /* desktop window */ + ScreenToClient( wndPtr->hwndParent, &pt ); /* make pt relative to parent */ + for (;;) + { + if (!wndPtr->hwndNext) break; /* No more children */ + hwnd = wndPtr->hwndNext; + wndPtr = WIN_FindWndPtr( hwnd ); + if ((wndPtr->dwStyle & WS_VISIBLE) && + !(wndPtr->dwStyle & WS_DISABLED) && + PtInRect( &wndPtr->rectWindow, pt )) return hwnd; + } + return wndPtr->hwndParent; +} + + +/******************************************************************* * WINPOS_GetMinMaxInfo * * Send a WM_GETMINMAXINFO to the window. -- 2.11.4.GIT