Commit ecc3712d authored by Alexandre Julliard's avatar Alexandre Julliard

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 <erik@xs4all.nl> * [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.
parent 3ed37e08
----------------------------------------------------------------------
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 <erik@xs4all.nl>
* [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)
......
......@@ -175,6 +175,9 @@ else
fi
fi
prompt "Language (En/De)" LANG En
ALLDEFINES="$ALLDEFINES -ALANG\($LANG\)"
NEWBUILD=''
if [ "`(domainname)`" = 'amscons.com' ]
then
......
......@@ -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
/* 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.
......@@ -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
*/
......
......@@ -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:
......
......@@ -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) );
......
......@@ -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)
......
......@@ -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 )
......
......@@ -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" },
......
#include <stdio.h>
#include <stdlib.h>
#define N_BP 25
......
......@@ -5,6 +5,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include "opcodes/dis-asm.h"
#include "regpos.h"
......
......@@ -4,6 +4,7 @@
*/
#include "editline.h"
#include <ctype.h>
#include <stdlib.h>
/*
** Manifest constants.
......
......@@ -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);
......
......@@ -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
......
/* XPM */
static char * obm_btncorners[] = {
"30 10 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" .... ",
" .... ...... ",
......
/* XPM */
static char * obm_btsize[] = {
"15 15 2 1",
" c black",
". c white",
" s black c black",
". s white c white",
" ",
" ....... ..... ",
" ....... ..... ",
......
/* XPM */
static char * obm_check[] = {
"14 14 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" . ",
" . ",
......
/* XPM */
static char * obm_checkboxes[] = {
"56 39 2 1",
" c black",
". c white",
" . . . .",
" ........... . ......... . . .",
" ........... . . ....... . . ......... . ....... .",
" ........... . .. ..... .. . ......... . . ..... . .",
" ........... . ... ... ... . ......... . .. ... .. .",
" ........... . .... . .... . ......... . ... . ... .",
" ........... . ..... ..... . ......... . .... .... .",
" ........... . .... . .... . ......... . ... . ... .",
" ........... . ... ... ... . ......... . .. ... .. .",
" ........... . .. ..... .. . ......... . . ..... . .",
" ........... . . ....... . . ......... . ....... .",
" ........... . ......... . . .",
" . . . .",
"..... ........... ........... ........... ......",
"... ... ....... ... ....... ....... ....",
".. ....... ..... ....... ..... ... ..... ... ...",
". ......... ... ... ... ... ....... ... . . ..",
". ......... ... .. .. ... ....... ... . . ..",
" ........... . .. .. . ......... . . . .",
" ........... . .. .. . ......... . . . .",
" ........... . .. .. . ......... . . . .",
". ......... ... .. .. ... ....... ... . . ..",
". ......... ... ... ... ... ....... ... . . ..",
".. ....... ..... ....... ..... ... ..... ... ...",
"... ... ....... ... ....... ....... ....",
"..... ........... ........... ........... ......",
".............. ............... .",
".............. . . . . . . ............... .",
".............. . . . . . ............... . . . . . .",
".............. . . . . . . ............... . . . . .",
".............. . . . . . ............... . . . . . .",
".............. . . . . . . ............... . . . . .",
".............. . . . . . ............... . . . . . .",
".............. . . . . . . ............... . . . . .",
".............. . . . . . ............... . . . . . .",
".............. . . . . . . ............... . . . . .",
".............. . . . . . ............... . . . . . .",
".............. . . . . . . ............... .",
".............. ............... ."};
" s white c white",
". s black c black",
"............. ............. ............. ............. ",
". . .. .. ............. ............. ",
". . . . . . .. .. ... ... ",
". . . . . . .. .. .. . . .. ",
". . . . . . .. .. .. . . .. ",
". . . . . . .. .. .. . . .. ",
". . . . . .. .. .. . .. ",
". . . . . . .. .. .. . . .. ",
". . . . . . .. .. .. . . .. ",
". . . . . . .. .. .. . . .. ",
". . . . . . .. .. ... ... ",
". . .. .. ............. ............. ",
"............. ............. ............. ............. ",
" ... ... ... ... ",
" .. .. .. .. ....... ....... ",
" . . . . ... ... ... ... ",
" . . . ... . .. .. ... ... ... ",
" . . . ..... . .. .. .. ..... .. ",
". . . ....... . .. .. .. ....... .. ",
". . . ....... . .. .. .. ....... .. ",
". . . ....... . .. .. .. ....... .. ",
" . . . ..... . .. .. .. ..... .. ",
" . . . ... . .. .. ... ... ... ",
" . . . . ... ... ... ... ",
" .. .. .. .. ....... ....... ",
" ... ... ... ... ",
" ............. ............. ",
" . . . . . . . ............. ",
" .. . . . . .. .. . . . . .. ",
" . . . . . . . ... . . . ... ",
" .. . . . . .. .. . . . . .. ",
" . . . . . . . ... . . . ... ",
" .. . . . . .. .. . . . . .. ",
" . . . . . . . ... . . . ... ",
" .. . . . . .. .. . . . . .. ",
" . . . . . . . ... . . . ... ",
" .. . . . . .. .. . . . . .. ",
" . . . . . . . ............. ",
" ............. ............. "};
......@@ -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",
" ",
" ",
......
/* XPM */
static char * obm_combo[] = {
"7 9 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ... ",
" ... ",
" ... ",
......
/* XPM */
static char * obm_mnarrow[] = {
"7 11 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" . ",
" .. ",
......
/* XPM */
static char * obm_old_close[] = {
"50 19 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" ",
" ",
......
/* 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",
" ",
" ",
" ",
......
/* 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",
" ",
" ",
" ",
......
/* XPM */
static char * obm_old_reduce[] = {
"25 19 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" ",
" ",
......
/* XPM */
static char * obm_old_restore[] = {
"25 19 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" ",
" ..... . ",
......
/* 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",
" ",
" ",
" ",
......
/* 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",
" ",
" ",
" ",
......
/* XPM */
static char * obm_old_zoom[] = {
"25 19 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" ",
" . ",
......
/* XPM */
static char * obm_size[] = {
"13 13 2 1",
" c white",
". c black",
" s white c white",
". s black c black",
" ",
" ",
" ",
......
......@@ -30,6 +30,7 @@ typedef struct tagHEADLIST {
HWND hWndLogicParent;
HFONT hFont;
BOOL bRedrawFlag;
MDESC *Heap;
} HEADLIST;
typedef HEADLIST FAR* LPHEADLIST;
......
......@@ -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 */
......
/*
* Scroll Bar definitions
* Scroll-bar class extra info
*
* Copyright 1993 Martin Ayotte
* Copyright 1994 Alexandre Julliard
*/
#ifndef SCROLL_H
#define SCROLL_H
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;
#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 );
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);
extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar );
#endif /* SCROLL_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
......
......@@ -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) */
......
......@@ -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");
......
......@@ -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;
......
......@@ -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 \
......
......@@ -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);
......
/*
* DEC 93 Erik Bos (erik@trashcan.hacktic.nl)
* DEC 93 Erik Bos <erik@xs4all.nl>
*/
#include <stdio.h>
......@@ -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;
......
/*
* DOS-FS
* NOV 1993 Erik Bos (erik@(trashcan.)hacktic.nl)
* NOV 1993 Erik Bos <erik@xs4all.nl>
*
* 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",
......
......@@ -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,
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -117,7 +117,7 @@ int GetKeyNameText(LONG lParam, LPSTR lpBuffer, int nSize)
{
int i;
dprintf_keyboard(stddeb,"GetKeyNameText(%d,<ptr>, %d)\n",lParam,nSize);
dprintf_keyboard(stddeb,"GetKeyNameText(%ld,<ptr>,%d)\n",lParam,nSize);
lParam >>= 16;
lParam &= 0xff;
......
......@@ -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)
......
......@@ -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;
......
......@@ -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);
......
#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::
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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; i<min(256,1<<(dcDest->w.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,
......
......@@ -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 */
......
......@@ -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
......
......@@ -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];
}
......
......@@ -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 <mbcstjy@afs.man.ac.uk>
* [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,
......
......@@ -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';
......
......@@ -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)
......
......@@ -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
......
......@@ -9,11 +9,6 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993,1994";
#include <stdlib.h>
#include <string.h>
#include <limits.h>
/*
#ifdef linux
#include <values.h>
#endif
*/
#if !defined (MAXINT)
#include <limits.h>
......@@ -23,8 +18,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993,1994";
#include <X11/Xlib.h>
#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;
}
......
......@@ -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 );
}
......
......@@ -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
{
......
......@@ -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
#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
This diff is collapsed. Click to expand it.
#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
......@@ -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)
......
......@@ -7,114 +7,155 @@
#
# Michael Patra <micky@marie.physik.tu-berlin.de>
#
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.$$ |
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
y=`echo $x | tr a-z A-Z`
echo "#undef DEBUG_$y" >> include/debug.h
echo "#undef DEBUG_$x" >> $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.$$ |
cat <<++EOF++ >>$DEBUG_H
#endif
#ifdef DEBUG_ALL_EXT
++EOF++
cat temp.$$ | tr a-z A-Z |
{
while read x
do
y=`echo $x | tr a-z A-Z`
echo "#define DEBUG_$y" >> include/debug.h
echo "#define DEBUG_$x" >> $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.$$ |
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
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
cat <<++EOF++ >>$DEBUG_H
#ifdef DEBUG_$x
1,
#else
0,
#endif
++EOF++
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
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`
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
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
}
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.$$ |
cat <<++EOF++ >>$DEBUG_H
#ifdef DEBUG_RUNTIME
#ifdef DEBUG_DEFINE_VARIABLES
static char *debug_msg_name[] = {
++EOF++
cat temp.$$ |
{
while read x
do
y=`echo $x | tr a-z A-Z`
echo "#undef DEBUG_$y" >> include/stddebug.h
echo " \"$x\"," >> $DEBUG_H
done
}
echo "#endif" >> include/stddebug.h
echo " " >> include/stddebug.h
echo " " >> include/stddebug.h
echo "#ifdef DEBUG_ALL" >> include/stddebug.h
cat temp.$$ |
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
y=`echo $x | tr a-z A-Z`
echo "#define DEBUG_$y" >> include/stddebug.h
echo "#undef DEBUG_$x" >> $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.$$ |
cat <<++EOF++ >>$STDDEBUG_H
#endif
#ifdef DEBUG_ALL
++EOF++
cat temp.$$ | tr a-z A-Z |
{
while read x
do
echo "\"$x\"," >> include/debug.h
echo "#define DEBUG_$x" >> $STDDEBUG_H
done
}
echo "\"\"};" >> include/debug.h
echo "#endif" >> include/debug.h
echo "#endif" >> include/debug.h
rm temp.$$
}
echo "#endif" >> $STDDEBUG_H
rm temp.$$ $DEBUG_H.old $STDDEBUG_H.old
......@@ -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:
......
......@@ -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 );
......
......@@ -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)
......
......@@ -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 );
......
......@@ -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;
......
......@@ -6,6 +6,7 @@
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdio.h>
#include <X11/Xlib.h>
#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 );
......
......@@ -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 );
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment