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
a1e31397
Commit
a1e31397
authored
Sep 27, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't pass an object pointer to the SelectObject backend functions.
parent
e36ed761
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
33 deletions
+44
-33
bitmap.c
dlls/gdi32/bitmap.c
+19
-12
brush.c
dlls/gdi32/brush.c
+17
-13
font.c
dlls/gdi32/font.c
+2
-2
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
gdiobj.c
dlls/gdi32/gdiobj.c
+1
-1
pen.c
dlls/gdi32/pen.c
+2
-2
region.c
dlls/gdi32/region.c
+2
-2
No files found.
dlls/gdi32/bitmap.c
View file @
a1e31397
...
...
@@ -33,7 +33,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
bitmap
);
static
HGDIOBJ
BITMAP_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
static
HGDIOBJ
BITMAP_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
BITMAP_GetObject16
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
BITMAP_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
BITMAP_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
...
...
@@ -554,32 +554,38 @@ BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc )
/***********************************************************************
* BITMAP_SelectObject
*/
static
HGDIOBJ
BITMAP_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
)
static
HGDIOBJ
BITMAP_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
HGDIOBJ
ret
;
BITMAPOBJ
*
bitmap
=
obj
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
)
;
BITMAPOBJ
*
bitmap
;
DC
*
dc
;
if
(
!
dc
)
return
0
;
if
(
GetObjectType
(
hdc
)
!=
OBJ_MEMDC
)
if
(
!
(
bitmap
=
GDI_GetObjPtr
(
handle
,
BITMAP_MAGIC
)))
return
0
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
{
DC_ReleaseDCPtr
(
dc
);
GDI_ReleaseObj
(
handle
);
return
0
;
}
if
(
GetObjectType
(
hdc
)
!=
OBJ_MEMDC
)
{
ret
=
0
;
goto
done
;
}
ret
=
dc
->
hBitmap
;
if
(
handle
==
dc
->
hBitmap
)
goto
done
;
/* nothing to do */
if
(
bitmap
->
header
.
dwCount
&&
(
handle
!=
GetStockObject
(
DEFAULT_BITMAP
)))
{
WARN
(
"Bitmap already selected in another DC
\n
"
);
DC_ReleaseDCPtr
(
dc
)
;
return
0
;
ret
=
0
;
goto
done
;
}
if
(
!
bitmap
->
funcs
&&
!
BITMAP_SetOwnerDC
(
handle
,
dc
))
{
DC_ReleaseDCPtr
(
dc
)
;
return
0
;
ret
=
0
;
goto
done
;
}
if
(
dc
->
funcs
->
pSelectBitmap
)
handle
=
dc
->
funcs
->
pSelectBitmap
(
dc
->
physDev
,
handle
);
...
...
@@ -594,7 +600,8 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
else
ret
=
0
;
done:
DC_ReleaseDCPtr
(
dc
);
GDI_ReleaseObj
(
handle
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/brush.c
View file @
a1e31397
...
...
@@ -42,7 +42,7 @@ typedef struct
#define NB_HATCH_STYLES 6
static
HGDIOBJ
BRUSH_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
static
HGDIOBJ
BRUSH_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
BRUSH_GetObject16
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
BRUSH_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
BRUSH_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
...
...
@@ -368,22 +368,26 @@ BOOL WINAPI FixBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
/***********************************************************************
* BRUSH_SelectObject
*/
static
HGDIOBJ
BRUSH_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
)
static
HGDIOBJ
BRUSH_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
BRUSHOBJ
*
brush
=
obj
;
HGDIOBJ
ret
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
BRUSHOBJ
*
brush
;
HGDIOBJ
ret
=
0
;
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
brush
->
logbrush
.
lbStyle
==
BS_PATTERN
)
BITMAP_SetOwnerDC
(
(
HBITMAP
)
brush
->
logbrush
.
lbHatch
,
dc
);
ret
=
dc
->
hBrush
;
if
(
dc
->
funcs
->
pSelectBrush
)
handle
=
dc
->
funcs
->
pSelectBrush
(
dc
->
physDev
,
handle
);
if
(
handle
)
dc
->
hBrush
=
handle
;
else
ret
=
0
;
DC_ReleaseDCPtr
(
dc
);
if
((
brush
=
GDI_GetObjPtr
(
handle
,
BRUSH_MAGIC
)))
{
if
(
brush
->
logbrush
.
lbStyle
==
BS_PATTERN
)
BITMAP_SetOwnerDC
(
(
HBITMAP
)
brush
->
logbrush
.
lbHatch
,
dc
);
ret
=
dc
->
hBrush
;
if
(
dc
->
funcs
->
pSelectBrush
)
handle
=
dc
->
funcs
->
pSelectBrush
(
dc
->
physDev
,
handle
);
if
(
handle
)
dc
->
hBrush
=
handle
;
else
ret
=
0
;
GDI_ReleaseObj
(
handle
);
}
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/font.c
View file @
a1e31397
...
...
@@ -86,7 +86,7 @@ static inline INT INTERNAL_YWSTODS(DC *dc, INT height)
return
pt
[
1
].
y
-
pt
[
0
].
y
;
}
static
HGDIOBJ
FONT_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
static
HGDIOBJ
FONT_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
FONT_GetObject16
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
FONT_GetObjectA
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
FONT_GetObjectW
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
...
...
@@ -585,7 +585,7 @@ HFONT WINAPI CreateFontW( INT height, INT width, INT esc,
* drivers that don't support vector fonts they must supply their own
* font.
*/
static
HGDIOBJ
FONT_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
)
static
HGDIOBJ
FONT_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
HGDIOBJ
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
...
...
dlls/gdi32/gdi_private.h
View file @
a1e31397
...
...
@@ -71,7 +71,7 @@ typedef struct {
struct
gdi_obj_funcs
{
HGDIOBJ
(
*
pSelectObject
)(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
HGDIOBJ
(
*
pSelectObject
)(
HGDIOBJ
handle
,
HDC
hdc
);
INT
(
*
pGetObject16
)(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
INT
(
*
pGetObjectA
)(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
INT
(
*
pGetObjectW
)(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
...
...
dlls/gdi32/gdiobj.c
View file @
a1e31397
...
...
@@ -1150,7 +1150,7 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
{
if
(
header
->
funcs
&&
header
->
funcs
->
pSelectObject
)
{
ret
=
header
->
funcs
->
pSelectObject
(
hObj
,
h
eader
,
h
dc
);
ret
=
header
->
funcs
->
pSelectObject
(
hObj
,
hdc
);
if
(
ret
&&
ret
!=
hObj
&&
HandleToULong
(
ret
)
>
COMPLEXREGION
)
{
inc_ref_count
(
header
);
...
...
dlls/gdi32/pen.c
View file @
a1e31397
...
...
@@ -42,7 +42,7 @@ typedef struct
}
PENOBJ
;
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
PEN_GetObject16
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
PEN_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
...
...
@@ -215,7 +215,7 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
/***********************************************************************
* PEN_SelectObject
*/
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
)
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
HGDIOBJ
ret
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
...
...
dlls/gdi32/region.c
View file @
a1e31397
...
...
@@ -120,7 +120,7 @@ typedef struct
}
RGNOBJ
;
static
HGDIOBJ
REGION_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
);
static
HGDIOBJ
REGION_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
BOOL
REGION_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
const
struct
gdi_obj_funcs
region_funcs
=
...
...
@@ -549,7 +549,7 @@ static BOOL REGION_DeleteObject( HGDIOBJ handle, void *obj )
/***********************************************************************
* REGION_SelectObject
*/
static
HGDIOBJ
REGION_SelectObject
(
HGDIOBJ
handle
,
void
*
obj
,
HDC
hdc
)
static
HGDIOBJ
REGION_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
return
ULongToHandle
(
SelectClipRgn
(
hdc
,
handle
));
}
...
...
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