Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a08e2cf1
Commit
a08e2cf1
authored
Mar 28, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged DDBitmap and physBitmap into the generic bitmap structure
(suggested by Andrew Lewycky).
parent
199aebaa
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
167 deletions
+69
-167
bitmap.c
graphics/ttydrv/bitmap.c
+8
-14
bitmap.c
graphics/x11drv/bitmap.c
+21
-77
brush.c
graphics/x11drv/brush.c
+4
-7
dib.c
graphics/x11drv/dib.c
+13
-28
init.c
graphics/x11drv/init.c
+3
-5
oembitmap.c
graphics/x11drv/oembitmap.c
+6
-10
bitmap.h
include/bitmap.h
+2
-8
x11drv.h
include/x11drv.h
+2
-5
bitmap.c
objects/bitmap.c
+10
-13
No files found.
graphics/ttydrv/bitmap.c
View file @
a08e2cf1
...
...
@@ -24,19 +24,13 @@ TTYDRV_PHYSBITMAP *TTYDRV_DC_AllocBitmap(BITMAPOBJ *bitmap)
{
TTYDRV_PHYSBITMAP
*
physBitmap
;
if
(
!
(
bitmap
->
DDBitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DDBITMAP
))))
{
ERR
(
"Can't alloc DDBITMAP
\n
"
);
return
NULL
;
}
if
(
!
(
physBitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
TTYDRV_PHYSBITMAP
))))
{
ERR
(
"Can't alloc TTYDRV_PHYSBITMAP
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
->
DDBitmap
);
return
NULL
;
}
bitmap
->
DDBitmap
->
physBitmap
=
physBitmap
;
bitmap
->
DDBitmap
->
funcs
=
DRIVER_FindDriver
(
"DISPLAY"
);
bitmap
->
physBitmap
=
physBitmap
;
bitmap
->
funcs
=
DRIVER_FindDriver
(
"DISPLAY"
);
return
physBitmap
;
}
...
...
@@ -102,10 +96,10 @@ BOOL TTYDRV_DC_BITMAP_DeleteObject(HBITMAP hbitmap, BITMAPOBJ *bitmap)
{
TRACE
(
"(0x%04x, %p)
\n
"
,
hbitmap
,
bitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
->
DDBitmap
)
;
bitmap
->
DDBitmap
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
->
physBitmap
);
bitmap
->
physBitmap
=
NULL
;
bitmap
->
funcs
=
NULL
;
return
TRUE
;
}
...
...
@@ -134,10 +128,10 @@ HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap
return
0
;
/* Assure that the bitmap device dependent */
if
(
!
bitmap
->
DD
Bitmap
&&
!
TTYDRV_DC_CreateBitmap
(
hbitmap
))
if
(
!
bitmap
->
phys
Bitmap
&&
!
TTYDRV_DC_CreateBitmap
(
hbitmap
))
return
0
;
if
(
bitmap
->
DDBitmap
->
funcs
!=
dc
->
funcs
)
{
if
(
bitmap
->
funcs
!=
dc
->
funcs
)
{
ERR
(
"Trying to select a non-TTY DDB into a TTY DC
\n
"
);
return
0
;
}
...
...
graphics/x11drv/bitmap.c
View file @
a08e2cf1
...
...
@@ -73,23 +73,20 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
{
HRGN
hrgn
;
HBITMAP
prevHandle
=
dc
->
w
.
hBitmap
;
X11DRV_PHYSBITMAP
*
pbitmap
;
X11DRV_PDEVICE
*
physDev
=
(
X11DRV_PDEVICE
*
)
dc
->
physDev
;
if
(
!
(
dc
->
w
.
flags
&
DC_MEMORY
))
return
0
;
if
(
!
bmp
->
DD
Bitmap
)
if
(
!
bmp
->
phys
Bitmap
)
if
(
!
X11DRV_CreateBitmap
(
hbitmap
))
return
0
;
if
(
bmp
->
DDBitmap
->
funcs
!=
dc
->
funcs
)
{
if
(
bmp
->
funcs
!=
dc
->
funcs
)
{
WARN
(
"Trying to select non-X11 DDB into an X11 dc
\n
"
);
return
0
;
}
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
dc
->
w
.
totalExtent
.
left
=
0
;
dc
->
w
.
totalExtent
.
top
=
0
;
dc
->
w
.
totalExtent
.
right
=
bmp
->
bitmap
.
bmWidth
;
...
...
@@ -105,7 +102,7 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
dc
->
w
.
hVisRgn
=
hrgn
;
}
physDev
->
drawable
=
pbitmap
->
pix
map
;
physDev
->
drawable
=
(
Pixmap
)
bmp
->
physBit
map
;
dc
->
w
.
hBitmap
=
hbitmap
;
/* Change GC depth if needed */
...
...
@@ -139,38 +136,8 @@ struct XPutImage_descr
static
int
XPutImage_wrapper
(
const
struct
XPutImage_descr
*
descr
)
{
return
XPutImage
(
display
,
((
X11DRV_PHYSBITMAP
*
)
descr
->
bmp
->
DDBitmap
->
physBitmap
)
->
pixmap
,
BITMAP_GC
(
descr
->
bmp
),
descr
->
image
,
0
,
0
,
0
,
0
,
descr
->
width
,
descr
->
height
);
}
/***************************************************************************
*
* X11DRV_AllocBitmap
*
* Allocate DDBitmap and physBitmap
*
*/
X11DRV_PHYSBITMAP
*
X11DRV_AllocBitmap
(
BITMAPOBJ
*
bmp
)
{
X11DRV_PHYSBITMAP
*
pbitmap
;
if
(
!
(
bmp
->
DDBitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DDBITMAP
))))
{
WARN
(
"Can't alloc DDBITMAP
\n
"
);
return
NULL
;
}
if
(
!
(
pbitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
X11DRV_PHYSBITMAP
))))
{
WARN
(
"Can't alloc X11DRV_PHYSBITMAP
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
DDBitmap
);
return
NULL
;
}
bmp
->
DDBitmap
->
physBitmap
=
pbitmap
;
bmp
->
DDBitmap
->
funcs
=
DRIVER_FindDriver
(
"DISPLAY"
);
return
pbitmap
;
return
XPutImage
(
display
,
(
Pixmap
)
descr
->
bmp
->
physBitmap
,
BITMAP_GC
(
descr
->
bmp
),
descr
->
image
,
0
,
0
,
0
,
0
,
descr
->
width
,
descr
->
height
);
}
...
...
@@ -186,7 +153,6 @@ X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( BITMAPOBJ *bmp )
BOOL
X11DRV_CreateBitmap
(
HBITMAP
hbitmap
)
{
X11DRV_PHYSBITMAP
*
pbitmap
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
!
bmp
)
{
...
...
@@ -208,19 +174,16 @@ BOOL X11DRV_CreateBitmap( HBITMAP hbitmap )
TRACE
(
"(%08x) %dx%d %d bpp
\n
"
,
hbitmap
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
pbitmap
=
X11DRV_AllocBitmap
(
bmp
);
if
(
!
pbitmap
)
return
FALSE
;
/* Create the pixmap */
pbitmap
->
pixmap
=
TSXCreatePixmap
(
display
,
X11DRV_GetXRootWindow
(),
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
if
(
!
pbitmap
->
pixmap
)
{
if
(
!
(
bmp
->
physBitmap
=
(
void
*
)
TSXCreatePixmap
(
display
,
X11DRV_GetXRootWindow
(),
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
)))
{
WARN
(
"Can't create Pixmap
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
DDBitmap
);
GDI_HEAP_UNLOCK
(
hbitmap
);
return
FALSE
;
}
bmp
->
funcs
=
&
X11DRV_DC_Funcs
;
if
(
bmp
->
bitmap
.
bmBits
)
/* Set bitmap bits */
X11DRV_BitmapBits
(
hbitmap
,
bmp
->
bitmap
.
bmBits
,
...
...
@@ -239,8 +202,7 @@ BOOL X11DRV_CreateBitmap( HBITMAP hbitmap )
*/
XImage
*
X11DRV_BITMAP_GetXImage
(
const
BITMAPOBJ
*
bmp
)
{
return
XGetImage
(
display
,
((
X11DRV_PHYSBITMAP
*
)
bmp
->
DDBitmap
->
physBitmap
)
->
pixmap
,
return
XGetImage
(
display
,
(
Pixmap
)
bmp
->
physBitmap
,
0
,
0
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
AllPlanes
,
ZPixmap
);
}
...
...
@@ -521,14 +483,9 @@ LONG X11DRV_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags)
*/
BOOL
X11DRV_BITMAP_DeleteObject
(
HBITMAP
hbitmap
,
BITMAPOBJ
*
bmp
)
{
X11DRV_PHYSBITMAP
*
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
TSXFreePixmap
(
display
,
pbitmap
->
pixmap
);
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
DDBitmap
);
bmp
->
DDBitmap
=
NULL
;
TSXFreePixmap
(
display
,
(
Pixmap
)
bmp
->
physBitmap
);
bmp
->
physBitmap
=
NULL
;
bmp
->
funcs
=
NULL
;
return
TRUE
;
}
...
...
@@ -543,7 +500,6 @@ HBITMAP X11DRV_BITMAP_CreateBitmapHeaderFromPixmap(Pixmap pixmap)
{
HBITMAP
hBmp
=
0
;
BITMAPOBJ
*
pBmp
=
NULL
;
X11DRV_PHYSBITMAP
*
pPhysBmp
=
NULL
;
Window
root
;
int
x
,
y
;
/* Unused */
unsigned
border_width
;
/* Unused */
...
...
@@ -563,20 +519,10 @@ HBITMAP X11DRV_BITMAP_CreateBitmapHeaderFromPixmap(Pixmap pixmap)
*/
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
depth
,
NULL
);
/* Allocate DDBitmap and physBitmap structures in BITMAPOBJ.
* The hBmp is just a filled in BITMAPOBJ header at this point.
*/
pBmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hBmp
,
BITMAP_MAGIC
);
pPhysBmp
=
X11DRV_AllocBitmap
(
pBmp
);
if
(
!
pPhysBmp
)
{
DeleteObject
(
hBmp
);
hBmp
=
NULL
;
goto
END
;
}
/* Point to our Pixmap in the physical bitmap structure */
p
PhysBmp
->
pixmap
=
pixmap
;
pBmp
->
funcs
=
&
X11DRV_DC_Funcs
;
p
Bmp
->
physBitmap
=
(
void
*
)
pixmap
;
END:
TRACE
(
"
\t
Returning HBITMAP %x
\n
"
,
hBmp
);
...
...
@@ -615,13 +561,11 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap)
*/
if
(
!
bDeletePixmap
)
{
/* Manually
free the DDB
itmap internals to prevent the Pixmap
/* Manually
clear the b
itmap internals to prevent the Pixmap
* from being deleted by DeleteObject.
*/
pBmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hBmp
,
BITMAP_MAGIC
);
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
);
pBmp
->
DDBitmap
=
NULL
;
pBmp
->
physBitmap
=
NULL
;
pBmp
->
funcs
=
NULL
;
}
DeleteObject
(
hBmp
);
...
...
@@ -663,10 +607,10 @@ Pixmap X11DRV_BITMAP_CreatePixmapFromBitmap( HBITMAP hBmp, HDC hdc )
*
* This function exists solely for x11 driver of the window system.
*/
BOOL
X11DRV_BITMAP_Pixmap
(
HBITMAP
hbitmap
)
Pixmap
X11DRV_BITMAP_Pixmap
(
HBITMAP
hbitmap
)
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
return
(
(
X11DRV_PHYSBITMAP
*
)(
bmp
->
DDBitmap
->
physBitmap
))
->
pix
map
;
return
(
Pixmap
)
bmp
->
physBit
map
;
}
#endif
/* !defined(X_DISPLAY_MISSING) */
graphics/x11drv/brush.c
View file @
a08e2cf1
...
...
@@ -174,35 +174,32 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
*/
static
BOOL
BRUSH_SelectPatternBrush
(
DC
*
dc
,
HBITMAP
hbitmap
)
{
X11DRV_PHYSBITMAP
*
pbitmap
;
X11DRV_PDEVICE
*
physDev
=
(
X11DRV_PDEVICE
*
)
dc
->
physDev
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
!
bmp
)
return
FALSE
;
if
(
!
bmp
->
DD
Bitmap
)
if
(
!
bmp
->
phys
Bitmap
)
if
(
!
X11DRV_CreateBitmap
(
hbitmap
))
return
0
;
if
(
bmp
->
DDBitmap
->
funcs
!=
dc
->
funcs
)
{
if
(
bmp
->
funcs
!=
dc
->
funcs
)
{
WARN
(
"Trying to select non-X11 DDB into an X11 dc
\n
"
);
return
0
;
}
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
if
((
dc
->
w
.
bitsPerPixel
==
1
)
&&
(
bmp
->
bitmap
.
bmBitsPixel
!=
1
))
{
/* Special case: a color pattern on a monochrome DC */
physDev
->
brush
.
pixmap
=
TSXCreatePixmap
(
display
,
X11DRV_GetXRootWindow
(),
8
,
8
,
1
);
/* FIXME: should probably convert to monochrome instead */
TSXCopyPlane
(
display
,
pbitmap
->
pix
map
,
physDev
->
brush
.
pixmap
,
TSXCopyPlane
(
display
,
(
Pixmap
)
bmp
->
physBit
map
,
physDev
->
brush
.
pixmap
,
BITMAP_monoGC
,
0
,
0
,
8
,
8
,
0
,
0
,
1
);
}
else
{
physDev
->
brush
.
pixmap
=
TSXCreatePixmap
(
display
,
X11DRV_GetXRootWindow
(),
8
,
8
,
bmp
->
bitmap
.
bmBitsPixel
);
TSXCopyArea
(
display
,
pbitmap
->
pix
map
,
physDev
->
brush
.
pixmap
,
TSXCopyArea
(
display
,
(
Pixmap
)
bmp
->
physBit
map
,
physDev
->
brush
.
pixmap
,
BITMAP_GC
(
bmp
),
0
,
0
,
8
,
8
,
0
,
0
);
}
...
...
graphics/x11drv/dib.c
View file @
a08e2cf1
...
...
@@ -2781,7 +2781,6 @@ INT X11DRV_DIB_SetDIBits(
UINT
coloruse
,
HBITMAP
hbitmap
)
{
X11DRV_DIB_IMAGEBITS_DESCR
descr
;
X11DRV_PHYSBITMAP
*
pbitmap
;
int
height
,
tmpheight
;
INT
result
;
...
...
@@ -2834,17 +2833,15 @@ INT X11DRV_DIB_SetDIBits(
}
/* HACK for now */
if
(
!
bmp
->
DD
Bitmap
)
if
(
!
bmp
->
phys
Bitmap
)
X11DRV_CreateBitmap
(
hbitmap
);
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
descr
.
bits
=
bits
;
descr
.
image
=
NULL
;
descr
.
palentry
=
NULL
;
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
depth
=
bmp
->
bitmap
.
bmBitsPixel
;
descr
.
drawable
=
pbitmap
->
pix
map
;
descr
.
drawable
=
(
Pixmap
)
bmp
->
physBit
map
;
descr
.
gc
=
BITMAP_GC
(
bmp
);
descr
.
xSrc
=
0
;
descr
.
ySrc
=
0
;
...
...
@@ -2873,7 +2870,6 @@ INT X11DRV_DIB_GetDIBits(
{
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
X11DRV_DIB_IMAGEBITS_DESCR
descr
;
X11DRV_PHYSBITMAP
*
pbitmap
;
PALETTEOBJ
*
palette
;
TRACE
(
"%u scanlines of (%i,%i) -> (%i,%i) starting from %u
\n
"
,
...
...
@@ -2914,17 +2910,16 @@ INT X11DRV_DIB_GetDIBits(
}
/* Hack for now */
if
(
!
bmp
->
DD
Bitmap
)
if
(
!
bmp
->
phys
Bitmap
)
X11DRV_CreateBitmap
(
hbitmap
);
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
descr
.
dc
=
dc
;
descr
.
palentry
=
palette
->
logpalette
.
palPalEntry
;
descr
.
bits
=
bits
;
descr
.
lines
=
lines
;
descr
.
depth
=
bmp
->
bitmap
.
bmBitsPixel
;
descr
.
drawable
=
pbitmap
->
pix
map
;
descr
.
drawable
=
(
Pixmap
)
bmp
->
physBit
map
;
descr
.
gc
=
BITMAP_GC
(
bmp
);
descr
.
xSrc
=
0
;
descr
.
ySrc
=
startscan
;
...
...
@@ -3018,7 +3013,7 @@ static void X11DRV_DIB_DoUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
}
/* Hack for now */
descr
.
drawable
=
(
(
X11DRV_PHYSBITMAP
*
)
bmp
->
DDBitmap
->
physBitmap
)
->
pix
map
;
descr
.
drawable
=
(
Pixmap
)
bmp
->
physBit
map
;
descr
.
gc
=
BITMAP_GC
(
bmp
);
descr
.
xSrc
=
0
;
descr
.
ySrc
=
0
;
...
...
@@ -3375,7 +3370,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
{
bmp
->
dib
=
(
DIBSECTION
*
)
dib
;
/* HACK for now */
if
(
!
bmp
->
DD
Bitmap
)
if
(
!
bmp
->
phys
Bitmap
)
X11DRV_CreateBitmap
(
res
);
}
}
...
...
@@ -3496,12 +3491,9 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc, BOOL bDeletePixma
*/
if
(
!
bDeletePixmap
)
{
/* Manually free the DDBitmap internals to prevent the Pixmap
* from being deleted by DeleteObject.
*/
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
);
pBmp
->
DDBitmap
=
NULL
;
/* Clear the physBitmap to prevent the Pixmap from being deleted by DeleteObject */
pBmp
->
physBitmap
=
NULL
;
pBmp
->
funcs
=
NULL
;
}
DeleteObject
(
hBmp
);
...
...
@@ -3550,17 +3542,10 @@ Pixmap X11DRV_DIB_CreatePixmapFromDIB( HGLOBAL hPackedDIB, HDC hdc )
pBmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hBmp
,
BITMAP_MAGIC
);
if
(
pBmp
->
DDBitmap
&&
pBmp
->
DDBitmap
->
physBitmap
)
{
pixmap
=
((
X11DRV_PHYSBITMAP
*
)(
pBmp
->
DDBitmap
->
physBitmap
))
->
pixmap
;
if
(
!
pixmap
)
TRACE
(
"NULL Pixmap in DDBitmap->physBitmap!
\n
"
);
/* Manually free the BITMAPOBJ internals so that we can steal its pixmap */
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
->
physBitmap
);
HeapFree
(
GetProcessHeap
(),
0
,
pBmp
->
DDBitmap
);
pBmp
->
DDBitmap
=
NULL
;
/* Its not a DDB anymore */
}
pixmap
=
(
Pixmap
)
pBmp
->
physBitmap
;
/* clear the physBitmap so that we can steal its pixmap */
pBmp
->
physBitmap
=
NULL
;
pBmp
->
funcs
=
NULL
;
/* Delete the DDB we created earlier now that we have stolen its pixmap */
DeleteObject
(
hBmp
);
...
...
graphics/x11drv/init.c
View file @
a08e2cf1
...
...
@@ -30,7 +30,7 @@ static BOOL X11DRV_DeleteDC( DC *dc );
static
INT
X11DRV_Escape
(
DC
*
dc
,
INT
nEscape
,
INT
cbInput
,
SEGPTR
lpInData
,
SEGPTR
lpOutData
);
static
const
DC_FUNCTIONS
X11DRV
_Funcs
=
const
DC_FUNCTIONS
X11DRV_DC
_Funcs
=
{
NULL
,
/* pAbortDoc */
NULL
,
/* pAbortPath */
...
...
@@ -210,7 +210,7 @@ BOOL X11DRV_GDI_Initialize(void)
if
(
!
X11DRV_FONT_Init
(
&
X11DRV_DevCaps
))
return
FALSE
;
return
DRIVER_RegisterDriver
(
"DISPLAY"
,
&
X11DRV_Funcs
);
return
DRIVER_RegisterDriver
(
"DISPLAY"
,
&
X11DRV_
DC_
Funcs
);
}
/**********************************************************************
...
...
@@ -239,12 +239,10 @@ static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
dc
->
w
.
devCaps
=
&
X11DRV_DevCaps
;
if
(
dc
->
w
.
flags
&
DC_MEMORY
)
{
X11DRV_PHYSBITMAP
*
pbitmap
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
dc
->
w
.
hBitmap
,
BITMAP_MAGIC
);
X11DRV_CreateBitmap
(
dc
->
w
.
hBitmap
);
pbitmap
=
bmp
->
DDBitmap
->
physBitmap
;
physDev
->
drawable
=
pbitmap
->
pixmap
;
physDev
->
drawable
=
(
Pixmap
)
bmp
->
physBitmap
;
physDev
->
gc
=
TSXCreateGC
(
display
,
physDev
->
drawable
,
0
,
NULL
);
dc
->
w
.
bitsPerPixel
=
bmp
->
bitmap
.
bmBitsPixel
;
...
...
graphics/x11drv/oembitmap.c
View file @
a08e2cf1
...
...
@@ -345,7 +345,6 @@ static HBITMAP16 OBM_MakeBitmap( WORD width, WORD height,
{
HBITMAP16
hbitmap
;
BITMAPOBJ
*
bmpObjPtr
;
X11DRV_PHYSBITMAP
*
pbitmap
;
if
(
!
pixmap
)
return
0
;
...
...
@@ -364,9 +363,8 @@ static HBITMAP16 OBM_MakeBitmap( WORD width, WORD height,
bmpObjPtr
->
bitmap
.
bmBits
=
NULL
;
bmpObjPtr
->
dib
=
NULL
;
pbitmap
=
X11DRV_AllocBitmap
(
bmpObjPtr
);
pbitmap
->
pixmap
=
pixmap
;
bmpObjPtr
->
funcs
=
&
X11DRV_DC_Funcs
;
bmpObjPtr
->
physBitmap
=
(
void
*
)
pixmap
;
GDI_HEAP_UNLOCK
(
hbitmap
);
return
hbitmap
;
...
...
@@ -532,11 +530,10 @@ static HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL fCursor )
if
(
descr
.
mask
)
{
X11DRV_PHYSBITMAP
*
pbitmapAnd
=
bmpAnd
->
DDBitmap
->
physBitmap
;
/* Invert the mask */
TSXSetFunction
(
display
,
BITMAP_monoGC
,
GXinvert
);
TSXFillRectangle
(
display
,
pbitmapAnd
->
pix
map
,
BITMAP_monoGC
,
0
,
0
,
TSXFillRectangle
(
display
,
(
Pixmap
)
bmpAnd
->
physBit
map
,
BITMAP_monoGC
,
0
,
0
,
bmpAnd
->
bitmap
.
bmWidth
,
bmpAnd
->
bitmap
.
bmHeight
);
TSXSetFunction
(
display
,
BITMAP_monoGC
,
GXcopy
);
...
...
@@ -544,14 +541,13 @@ static HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL fCursor )
if
(
bmpXor
->
bitmap
.
bmBitsPixel
!=
1
)
{
X11DRV_PHYSBITMAP
*
pbitmapXor
=
bmpXor
->
DDBitmap
->
physBitmap
;
TSXSetForeground
(
display
,
BITMAP_colorGC
,
X11DRV_PALETTE_ToPhysical
(
NULL
,
RGB
(
0
,
0
,
0
)
));
TSXSetBackground
(
display
,
BITMAP_colorGC
,
0
);
TSXSetFunction
(
display
,
BITMAP_colorGC
,
GXor
);
TSXCopyPlane
(
display
,
pbitmapAnd
->
pixmap
,
pbitmapXor
->
pixmap
,
BITMAP_colorGC
,
0
,
0
,
bmpXor
->
bitmap
.
bmWidth
,
bmpXor
->
bitmap
.
bmHeight
,
0
,
0
,
1
);
TSXCopyPlane
(
display
,
(
Pixmap
)
bmpAnd
->
physBitmap
,
(
Pixmap
)
bmpXor
->
physBitmap
,
BITMAP_colorGC
,
0
,
0
,
bmpXor
->
bitmap
.
bmWidth
,
bmpXor
->
bitmap
.
bmHeight
,
0
,
0
,
1
);
TSXSetFunction
(
display
,
BITMAP_colorGC
,
GXcopy
);
}
}
...
...
include/bitmap.h
View file @
a08e2cf1
...
...
@@ -18,20 +18,14 @@ struct tagGDI_BITMAP_DRIVER;
#define DDB_COPY 4
#define DDB_SETWITHFILLER 8
typedef
struct
{
const
struct
tagDC_FUNCS
*
funcs
;
/* DC function table */
void
*
physBitmap
;
/* ptr to device specific data */
}
DDBITMAP
;
/* GDI logical bitmap object */
typedef
struct
tagBITMAPOBJ
{
GDIOBJHDR
header
;
BITMAP
bitmap
;
SIZE
size
;
/* For SetBitmapDimension() */
DDBITMAP
*
DDBitmap
;
const
struct
tagDC_FUNCS
*
funcs
;
/* DC function table */
void
*
physBitmap
;
/* ptr to device specific data */
/* For device-independent bitmaps: */
DIBSECTION
*
dib
;
}
BITMAPOBJ
;
...
...
include/x11drv.h
View file @
a08e2cf1
...
...
@@ -70,10 +70,6 @@ typedef struct
}
X11DRV_PDEVICE
;
typedef
struct
{
Pixmap
pixmap
;
}
X11DRV_PHYSBITMAP
;
/* GCs used for B&W and color bitmap operations */
extern
GC
BITMAP_monoGC
,
BITMAP_colorGC
;
...
...
@@ -84,6 +80,8 @@ extern DeviceCaps X11DRV_DevCaps;
/* Wine driver X11 functions */
extern
const
DC_FUNCTIONS
X11DRV_DC_Funcs
;
extern
BOOL
X11DRV_BitBlt
(
struct
tagDC
*
dcDst
,
INT
xDst
,
INT
yDst
,
INT
width
,
INT
height
,
struct
tagDC
*
dcSrc
,
INT
xSrc
,
INT
ySrc
,
DWORD
rop
);
...
...
@@ -167,7 +165,6 @@ struct tagBITMAPOBJ;
extern
XImage
*
X11DRV_BITMAP_GetXImage
(
const
struct
tagBITMAPOBJ
*
bmp
);
extern
int
X11DRV_DIB_GetXImageWidthBytes
(
int
width
,
int
depth
);
extern
BOOL
X11DRV_DIB_Init
(
void
);
extern
X11DRV_PHYSBITMAP
*
X11DRV_AllocBitmap
(
struct
tagBITMAPOBJ
*
bmp
);
extern
HBITMAP
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
Pixmap
pixmap
);
extern
HGLOBAL
X11DRV_DIB_CreateDIBFromPixmap
(
Pixmap
pixmap
,
HDC
hdc
,
BOOL
bDeletePixmap
);
extern
HBITMAP
X11DRV_BITMAP_CreateBitmapFromPixmap
(
Pixmap
pixmap
,
BOOL
bDeletePixmap
);
...
...
objects/bitmap.c
View file @
a08e2cf1
...
...
@@ -140,7 +140,8 @@ HBITMAP WINAPI CreateBitmap( INT width, INT height, UINT planes,
bmp
->
bitmap
.
bmWidthBytes
=
BITMAP_GetWidthBytes
(
width
,
bpp
);
bmp
->
bitmap
.
bmBits
=
NULL
;
bmp
->
DDBitmap
=
NULL
;
bmp
->
funcs
=
NULL
;
bmp
->
physBitmap
=
NULL
;
bmp
->
dib
=
NULL
;
if
(
bits
)
/* Set bitmap bits */
...
...
@@ -273,12 +274,11 @@ LONG WINAPI GetBitmapBits(
hbitmap
,
count
,
bits
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
1
<<
bmp
->
bitmap
.
bmBitsPixel
,
height
);
if
(
bmp
->
DDBitmap
)
{
if
(
bmp
->
funcs
)
{
TRACE
(
"Calling device specific BitmapBits
\n
"
);
if
(
bmp
->
DDBitmap
->
funcs
->
pBitmapBits
)
ret
=
bmp
->
DDBitmap
->
funcs
->
pBitmapBits
(
hbitmap
,
bits
,
count
,
DDB_GET
);
if
(
bmp
->
funcs
->
pBitmapBits
)
ret
=
bmp
->
funcs
->
pBitmapBits
(
hbitmap
,
bits
,
count
,
DDB_GET
);
else
{
ERR
(
"BitmapBits == NULL??
\n
"
);
ret
=
0
;
...
...
@@ -342,12 +342,11 @@ LONG WINAPI SetBitmapBits(
hbitmap
,
count
,
bits
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
1
<<
bmp
->
bitmap
.
bmBitsPixel
,
height
);
if
(
bmp
->
DDBitmap
)
{
if
(
bmp
->
funcs
)
{
TRACE
(
"Calling device specific BitmapBits
\n
"
);
if
(
bmp
->
DDBitmap
->
funcs
->
pBitmapBits
)
ret
=
bmp
->
DDBitmap
->
funcs
->
pBitmapBits
(
hbitmap
,
(
void
*
)
bits
,
count
,
DDB_SET
);
if
(
bmp
->
funcs
->
pBitmapBits
)
ret
=
bmp
->
funcs
->
pBitmapBits
(
hbitmap
,
(
void
*
)
bits
,
count
,
DDB_SET
);
else
{
ERR
(
"BitmapBits == NULL??
\n
"
);
ret
=
0
;
...
...
@@ -403,10 +402,8 @@ HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap)
*/
BOOL
BITMAP_DeleteObject
(
HBITMAP16
hbitmap
,
BITMAPOBJ
*
bmp
)
{
if
(
bmp
->
DDBitmap
)
{
if
(
bmp
->
DDBitmap
->
funcs
->
pDeleteObject
)
bmp
->
DDBitmap
->
funcs
->
pDeleteObject
(
hbitmap
);
}
if
(
bmp
->
funcs
&&
bmp
->
funcs
->
pDeleteObject
)
bmp
->
funcs
->
pDeleteObject
(
hbitmap
);
if
(
bmp
->
bitmap
.
bmBits
)
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
bitmap
.
bmBits
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment