Commit 3a5816f8 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 941227

Tue Dec 27 13:35:16 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [*/Imakefile] All objects files are now kept in their respective directory. * [README] Rewrote most of it. * [objects/bitblt.c] Rewrote BitBlt() to look right in every case, while minimizing the impact on performance. Not really finished yet. * [objects/bitmap.c] [objects/dc.c] Fixed bug with pattern brushes. * [objects/clipping.c] [windows/painting.c] Fixes for logical coordinates. * [objects/color.c] [windows/graphics.c] Fixed GetPixel() to return the correct color, and made it faster. * [objects/region.c] Fixed bug in CombineRgn() when one of the region is empty. Fri Dec 22 01:42:57 MET 1994 Dag Asheim (dash@ifi.uio.no) * [Configure] Don't assume that expr handles '==', use '=' instead. Give a (hopefully informative) message if imake fails.
parent 234bc24d
This is release 941227 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll try to make a new release every Sunday.
WHAT'S NEW with Wine-941227: (see ChangeLog for details)
- Better BitBlt()
- Lots of bug fixes
See the README file in the distribution for installation instructions.
Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-941227.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-941227.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-941227.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-941227.tar.gz
ftp.wonderland.org:/Wine/Wine-941227.tar.gz
If you submitted a patch, please check to make sure it has been
included in the new release.
New developers should read the info files available from the ftp sites.
The files NEWBIE-PROJECTS, DEVELOPERS-HINTS and Wine.FAQ are required
reading for new developers.
Wine is available thanks to the work of Bob Amstadt, Dag Asheim,
Martin Ayotte, Erik Bos, John Brezak, Andrew Bulhak, John Burton,
Paul Falstad, Peter Galbavy, Jeffrey Hsu, Miguel de Icaza,
Alexandre Julliard, Jon Konrath, Scott A. Laird, Martin von Loewis,
Kenneth MacDonald, Peter MacDonald, David Metcalfe, Michael Patra,
John Richardson, Johannes Ruscheinski, Yngvi Sigurjonsson,
Rick Sladkey, William Smith, Jon Tombs, Linus Torvalds, Carl Williams,
Karl Guenter Wuensch, and Eric Youngdale.
--
Alexandre Julliard
julliard@lamisun.epfl.ch
/*
* Copyright Robert J. Amstadt, 1993
*/
Tue Dec 27 13:35:16 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [*/Imakefile]
All objects files are now kept in their respective directory.
* [README]
Rewrote most of it.
* [objects/bitblt.c]
Rewrote BitBlt() to look right in every case, while minimizing
the impact on performance. Not really finished yet.
* [objects/bitmap.c] [objects/dc.c]
Fixed bug with pattern brushes.
* [objects/clipping.c] [windows/painting.c]
Fixes for logical coordinates.
* [objects/color.c] [windows/graphics.c]
Fixed GetPixel() to return the correct color, and made it faster.
* [objects/region.c]
Fixed bug in CombineRgn() when one of the region is empty.
Fri Dec 22 01:42:57 MET 1994 Dag Asheim (dash@ifi.uio.no)
* [Configure]
Don't assume that expr handles '==', use '=' instead.
Give a (hopefully informative) message if imake fails.
----------------------------------------------------------------------
Wed Dec 7 14:52:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
......
......@@ -56,10 +56,10 @@ then
fi
LANGS=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
while expr "$LANGS" : ".*$LANG" == 0 > /dev/null
while expr "$LANGS" : ".*$LANG" = 0 > /dev/null
do
prompt "Language ($LANGS)" LANG En
if expr "$LANGS" : ".*$LANG" == 0 > /dev/null
if expr "$LANGS" : ".*$LANG" = 0 > /dev/null
then
echo "\"$LANG\" is not a supported language."
fi
......@@ -209,22 +209,37 @@ EOF
echo
echo "Creating Makefiles. This may take a while."
xmkmf -a
if xmkmf -a
then :
else cat << EOF
WARNING: The exit status of the command 'xmkmf -a' indicates an error.
Maybe the Wine directory is incomplete, or Imake (see 'man xmkmf imake')
is incorrectly configured? In the latter case, it might be easiest to
reinstall X11 to get a new copy of Imake.
EOF
fi
if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
then
cat << EOF
WARNING: You have some files named "*.rej". Rejected patch files?
Maybe you tried to upgrade Wine by diff-files, and that patch failed.
If something doesn't work, this might be the reason. See "man patch".
WARNING: You have some files named '*.rej', which usually indicates
rejected patch files. Maybe you tried to upgrade Wine with 'patch',
and that some of the patches failed? If something doesn't work, this
might be the reason. See 'man patch' (especially the '-p' option).
List of "*.rej" files:
EOF
find . -name "*.rej" -print
exit 1
fi
echo
echo "Configure finished. Do 'make' to compile Wine."
if [ -f ./Makefile ]
then
echo
echo "Configure finished. Do 'make' to compile Wine."
else
echo
echo "*** There was a problem with 'imake': the main Makefile has not be created."
fi
......@@ -21,18 +21,15 @@ DEFINES = AutoDefines -DUSE_READLINE -DWINESTAT
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'\
'DEFINES=$(DEFINES)'
'DEFINES=$(DEFINES)' 'LD=$(LD)'
COMMONSUBDIRS = \
controls \
etc \
include \
rc \
loader \
misc \
multimedia \
objects \
test \
windows
EMUSUBDIRS = \
......@@ -48,35 +45,33 @@ LIBSUBDIRS = \
WINEDIR = $(LIBDIR)/wine
COMMONOBJS = \
controls.o \
loader.o \
misc.o \
multimedia.o \
objects.o \
rc.o \
windows.o
controls/controls.o \
loader/loader.o \
misc/misc.o \
multimedia/multimedia.o \
objects/objects.o \
rc/rc.o \
windows/windows.o
/*
* WARNING: if1632.o must be the first object file because its code must be
* linked at the lowest possible addresses.
*/
EMUOBJS = \
if1632.o \
debugger.o \
memory.o \
miscemu.o \
opcodes.o \
readline.o
if1632/if1632.o \
debugger/debugger.o \
memory/memory.o \
miscemu/miscemu.o
LIBOBJS = \
toolkit.o
toolkit/toolkit.o
#ifndef WINELIB
SUBDIRS = $(COMMONSUBDIRS) $(EMUSUBDIRS)
OBJS = $(COMMONOBJS) $(EMUOBJS)
OBJS = $(EMUOBJS) $(COMMONOBJS)
#else
SUBDIRS = $(COMMONSUBDIRS) $(LIBSUBDIRS)
OBJS = $(COMMONOBJS) $(LIBOBJS)
OBJS = $(LIBOBJS) $(COMMONOBJS)
#endif
#ifdef i386BsdArchitecture
......@@ -100,9 +95,9 @@ DependSubdirs($(SUBDIRS))
AllTarget(wine.sym)
#ifndef WINELIB
NormalProgramTarget(wine,$(EMUOBJS) $(COMMONOBJS),$(DEPXLIB),$(XPM_LIB) $(XLIB),$(SYSLIBS))
NormalProgramTarget(wine,$(OBJS),$(DEPXLIB),$(XPM_LIB) $(XLIB),$(SYSLIBS))
#else
NormalLibraryTarget(wine,$(LIBOBJS) $(COMMONOBJS))
NormalLibraryTarget(wine,$(OBJS))
#endif
wine.sym: wine
......@@ -119,6 +114,6 @@ etags::
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
$(RM) `find . -name Makefile -print`
......@@ -8,24 +8,24 @@ XCOMM First, dll description to files etc
#ifndef MakeDllFromSpec
#ifndef NewBuild
#ifndef ShortNames
#define MakeDllFromSpec(name,objfile) @@\
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat3(dll_,name,_tab.c): name.spec $(TOP)/tools/build @@\
$(TOP)/tools/build name.spec @@\
#else /* ShortNames */
#define MakeDllFromSpec(name,objfile) @@\
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(dtb_,name.c): name.spec $(TOP)/tools/build @@\
$(TOP)/tools/build name.spec @@\
#endif /* ShortNames */
#else /* NewBuild */
#ifndef ShortNames
#define MakeDllFromSpec(name,objfile) @@\
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(rly_,name.S) Concat3(dll_,name,_tab.c): name.spec $(TOP)/tools/newbuild @@\
$(TOP)/tools/newbuild name.spec @@\
#else /* ShortNames */
#define MakeDllFromSpec(name,objfile) @@\
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(rly_,name.S) Concat(dtb_,name.c): name.spec $(TOP)/tools/newbuild @@\
$(TOP)/tools/newbuild name.spec @@\
......
......@@ -15,7 +15,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -138,6 +138,7 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_LBUTTONUP:
if (GetCapture() != hWnd) break;
ReleaseCapture();
SendMessage( hWnd, BM_SETSTATE, FALSE, 0 );
GetClientRect( hWnd, &rect );
......
#include "../Wine.tmpl"
#define IHavSubDirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'\
'LD=$(LD)'
MODULE = debugger
......@@ -16,21 +17,22 @@ SRCS = \
lex.yy.c \
info.c
OBJS = $(SRCS:.c=.o)
SUBDIRS_OBJS = \
opcodes/opcodes.o \
readline/readline.o
OBJS = $(SRCS:.c=.o) $(SUBDIRS_OBJS)
/*
* All the SUBDIR stuff
*/
MakeSubdirs($(SUBDIRS))
MakefileSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
CleanSubdirs($(SUBDIRS))
IncludesSubdirs($(SUBDIRS))
/*
* The main act
*/
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
depend:: dbg.tab.c dbg.tab.h lex.yy.c
......
......@@ -18,7 +18,7 @@ OBJS = $(SRCS:.c=.o)
#undef xi386
#endif
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -13,7 +13,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
#include "../Wine.tmpl"
MODULE = etc
AllTarget()
depend::
includes::
......@@ -39,23 +39,23 @@ OBJS = $(CALLOBJS) $(DLLOBJS) $(SRCS:.c=.o) $(DLLOBJS:.o=_tab.o) $(DLLOBJS:dll_.
/*
* If you add a new spec file, copy one of these lines
*/
MakeDllFromSpec(commdlg,$(TOP)/$(MODULE))
MakeDllFromSpec(gdi,$(TOP)/$(MODULE))
MakeDllFromSpec(kernel,$(TOP)/$(MODULE))
MakeDllFromSpec(keyboard,$(TOP)/$(MODULE))
MakeDllFromSpec(shell,$(TOP)/$(MODULE))
MakeDllFromSpec(mmsystem,$(TOP)/$(MODULE))
MakeDllFromSpec(mouse,$(TOP)/$(MODULE))
MakeDllFromSpec(sound,$(TOP)/$(MODULE))
MakeDllFromSpec(stress,$(TOP)/$(MODULE))
MakeDllFromSpec(system,$(TOP)/$(MODULE))
MakeDllFromSpec(toolhelp,$(TOP)/$(MODULE))
MakeDllFromSpec(unixlib,$(TOP)/$(MODULE))
MakeDllFromSpec(user,$(TOP)/$(MODULE))
MakeDllFromSpec(win87em,$(TOP)/$(MODULE))
MakeDllFromSpec(winsock,$(TOP)/$(MODULE))
MakeDllFromSpec(commdlg)
MakeDllFromSpec(gdi)
MakeDllFromSpec(kernel)
MakeDllFromSpec(keyboard)
MakeDllFromSpec(shell)
MakeDllFromSpec(mmsystem)
MakeDllFromSpec(mouse)
MakeDllFromSpec(sound)
MakeDllFromSpec(stress)
MakeDllFromSpec(system)
MakeDllFromSpec(toolhelp)
MakeDllFromSpec(unixlib)
MakeDllFromSpec(user)
MakeDllFromSpec(win87em)
MakeDllFromSpec(winsock)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
#ifndef WINELIB
......@@ -63,7 +63,7 @@ pop.h: $(TOP)/tools/build
$(TOP)/tools/build -p
call.o: call.S pop.h
gcc -I. -c -o call.o call.S
$(CC) -I. -c -o call.o call.S
#endif
includes::
......
......@@ -15,7 +15,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <linux/unistd.h>
#include <linux/head.h>
#include <linux/ldt.h>
#include <linux/segment.h>
#endif
#include "neexe.h"
......
#include "../Wine.tmpl"
MODULE = include
HEADERS = \
atom.h \
callback.h \
class.h \
combo.h \
cursor.h \
dce.h \
dialog.h \
dlls.h \
files.h \
gdi.h \
heap.h \
icon.h \
int21.h \
listbox.h \
menu.h \
message.h \
neexe.h \
prototypes.h \
regfunc.h \
scroll.h \
segmem.h \
user.h \
win.h \
windows.h \
wine.h
AllTarget()
depend::
includes::
/*
* GDI bitmap definitions
*
* Copyright 1993 Alexandre Julliard
* Copyright 1993, 1994 Alexandre Julliard
*/
#ifndef BITMAP_H
#define BITMAP_H
#include <stdlib.h>
#include <X11/Xlib.h>
#include "windows.h"
/* objects/bitmap.c */
extern BOOL BITMAP_Init(void);
/* objects/dib.c */
extern int DIB_GetImageWidthBytes( int width, int depth );
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
/* GCs used for B&W and color bitmap operations */
extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = DIB_GetImageWidthBytes( (width), (bpp) ); \
(image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, malloc( (height)*width_bytes ), \
(width), (height), 32, width_bytes ); \
}
#endif /* BITMAP_H */
......@@ -5,10 +5,13 @@
extern HPALETTE COLOR_Init(void);
extern int COLOR_ToPhysical( DC *dc, COLORREF color );
extern void COLOR_SetMapping( DC *dc, HANDLE, WORD );
extern void COLOR_SetMapping( DC *dc, HANDLE map, HANDLE revMap, WORD size );
extern BOOL COLOR_IsSolid( COLORREF color );
extern Colormap COLOR_WinColormap;
extern int COLOR_mapEGAPixel[16];
extern int* COLOR_PaletteToPixel;
extern int* COLOR_PixelToPalette;
extern int COLOR_ColormapSize;
#endif /* __WINE_COLOR_H */
......@@ -203,7 +203,8 @@ typedef struct
/* X physical palette information */
typedef struct
{
HANDLE hMapping;
HANDLE hMapping; /* Color mapping table (or 0 for identity) */
HANDLE hRevMapping; /* Reverse color mapping table */
WORD mappingSize;
} X_PHYSPALETTE;
......
......@@ -57,10 +57,6 @@ extern void SpyInit(void);
extern BOOL WIDGETS_Init(void);
/* objects/dib.c */
extern int DIB_BitmapInfoSize(BITMAPINFO *info, WORD coloruse);
/* objects/palette.c */
extern BOOL PALETTE_Init(void);
......
......@@ -19,7 +19,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -9,7 +9,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -29,7 +29,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -31,12 +31,14 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
extern ButtonTexts ButtonText;
static char people[] = "People who have generously donated time to the Wine " \
"project include Bob Amstadt, Martin Ayotte, Erik Bos, John Brezak, "\
"Andrew Bulhak, John Burton, Peter Galbavy, Jeffery Hsu, Miguel de Icaza, " \
"Alexandre Julliard, Scott A. Laird, Peter MacDonald, David Metcalfe, " \
"John Richardson, Johannes Ruscheinski, Yngvi Sigurjonsson, Linus Torvalds, " \
"Carl Williams, Karl Guenter Wuensch, and Eric Youngdale. ";
static const char people[] = "Wine is available thanks to the work of "\
"Bob Amstadt, Dag Asheim, Martin Ayotte, Erik Bos, John Brezak, "\
"Andrew Bulhak, John Burton, Paul Falstad, Peter Galbavy, Jeffrey Hsu, "\
"Miguel de Icaza, Alexandre Julliard, Jon Konrath, Scott A. Laird, "\
"Martin von Loewis, Kenneth MacDonald, Peter MacDonald, David Metcalfe, "\
"Michael Patra, John Richardson, Johannes Ruscheinski, Yngvi Sigurjonsson, "\
"Rick Sladkey, William Smith, Jon Tombs, Linus Torvalds, Carl Williams, "\
"Karl Guenter Wuensch, and Eric Youngdale.";
#define WINE_CLASS "Wine" /* Class name for resources */
......
......@@ -20,7 +20,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -12,7 +12,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -24,7 +24,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -139,7 +139,7 @@ HBITMAP CreateBitmapIndirect( BITMAP * bmp )
hbitmap = 0;
}
else if (bmp->bmBits) /* Set bitmap bits */
SetBitmapBits( hbitmap, bmp->bmHeight*bmp->bmWidthBytes, bmp->bmBits );
SetBitmapBits( hbitmap, bmpObjPtr->bitmap.bmHeight*bmpObjPtr->bitmap.bmWidthBytes, bmp->bmBits );
return hbitmap;
}
......
......@@ -8,7 +8,6 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "gdi.h"
#include "bitmap.h"
#include "prototypes.h"
#include "metafile.h"
#include "stddebug.h"
#include "color.h"
......
......@@ -2,15 +2,13 @@
* DC clipping functions
*
* Copyright 1993 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
*/
#include <stdio.h>
#include "gdi.h"
#include "metafile.h"
#include "stddebug.h"
/* #define DEBUG_CLIPPING */
/* #undef DEBUG_CLIPPING */
#include "debug.h"
/***********************************************************************
......@@ -129,7 +127,7 @@ int OffsetClipRgn( HDC hdc, short x, short y )
if (dc->w.hClipRgn)
{
int retval = OffsetRgn( dc->w.hClipRgn, x, y );
int retval = OffsetRgn( dc->w.hClipRgn, XLPTODP(dc,x), YLPTODP(dc,y) );
CLIPPING_UpdateGCRegion( dc );
return retval;
}
......@@ -163,6 +161,11 @@ static int CLIPPING_IntersectClipRect( DC * dc, short left, short top,
HRGN tempRgn, newRgn;
int ret;
left = XLPTODP( dc, left );
right = XLPTODP( dc, right );
top = YLPTODP( dc, top );
bottom = YLPTODP( dc, bottom );
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0 ))) return ERROR;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom )))
{
......@@ -237,6 +240,11 @@ static int CLIPPING_IntersectVisRect( DC * dc, short left, short top,
HRGN tempRgn, newRgn;
int ret;
left = XLPTODP( dc, left );
right = XLPTODP( dc, right );
top = YLPTODP( dc, top );
bottom = YLPTODP( dc, bottom );
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0 ))) return ERROR;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom )))
{
......@@ -312,10 +320,7 @@ BOOL RectVisible( HDC hdc, LPRECT rect )
if (!dc) return FALSE;
dprintf_clipping(stddeb,"RectVisible: %d %p\n", hdc, rect );
if (!dc->w.hGCClipRgn) return FALSE;
tmpRect.left = XLPTODP(dc, rect->left);
tmpRect.top = YLPTODP(dc, rect->top);
tmpRect.right = XLPTODP(dc, rect->right);
tmpRect.bottom = YLPTODP(dc, rect->bottom);
LPtoDP( hdc, (LPPOINT)rect, 2 );
return RectInRegion( dc->w.hGCClipRgn, &tmpRect );
}
......@@ -325,10 +330,13 @@ BOOL RectVisible( HDC hdc, LPRECT rect )
*/
int GetClipBox( HDC hdc, LPRECT rect )
{
int ret;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return ERROR;
dprintf_clipping(stddeb, "GetClipBox: %d %p\n", hdc, rect );
return GetRgnBox( dc->w.hGCClipRgn, rect );
ret = GetRgnBox( dc->w.hGCClipRgn, rect );
DPtoLP( hdc, (LPPOINT)rect, 2 );
return ret;
}
......
......@@ -48,10 +48,14 @@ static PALETTEENTRY COLOR_sysPaletteEntries[NB_RESERVED_COLORS] =
};
static HANDLE hSysColorTranslation = 0;
static HANDLE hRevSysColorTranslation = 0;
/* Map an EGA index (0..15) to a pixel value. Used for dithering. */
int COLOR_mapEGAPixel[16];
int* COLOR_PaletteToPixel = NULL;
int* COLOR_PixelToPalette = NULL;
int COLOR_ColormapSize = 0;
/***********************************************************************
* COLOR_BuildMap
......@@ -93,16 +97,29 @@ static BOOL COLOR_BuildMap( Colormap map, int depth, int size )
*/
static HPALETTE COLOR_InitPalette(void)
{
int i, size;
int i, size, pixel;
XColor color;
HPALETTE hpalette;
LOGPALETTE * palPtr;
WORD *colorTranslation;
WORD *colorTranslation, *revTranslation;
size = DefaultVisual( display, DefaultScreen(display) )->map_entries;
COLOR_ColormapSize = size;
if (!(hSysColorTranslation = GDI_HEAP_ALLOC( GMEM_MOVEABLE,
sizeof(WORD)*NB_RESERVED_COLORS ))) return FALSE;
sizeof(WORD)*NB_RESERVED_COLORS )))
return FALSE;
if (!(hRevSysColorTranslation = GDI_HEAP_ALLOC( GMEM_MOVEABLE,
sizeof(WORD)*size )))
return FALSE;
colorTranslation = (WORD *) GDI_HEAP_ADDR( hSysColorTranslation );
size = DefaultVisual( display, DefaultScreen(display) )->map_entries;
revTranslation = (WORD *) GDI_HEAP_ADDR( hRevSysColorTranslation );
if (COLOR_WinColormap == DefaultColormapOfScreen(screen))
{
COLOR_PaletteToPixel = (int *)malloc( sizeof(int) * size );
COLOR_PixelToPalette = (int *)malloc( sizeof(int) * size );
}
for (i = 0; i < NB_RESERVED_COLORS; i++)
{
color.red = COLOR_sysPaletteEntries[i].peRed * 65535 / 255;
......@@ -110,34 +127,38 @@ static HPALETTE COLOR_InitPalette(void)
color.blue = COLOR_sysPaletteEntries[i].peBlue * 65535 / 255;
color.flags = DoRed | DoGreen | DoBlue;
if (i < NB_RESERVED_COLORS/2)
{
/* Bottom half of the colormap */
pixel = i;
if (pixel >= size/2) continue;
}
else
{
/* Top half of the colormap */
pixel = size - NB_RESERVED_COLORS + i;
if (pixel < size/2) continue;
}
if (COLOR_WinColormap != DefaultColormapOfScreen(screen))
{
if (i < NB_RESERVED_COLORS/2)
{
/* Bottom half of the colormap */
color.pixel = i;
if (color.pixel >= size/2) continue;
}
else
{
/* Top half of the colormap */
color.pixel = size - NB_RESERVED_COLORS + i;
if (color.pixel < size/2) continue;
}
color.pixel = pixel;
XStoreColor( display, COLOR_WinColormap, &color );
}
else if (!XAllocColor( display, COLOR_WinColormap, &color ))
{
fprintf(stderr, "Warning: Not enough free colors. Try using the -privatemap option.\n" );
color.pixel = color.red = color.green = color.blue = 0;
}
else
{
if (!XAllocColor( display, COLOR_WinColormap, &color ))
{
fprintf(stderr, "Warning: Not enough free colors. Try using the -privatemap option.\n" );
color.pixel = color.red = color.green = color.blue = 0;
}
else
{
COLOR_PaletteToPixel[pixel] = color.pixel;
COLOR_PixelToPalette[color.pixel] = pixel;
}
}
colorTranslation[i] = color.pixel;
#if 0
/* Put the allocated colors back in the list */
COLOR_sysPaletteEntries[i].peRed = color.red >> 8;
COLOR_sysPaletteEntries[i].peGreen = color.green >> 8;
COLOR_sysPaletteEntries[i].peBlue = color.blue >> 8;
#endif
revTranslation[color.pixel] = i;
/* Set EGA mapping if color in the first or last eight */
if (i < 8)
COLOR_mapEGAPixel[i] = color.pixel;
......@@ -232,7 +253,7 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
WORD index = 0;
WORD *mapping;
if (dc && !dc->u.x.pal.hMapping) return 0;
if (screenDepth > 8) return color;
switch(color >> 24)
{
case 0: /* RGB */
......@@ -256,7 +277,8 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
if (index >= NB_RESERVED_COLORS) return 0;
mapping = (WORD *) GDI_HEAP_ADDR( hSysColorTranslation );
}
return mapping[index];
if (mapping) return mapping[index];
else return index; /* Identity mapping */
}
......@@ -265,12 +287,16 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
*
* Set the color-mapping table in a DC.
*/
void COLOR_SetMapping( DC *dc, HANDLE map, WORD size )
void COLOR_SetMapping( DC *dc, HANDLE map, HANDLE revMap, WORD size )
{
WORD *pmap, *pnewmap;
WORD i;
if (dc->u.x.pal.hMapping && (dc->u.x.pal.hMapping != hSysColorTranslation))
GDI_HEAP_FREE( dc->u.x.pal.hMapping );
if (dc->u.x.pal.hRevMapping &&
(dc->u.x.pal.hRevMapping != hRevSysColorTranslation))
GDI_HEAP_FREE( dc->u.x.pal.hRevMapping );
if (map && (map != hSysColorTranslation))
{
/* Copy mapping table */
......@@ -278,8 +304,17 @@ void COLOR_SetMapping( DC *dc, HANDLE map, WORD size )
pmap = (WORD *) GDI_HEAP_ADDR( map );
pnewmap = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hMapping );
memcpy( pnewmap, pmap, sizeof(WORD)*size );
/* Build reverse table */
dc->u.x.pal.hRevMapping = GDI_HEAP_ALLOC( GMEM_MOVEABLE,
sizeof(WORD)*COLOR_ColormapSize );
pmap = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hRevMapping );
for (i = 0; i < size; i++) pmap[pnewmap[i]] = i;
}
else
{
dc->u.x.pal.hMapping = map;
dc->u.x.pal.hRevMapping = map ? hRevSysColorTranslation : 0;
}
else dc->u.x.pal.hMapping = map;
dc->u.x.pal.mappingSize = size;
}
......@@ -306,6 +341,7 @@ WORD RealizeDefaultPalette( HDC hdc )
DC *dc;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
dc->w.hPalette = STOCK_DEFAULT_PALETTE;
COLOR_SetMapping( dc, hSysColorTranslation, NB_RESERVED_COLORS );
COLOR_SetMapping( dc, hSysColorTranslation,
hRevSysColorTranslation, NB_RESERVED_COLORS );
return NB_RESERVED_COLORS;
}
......@@ -136,7 +136,7 @@ int DC_SetupGCForBrush( DC * dc )
}
val.function = DC_XROPfunction[dc->w.ROPmode-1];
val.fill_style = dc->u.x.brush.fillStyle;
if (val.fill_style == FillStippled)
if ((val.fill_style==FillStippled) || (val.fill_style==FillOpaqueStippled))
{
if (dc->w.backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
val.stipple = dc->u.x.brush.pixmap;
......@@ -244,7 +244,8 @@ HDC GetDCState( HDC hdc )
newdc->w.hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( newdc->w.hClipRgn, dc->w.hClipRgn, 0, RGN_COPY );
}
COLOR_SetMapping( newdc, dc->u.x.pal.hMapping, dc->u.x.pal.mappingSize );
COLOR_SetMapping( newdc, dc->u.x.pal.hMapping,
dc->u.x.pal.hRevMapping, dc->u.x.pal.mappingSize );
return handle;
}
......@@ -279,7 +280,8 @@ void SetDCState( HDC hdc, HDC hdcs )
SelectObject( hdc, dcs->w.hBrush );
SelectObject( hdc, dcs->w.hFont );
COLOR_SetMapping( dc, dcs->u.x.pal.hMapping, dcs->u.x.pal.mappingSize );
COLOR_SetMapping( dc, dcs->u.x.pal.hMapping,
dcs->u.x.pal.hRevMapping, dcs->u.x.pal.mappingSize );
}
......
/*
* GDI device independent bitmaps
* GDI device-independent bitmaps
*
* Copyright 1993 Alexandre Julliard
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
* Copyright 1993,1994 Alexandre Julliard
*/
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
......@@ -17,23 +16,32 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "color.h"
#include "debug.h"
static int get_bpp(int depth)
/***********************************************************************
* DIB_GetImageWidthBytes
*
* Return the width of an X image in bytes
*/
int DIB_GetImageWidthBytes( int width, int depth )
{
switch(depth) {
case 4:
case 8:
return 1;
case 15:
case 16:
return 2;
case 24:
return 4;
default:
fprintf(stderr, "DIB: unsupported depth %d!\n", depth);
exit(1);
}
int words;
switch(depth)
{
case 1: words = (width + 31) / 32; break;
case 4: words = (width + 7) / 8; break;
case 8: words = (width + 3) / 4; break;
case 15:
case 16: words = (width + 1) / 2; break;
case 24: words = width; break;
default:
fprintf(stderr, "DIB: unsupported depth %d.\n", depth );
exit(1);
}
return 4 * words;
}
/***********************************************************************
* DIB_BitmapInfoSize
*
......@@ -61,11 +69,11 @@ static XImage *DIB_DIBmpToImage( BITMAPINFOHEADER * bmp, void * bmpData )
{
extern void _XInitImageFuncPtrs( XImage* );
XImage * image;
int bytesPerLine = bmp->biWidth * get_bpp(bmp->biBitCount);
image = XCreateImage( display, DefaultVisualOfScreen( screen ),
bmp->biBitCount, ZPixmap, 0, bmpData,
bmp->biWidth, bmp->biHeight, 32, bytesPerLine );
image = XCreateImage(display, DefaultVisualOfScreen( screen ),
bmp->biBitCount, ZPixmap, 0, bmpData,
bmp->biWidth, bmp->biHeight, 32,
DIB_GetImageWidthBytes(bmp->biWidth,bmp->biBitCount));
if (!image) return 0;
image->byte_order = MSBFirst;
image->bitmap_bit_order = MSBFirst;
......@@ -359,7 +367,7 @@ static void DIB_SetImageBits_RLE8(WORD lines,
dprintf_bitmap(stddeb,
"DIB_SetImageBits_RLE8(): "
"Delta to last line of bitmap "
"(wrongly??) causes loop exit\n");
"(wrongly?) causes loop exit\n");
}
break;
}
......@@ -448,8 +456,7 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits,
{
int *colorMapping;
XImage *bmpImage;
void *bmpData;
int i, colors, widthBytes;
int i, colors;
/* Build the color mapping table */
......@@ -477,12 +484,7 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits,
}
/* Transfer the pixels */
widthBytes = info->bmiHeader.biWidth * get_bpp(depth);
bmpData = malloc( lines * widthBytes );
bmpImage = XCreateImage( display, DefaultVisualOfScreen(screen),
depth, ZPixmap, 0, bmpData,
info->bmiHeader.biWidth, lines, 32, widthBytes );
XCREATEIMAGE(bmpImage, info->bmiHeader.biWidth, lines, depth );
switch(info->bmiHeader.biBitCount)
{
......
......@@ -85,12 +85,7 @@ static char *imageData = NULL;
*/
BOOL DITHER_Init(void)
{
int bytes_per_line = (screenDepth * MATRIX_SIZE + 7) / 8;
if (!(imageData = (char *) malloc( bytes_per_line * MATRIX_SIZE )))
return FALSE;
ditherImage = XCreateImage( display, DefaultVisualOfScreen(screen),
screenDepth, ZPixmap, 0, imageData,
MATRIX_SIZE, MATRIX_SIZE, 8, bytes_per_line );
XCREATEIMAGE( ditherImage, MATRIX_SIZE, MATRIX_SIZE, screenDepth );
return (ditherImage != NULL);
}
......@@ -104,8 +99,6 @@ Pixmap DITHER_DitherColor( DC *dc, COLORREF color )
unsigned int x, y;
Pixmap pixmap;
/* printf( "Dither: %x\n", color ); */
if (color != prevColor)
{
int r = GetRValue( color ) * DITHER_LEVELS;
......@@ -113,8 +106,6 @@ Pixmap DITHER_DitherColor( DC *dc, COLORREF color )
int b = GetBValue( color ) * DITHER_LEVELS;
const int *pmatrix = dither_matrix;
/* WORD *mapping = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hMapping );*/
for (y = 0; y < MATRIX_SIZE; y++)
{
for (x = 0; x < MATRIX_SIZE; x++)
......
......@@ -243,10 +243,6 @@ HANDLE GDI_AllocObject( WORD size, WORD magic )
HANDLE handle = GDI_HEAP_ALLOC( GMEM_MOVEABLE, size );
if (!handle) return 0;
obj = (GDIOBJHDR *) GDI_HEAP_ADDR( handle );
if (obj == NULL) {
fprintf(stderr,"GDI_AllocObject // Error trying to get GDI_HEAD_ADDR !\n");
return 0;
}
obj->hNext = 0;
obj->wMagic = magic;
obj->dwCount = ++count;
......
......@@ -178,7 +178,7 @@ HPALETTE GDISelectPalette( HDC hdc, HPALETTE hpal )
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
prev = dc->w.hPalette;
dc->w.hPalette = hpal;
if (hpal != STOCK_DEFAULT_PALETTE) COLOR_SetMapping( dc, 0, 0 );
if (hpal != STOCK_DEFAULT_PALETTE) COLOR_SetMapping( dc, 0, 0, 0 );
else RealizeDefaultPalette( hdc ); /* Always realize default palette */
return prev;
}
......
......@@ -588,6 +588,45 @@ int CombineRgn( HRGN hDest, HRGN hSrc1, HRGN hSrc2, short mode )
return ERROR;
region = &destObj->region;
/* Some optimizations for null regions */
if (src1Obj->region.type == NULLREGION)
{
switch(mode)
{
case RGN_AND:
case RGN_DIFF:
if (region->xrgn) XDestroyRegion( region->xrgn );
if (region->pixmap) XFreePixmap( display, region->pixmap );
region->type = NULLREGION;
region->xrgn = 0;
return NULLREGION;
case RGN_OR:
case RGN_XOR:
return REGION_CopyRegion( src2Obj, destObj );
default:
return ERROR;
}
}
else if (src2Obj->region.type == NULLREGION)
{
switch(mode)
{
case RGN_AND:
if (region->xrgn) XDestroyRegion( region->xrgn );
if (region->pixmap) XFreePixmap( display, region->pixmap );
region->type = NULLREGION;
region->xrgn = 0;
return NULLREGION;
case RGN_OR:
case RGN_XOR:
case RGN_DIFF:
return REGION_CopyRegion( src1Obj, destObj );
default:
return ERROR;
}
}
if (src1Obj->region.xrgn && src2Obj->region.xrgn)
{
/* Perform the operation with X regions */
......
......@@ -8,7 +8,7 @@ MODULE = rc
echo "#include \"windows.h\"" >$*.rct
echo WINDOWS_H_ENDS_HERE >>$*.rct
cat $< >>$*.rct
gcc -E -x c -P $(CFLAGS) $*.rct | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | ./winerc -o $* -v -p $*
$(CC) -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
......@@ -18,7 +18,7 @@ RCSRCS = sysres.rc sysresbm.rc
RCOBJS = $(RCSRCS:.rc=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(RCOBJS))
WineRelocatableTarget($(MODULE),,$(RCOBJS))
$(RCOBJS): winerc $(TOP)/include/windows.h
......
all::
depend::
clean::
includes::
......@@ -10,7 +10,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -31,7 +31,7 @@ SRCS = \
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
......
......@@ -484,7 +484,9 @@ COLORREF GetPixel( HDC hdc, short x, short y )
{
PALETTEENTRY entry;
XImage * image;
WORD * mapping;
int pixel;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return 0;
......@@ -492,8 +494,11 @@ COLORREF GetPixel( HDC hdc, short x, short y )
return 0;
#endif
if (!PtVisible( hdc, x, y )) return 0;
x = dc->w.DCOrgX + XLPTODP( dc, x );
y = dc->w.DCOrgY + YLPTODP( dc, y );
#if 0
if ((x < 0) || (y < 0)) return 0;
if (!(dc->w.flags & DC_MEMORY))
......@@ -505,11 +510,16 @@ COLORREF GetPixel( HDC hdc, short x, short y )
if (win_attr.map_state != IsViewable) return 0;
if ((x >= win_attr.width) || (y >= win_attr.height)) return 0;
}
#endif
image = XGetImage( display, dc->u.x.drawable, x, y,
1, 1, AllPlanes, ZPixmap );
GetPaletteEntries( dc->w.hPalette, XGetPixel( image, 0, 0 ), 1, &entry );
pixel = XGetPixel( image, 0, 0 );
XDestroyImage( image );
if (screenDepth > 8) return pixel;
mapping = (WORD *) GDI_HEAP_ADDR( dc->u.x.pal.hRevMapping );
if (mapping) pixel = mapping[pixel];
GetPaletteEntries( dc->w.hPalette, pixel, 1, &entry );
return RGB( entry.peRed, entry.peGreen, entry.peBlue );
}
......
......@@ -44,6 +44,7 @@ HDC BeginPaint( HWND hwnd, LPPAINTSTRUCT lps )
return 0;
}
GetRgnBox( InquireVisRgn(lps->hdc), &lps->rcPaint );
DPtoLP( lps->hdc, (LPPOINT)&lps->rcPaint, 2 );
SendMessage( hwnd, WM_NCPAINT, hrgnUpdate, 0 );
DeleteObject( hrgnUpdate );
......@@ -71,6 +72,7 @@ void FillWindow( HWND hwndParent, HWND hwnd, HDC hdc, HBRUSH hbrush )
{
RECT rect;
GetClientRect( hwnd, &rect );
DPtoLP( hdc, (LPPOINT)&rect, 2 );
PaintRect( hwndParent, hwnd, hdc, hbrush, &rect );
}
......
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