Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
37fda71e
Commit
37fda71e
authored
Mar 04, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of the X11DRV_DC_Funcs hack.
Removed a couple of unused bitmap functions.
parent
b0c9f6a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
87 deletions
+13
-87
bitmap.c
dlls/x11drv/bitmap.c
+11
-77
dib.c
dlls/x11drv/dib.c
+1
-1
init.c
dlls/x11drv/init.c
+0
-5
x11drv.h
dlls/x11drv/x11drv.h
+1
-4
No files found.
dlls/x11drv/bitmap.c
View file @
37fda71e
...
...
@@ -37,8 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
GC
BITMAP_monoGC
=
0
,
BITMAP_colorGC
=
0
;
Pixmap
BITMAP_stock_pixmap
;
/* pixmap for the default stock bitmap */
extern
const
struct
tagDC_FUNCS
*
X11DRV_DC_Funcs
;
/* hack */
/***********************************************************************
* X11DRV_BITMAP_Init
*/
...
...
@@ -440,9 +438,10 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap )
* Note: This function makes the bitmap an owner of the Pixmap so subsequently
* calling DeleteObject on this will free the Pixmap as well.
*/
HBITMAP
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
Pixmap
pixmap
)
HBITMAP
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
HDC
hdc
,
Pixmap
pixmap
)
{
HBITMAP
hBmp
=
0
;
HDC
hdcMem
;
HBITMAP
hBmp
=
0
,
old
;
BITMAPOBJ
*
pBmp
=
NULL
;
Window
root
;
int
x
,
y
;
/* Unused */
...
...
@@ -465,90 +464,25 @@ HBITMAP X11DRV_BITMAP_CreateBitmapHeaderFromPixmap(Pixmap pixmap)
*/
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
depth
,
NULL
);
/* force bitmap to be owned by a screen DC */
hdcMem
=
CreateCompatibleDC
(
hdc
);
old
=
SelectObject
(
hdcMem
,
hBmp
);
pBmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hBmp
,
BITMAP_MAGIC
);
pBmp
->
funcs
=
X11DRV_DC_Funcs
;
if
(
pBmp
->
physBitmap
)
XFreePixmap
(
gdi_display
,
(
Pixmap
)
pBmp
->
physBitmap
)
;
pBmp
->
physBitmap
=
(
void
*
)
pixmap
;
GDI_ReleaseObj
(
hBmp
);
SelectObject
(
hdcMem
,
old
);
DeleteDC
(
hdcMem
);
END:
TRACE
(
"
\t
Returning HBITMAP %p
\n
"
,
hBmp
);
return
hBmp
;
}
/**************************************************************************
* X11DRV_BITMAP_CreateBitmapFromPixmap
*
* Allocates an HBITMAP and copies the Pixmap data into it.
* If bDeletePixmap is TRUE, the Pixmap passed in is deleted after the conversion.
*/
HBITMAP
X11DRV_BITMAP_CreateBitmapFromPixmap
(
Pixmap
pixmap
,
BOOL
bDeletePixmap
)
{
HBITMAP
hBmp
=
0
,
hBmpCopy
=
0
;
BITMAPOBJ
*
pBmp
=
NULL
;
unsigned
int
width
,
height
;
/* Allocate an HBITMAP which references the Pixmap passed to us */
hBmp
=
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
pixmap
);
if
(
!
hBmp
)
{
TRACE
(
"
\t
Could not create bitmap header for Pixmap
\n
"
);
goto
END
;
}
/* Get the bitmap dimensions */
width
=
pBmp
->
bitmap
.
bmWidth
;
height
=
pBmp
->
bitmap
.
bmHeight
;
hBmpCopy
=
(
HBITMAP
)
CopyImage
(
hBmp
,
IMAGE_BITMAP
,
width
,
height
,
LR_CREATEDIBSECTION
);
/* We can now get rid of the HBITMAP wrapper we created earlier.
* Note: Simply calling DeleteObject will free the embedded Pixmap as well.
*/
if
(
!
bDeletePixmap
)
{
/* Manually clear the bitmap internals to prevent the Pixmap
* from being deleted by DeleteObject.
*/
pBmp
->
physBitmap
=
NULL
;
pBmp
->
funcs
=
NULL
;
}
DeleteObject
(
hBmp
);
END:
TRACE
(
"
\t
Returning HBITMAP %p
\n
"
,
hBmpCopy
);
return
hBmpCopy
;
}
/**************************************************************************
* X11DRV_BITMAP_CreatePixmapFromBitmap
*
* Creates a Pixmap from a bitmap
*/
Pixmap
X11DRV_BITMAP_CreatePixmapFromBitmap
(
HBITMAP
hBmp
,
HDC
hdc
)
{
HGLOBAL
hPackedDIB
=
0
;
Pixmap
pixmap
=
0
;
/*
* Create a packed DIB from the bitmap passed to us.
* A packed DIB contains a BITMAPINFO structure followed immediately by
* an optional color palette and the pixel data.
*/
hPackedDIB
=
X11DRV_DIB_CreateDIBFromBitmap
(
hdc
,
hBmp
);
/* Create a Pixmap from the packed DIB */
pixmap
=
X11DRV_DIB_CreatePixmapFromDIB
(
hPackedDIB
,
hdc
);
/* Free the temporary packed DIB */
GlobalFree
(
hPackedDIB
);
return
pixmap
;
}
/***********************************************************************
* X11DRV_BITMAP_Pixmap
*
...
...
dlls/x11drv/dib.c
View file @
37fda71e
...
...
@@ -4853,7 +4853,7 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc, BOOL bDeletePixma
HGLOBAL
hPackedDIB
=
0
;
/* Allocates an HBITMAP which references the Pixmap passed to us */
hBmp
=
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
pixmap
);
hBmp
=
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
hdc
,
pixmap
);
if
(
!
hBmp
)
{
TRACE
(
"
\t
Could not create bitmap header for Pixmap
\n
"
);
...
...
dlls/x11drv/init.c
View file @
37fda71e
...
...
@@ -33,8 +33,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
x11drv
);
const
struct
tagDC_FUNCS
*
X11DRV_DC_Funcs
=
NULL
;
/* hack */
Display
*
gdi_display
;
/* display to use for all GDI functions */
/* a few dynamic device caps */
...
...
@@ -92,14 +90,11 @@ BOOL X11DRV_CreateDC( DC *dc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR dev
{
X11DRV_PDEVICE
*
physDev
;
if
(
!
X11DRV_DC_Funcs
)
X11DRV_DC_Funcs
=
dc
->
funcs
;
/* hack */
physDev
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
physDev
)
);
if
(
!
physDev
)
return
FALSE
;
*
pdev
=
physDev
;
physDev
->
hdc
=
dc
->
hSelf
;
physDev
->
dc
=
dc
;
/* FIXME */
if
(
GetObjectType
(
dc
->
hSelf
)
==
OBJ_MEMDC
)
{
...
...
dlls/x11drv/x11drv.h
View file @
37fda71e
...
...
@@ -86,7 +86,6 @@ typedef struct tagXRENDERINFO *XRENDERINFO;
typedef
struct
{
HDC
hdc
;
struct
tagDC
*
dc
;
/* direct pointer to DC, should go away */
GC
gc
;
/* X Window GC */
Drawable
drawable
;
POINT
org
;
/* DC origin relative to drawable */
...
...
@@ -200,12 +199,10 @@ struct tagBITMAPOBJ;
extern
int
X11DRV_DIB_BitmapInfoSize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
);
extern
XImage
*
X11DRV_BITMAP_GetXImage
(
const
struct
tagBITMAPOBJ
*
bmp
);
extern
XImage
*
X11DRV_DIB_CreateXImage
(
int
width
,
int
height
,
int
depth
);
extern
HBITMAP
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
Pixmap
pixmap
);
extern
HBITMAP
X11DRV_BITMAP_CreateBitmapHeaderFromPixmap
(
HDC
hdc
,
Pixmap
pixmap
);
extern
HGLOBAL
X11DRV_DIB_CreateDIBFromBitmap
(
HDC
hdc
,
HBITMAP
hBmp
);
extern
HGLOBAL
X11DRV_DIB_CreateDIBFromPixmap
(
Pixmap
pixmap
,
HDC
hdc
,
BOOL
bDeletePixmap
);
extern
HBITMAP
X11DRV_BITMAP_CreateBitmapFromPixmap
(
Pixmap
pixmap
,
BOOL
bDeletePixmap
);
extern
Pixmap
X11DRV_DIB_CreatePixmapFromDIB
(
HGLOBAL
hPackedDIB
,
HDC
hdc
);
extern
Pixmap
X11DRV_BITMAP_CreatePixmapFromBitmap
(
HBITMAP
hBmp
,
HDC
hdc
);
extern
RGNDATA
*
X11DRV_GetRegionData
(
HRGN
hrgn
,
HDC
hdc_lptodp
);
...
...
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