1997-02-02 20:01:52 +01:00
|
|
|
/*
|
1998-11-25 13:36:03 +01:00
|
|
|
* X11DRV brush objects
|
1997-02-02 20:01:52 +01:00
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
1999-02-04 12:11:01 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#ifndef X_DISPLAY_MISSING
|
|
|
|
|
1998-12-26 13:00:43 +01:00
|
|
|
#include "ts_xlib.h"
|
|
|
|
|
1997-02-02 20:01:52 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include "brush.h"
|
|
|
|
#include "bitmap.h"
|
|
|
|
#include "color.h"
|
|
|
|
#include "x11drv.h"
|
1999-06-26 21:09:08 +02:00
|
|
|
#include "debugtools.h"
|
1999-02-04 12:11:01 +01:00
|
|
|
#include "local.h"
|
1997-02-02 20:01:52 +01:00
|
|
|
|
2000-03-25 15:05:06 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(gdi);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1997-06-29 20:08:02 +02:00
|
|
|
static const char HatchBrushes[NB_HATCH_STYLES + 1][8] =
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
|
|
|
{ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00 }, /* HS_HORIZONTAL */
|
|
|
|
{ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 }, /* HS_VERTICAL */
|
|
|
|
{ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }, /* HS_FDIAGONAL */
|
|
|
|
{ 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }, /* HS_BDIAGONAL */
|
|
|
|
{ 0x08, 0x08, 0x08, 0xff, 0x08, 0x08, 0x08, 0x08 }, /* HS_CROSS */
|
1997-06-29 20:08:02 +02:00
|
|
|
{ 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81 }, /* HS_DIAGCROSS */
|
|
|
|
{ 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb } /* Hack for DKGRAY */
|
1997-02-02 20:01:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Levels of each primary for dithering */
|
|
|
|
#define PRIMARY_LEVELS 3
|
|
|
|
#define TOTAL_LEVELS (PRIMARY_LEVELS*PRIMARY_LEVELS*PRIMARY_LEVELS)
|
|
|
|
|
|
|
|
/* Dithering matrix size */
|
|
|
|
#define MATRIX_SIZE 8
|
|
|
|
#define MATRIX_SIZE_2 (MATRIX_SIZE*MATRIX_SIZE)
|
|
|
|
|
|
|
|
/* Total number of possible levels for a dithered primary color */
|
|
|
|
#define DITHER_LEVELS (MATRIX_SIZE_2 * (PRIMARY_LEVELS-1) + 1)
|
|
|
|
|
|
|
|
/* Dithering matrix */
|
|
|
|
static const int dither_matrix[MATRIX_SIZE_2] =
|
|
|
|
{
|
|
|
|
0, 32, 8, 40, 2, 34, 10, 42,
|
|
|
|
48, 16, 56, 24, 50, 18, 58, 26,
|
|
|
|
12, 44, 4, 36, 14, 46, 6, 38,
|
|
|
|
60, 28, 52, 20, 62, 30, 54, 22,
|
|
|
|
3, 35, 11, 43, 1, 33, 9, 41,
|
|
|
|
51, 19, 59, 27, 49, 17, 57, 25,
|
|
|
|
15, 47, 7, 39, 13, 45, 5, 37,
|
|
|
|
63, 31, 55, 23, 61, 29, 53, 21
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Mapping between (R,G,B) triples and EGA colors */
|
|
|
|
static const int EGAmapping[TOTAL_LEVELS] =
|
|
|
|
{
|
|
|
|
0, /* 000000 -> 000000 */
|
|
|
|
4, /* 00007f -> 000080 */
|
|
|
|
12, /* 0000ff -> 0000ff */
|
|
|
|
2, /* 007f00 -> 008000 */
|
|
|
|
6, /* 007f7f -> 008080 */
|
|
|
|
6, /* 007fff -> 008080 */
|
|
|
|
10, /* 00ff00 -> 00ff00 */
|
|
|
|
6, /* 00ff7f -> 008080 */
|
|
|
|
14, /* 00ffff -> 00ffff */
|
|
|
|
1, /* 7f0000 -> 800000 */
|
|
|
|
5, /* 7f007f -> 800080 */
|
|
|
|
5, /* 7f00ff -> 800080 */
|
|
|
|
3, /* 7f7f00 -> 808000 */
|
|
|
|
8, /* 7f7f7f -> 808080 */
|
|
|
|
7, /* 7f7fff -> c0c0c0 */
|
|
|
|
3, /* 7fff00 -> 808000 */
|
|
|
|
7, /* 7fff7f -> c0c0c0 */
|
|
|
|
7, /* 7fffff -> c0c0c0 */
|
|
|
|
9, /* ff0000 -> ff0000 */
|
|
|
|
5, /* ff007f -> 800080 */
|
|
|
|
13, /* ff00ff -> ff00ff */
|
|
|
|
3, /* ff7f00 -> 808000 */
|
|
|
|
7, /* ff7f7f -> c0c0c0 */
|
|
|
|
7, /* ff7fff -> c0c0c0 */
|
|
|
|
11, /* ffff00 -> ffff00 */
|
|
|
|
7, /* ffff7f -> c0c0c0 */
|
|
|
|
15 /* ffffff -> ffffff */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define PIXEL_VALUE(r,g,b) \
|
1999-04-01 10:16:08 +02:00
|
|
|
X11DRV_PALETTE_mapEGAPixel[EGAmapping[((r)*PRIMARY_LEVELS+(g))*PRIMARY_LEVELS+(b)]]
|
1997-02-02 20:01:52 +01:00
|
|
|
|
|
|
|
/* X image for building dithered pixmap */
|
|
|
|
static XImage *ditherImage = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BRUSH_Init
|
|
|
|
*
|
|
|
|
* Create the X image used for dithering.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL X11DRV_BRUSH_Init(void)
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
2000-03-25 15:05:06 +01:00
|
|
|
XCREATEIMAGE( ditherImage, MATRIX_SIZE, MATRIX_SIZE, X11DRV_GetDepth() );
|
1997-02-02 20:01:52 +01:00
|
|
|
return (ditherImage != NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BRUSH_DitherColor
|
|
|
|
*/
|
|
|
|
static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
|
|
|
|
{
|
|
|
|
static COLORREF prevColor = 0xffffffff;
|
|
|
|
unsigned int x, y;
|
|
|
|
Pixmap pixmap;
|
|
|
|
|
1998-02-15 20:40:49 +01:00
|
|
|
EnterCriticalSection( &X11DRV_CritSection );
|
1997-02-02 20:01:52 +01:00
|
|
|
if (color != prevColor)
|
|
|
|
{
|
|
|
|
int r = GetRValue( color ) * DITHER_LEVELS;
|
|
|
|
int g = GetGValue( color ) * DITHER_LEVELS;
|
|
|
|
int b = GetBValue( color ) * DITHER_LEVELS;
|
|
|
|
const int *pmatrix = dither_matrix;
|
|
|
|
|
|
|
|
for (y = 0; y < MATRIX_SIZE; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < MATRIX_SIZE; x++)
|
|
|
|
{
|
|
|
|
int d = *pmatrix++ * 256;
|
|
|
|
int dr = ((r + d) / MATRIX_SIZE_2) / 256;
|
|
|
|
int dg = ((g + d) / MATRIX_SIZE_2) / 256;
|
|
|
|
int db = ((b + d) / MATRIX_SIZE_2) / 256;
|
1998-02-15 20:40:49 +01:00
|
|
|
XPutPixel( ditherImage, x, y, PIXEL_VALUE(dr,dg,db) );
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
prevColor = color;
|
|
|
|
}
|
|
|
|
|
1999-02-04 12:11:01 +01:00
|
|
|
pixmap = XCreatePixmap( display, X11DRV_GetXRootWindow(),
|
2000-03-25 15:05:06 +01:00
|
|
|
MATRIX_SIZE, MATRIX_SIZE, X11DRV_GetDepth() );
|
1998-02-15 20:40:49 +01:00
|
|
|
XPutImage( display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
|
1997-02-02 20:01:52 +01:00
|
|
|
0, 0, MATRIX_SIZE, MATRIX_SIZE );
|
1998-02-15 20:40:49 +01:00
|
|
|
LeaveCriticalSection( &X11DRV_CritSection );
|
1997-02-02 20:01:52 +01:00
|
|
|
return pixmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BRUSH_SelectSolidBrush
|
|
|
|
*/
|
|
|
|
static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
|
|
|
|
{
|
1998-11-25 13:36:03 +01:00
|
|
|
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
|
|
|
|
2000-03-25 15:05:06 +01:00
|
|
|
if ((dc->w.bitsPerPixel > 1) && (X11DRV_GetDepth() <= 8) && !COLOR_IsSolid( color ))
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
|
|
|
/* Dithered brush */
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.pixmap = BRUSH_DitherColor( dc, color );
|
|
|
|
physDev->brush.fillStyle = FillTiled;
|
|
|
|
physDev->brush.pixel = 0;
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Solid brush */
|
1999-04-01 10:16:08 +02:00
|
|
|
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, color );
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.fillStyle = FillSolid;
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BRUSH_SelectPatternBrush
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
1998-11-25 13:36:03 +01:00
|
|
|
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
1997-02-02 20:01:52 +01:00
|
|
|
BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
|
|
|
|
if (!bmp) return FALSE;
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
|
2000-03-28 15:37:50 +02:00
|
|
|
if(!bmp->physBitmap)
|
1998-10-28 10:53:53 +01:00
|
|
|
if(!X11DRV_CreateBitmap(hbitmap))
|
|
|
|
return 0;
|
|
|
|
|
2000-03-28 15:37:50 +02:00
|
|
|
if(bmp->funcs != dc->funcs) {
|
1999-06-26 21:09:08 +02:00
|
|
|
WARN("Trying to select non-X11 DDB into an X11 dc\n");
|
1998-10-28 10:53:53 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
if ((dc->w.bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
|
|
|
|
{
|
|
|
|
/* Special case: a color pattern on a monochrome DC */
|
1999-02-04 12:11:01 +01:00
|
|
|
physDev->brush.pixmap = TSXCreatePixmap( display, X11DRV_GetXRootWindow(), 8, 8, 1);
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
/* FIXME: should probably convert to monochrome instead */
|
2000-03-28 15:37:50 +02:00
|
|
|
TSXCopyPlane( display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-02-04 12:11:01 +01:00
|
|
|
physDev->brush.pixmap = TSXCreatePixmap( display, X11DRV_GetXRootWindow(),
|
1998-11-25 13:36:03 +01:00
|
|
|
8, 8, bmp->bitmap.bmBitsPixel );
|
2000-03-28 15:37:50 +02:00
|
|
|
TSXCopyArea( display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
|
|
|
|
}
|
1997-02-02 20:01:52 +01:00
|
|
|
|
|
|
|
if (bmp->bitmap.bmBitsPixel > 1)
|
|
|
|
{
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.fillStyle = FillTiled;
|
|
|
|
physDev->brush.pixel = 0; /* Ignored */
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.fillStyle = FillOpaqueStippled;
|
|
|
|
physDev->brush.pixel = -1; /* Special case (see DC_SetupGCForBrush) */
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
GDI_HEAP_UNLOCK( hbitmap );
|
1997-02-02 20:01:52 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BRUSH_SelectObject
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
|
|
|
HBITMAP16 hBitmap;
|
|
|
|
BITMAPINFO * bmpInfo;
|
|
|
|
HBRUSH16 prevHandle = dc->w.hBrush;
|
1998-11-25 13:36:03 +01:00
|
|
|
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
|
|
|
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("hdc=%04x hbrush=%04x\n",
|
1997-02-02 20:01:52 +01:00
|
|
|
dc->hSelf,hbrush);
|
1998-11-25 13:36:03 +01:00
|
|
|
|
1997-02-02 20:01:52 +01:00
|
|
|
dc->w.hBrush = hbrush;
|
|
|
|
|
1998-11-25 13:36:03 +01:00
|
|
|
if (physDev->brush.pixmap)
|
1997-02-02 20:01:52 +01:00
|
|
|
{
|
1998-11-25 13:36:03 +01:00
|
|
|
TSXFreePixmap( display, physDev->brush.pixmap );
|
|
|
|
physDev->brush.pixmap = 0;
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.style = brush->logbrush.lbStyle;
|
1997-02-02 20:01:52 +01:00
|
|
|
|
|
|
|
switch(brush->logbrush.lbStyle)
|
|
|
|
{
|
|
|
|
case BS_NULL:
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("BS_NULL\n" );
|
1997-02-02 20:01:52 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BS_SOLID:
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("BS_SOLID\n" );
|
1997-02-02 20:01:52 +01:00
|
|
|
BRUSH_SelectSolidBrush( dc, brush->logbrush.lbColor );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BS_HATCHED:
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("BS_HATCHED\n" );
|
1999-04-01 10:16:08 +02:00
|
|
|
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, brush->logbrush.lbColor );
|
1999-02-04 12:11:01 +01:00
|
|
|
physDev->brush.pixmap = TSXCreateBitmapFromData( display, X11DRV_GetXRootWindow(),
|
1997-02-02 20:01:52 +01:00
|
|
|
HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
|
1998-11-25 13:36:03 +01:00
|
|
|
physDev->brush.fillStyle = FillStippled;
|
1997-02-02 20:01:52 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BS_PATTERN:
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("BS_PATTERN\n");
|
1997-02-02 20:01:52 +01:00
|
|
|
BRUSH_SelectPatternBrush( dc, (HBRUSH16)brush->logbrush.lbHatch );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BS_DIBPATTERN:
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("BS_DIBPATTERN\n");
|
1997-02-02 20:01:52 +01:00
|
|
|
if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)brush->logbrush.lbHatch )))
|
|
|
|
{
|
|
|
|
int size = DIB_BitmapInfoSize( bmpInfo, brush->logbrush.lbColor );
|
1999-02-26 12:11:13 +01:00
|
|
|
hBitmap = CreateDIBitmap( dc->hSelf, &bmpInfo->bmiHeader,
|
1997-02-02 20:01:52 +01:00
|
|
|
CBM_INIT, ((char *)bmpInfo) + size,
|
|
|
|
bmpInfo,
|
|
|
|
(WORD)brush->logbrush.lbColor );
|
|
|
|
BRUSH_SelectPatternBrush( dc, hBitmap );
|
|
|
|
DeleteObject16( hBitmap );
|
|
|
|
GlobalUnlock16( (HGLOBAL16)brush->logbrush.lbHatch );
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return prevHandle;
|
|
|
|
}
|
1999-02-04 12:11:01 +01:00
|
|
|
|
|
|
|
#endif /* !defined(X_DISPLAY_MISSING) */
|
|
|
|
|