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
8815e638
Commit
8815e638
authored
Feb 05, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Get rid of DC_GetDCPtr in the GDI object functions.
parent
4b14a080
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
36 deletions
+47
-36
brush.c
dlls/gdi32/brush.c
+13
-5
gdiobj.c
dlls/gdi32/gdiobj.c
+16
-25
pen.c
dlls/gdi32/pen.c
+18
-6
No files found.
dlls/gdi32/brush.c
View file @
8815e638
...
...
@@ -374,22 +374,30 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc )
HGDIOBJ
ret
=
0
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
!
dc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
}
if
((
brush
=
GDI_GetObjPtr
(
handle
,
BRUSH_MAGIC
)))
{
if
(
brush
->
logbrush
.
lbStyle
==
BS_PATTERN
)
BITMAP_SetOwnerDC
(
(
HBITMAP
)
brush
->
logbrush
.
lbHatch
,
dc
);
if
(
dc
->
funcs
->
pSelectBrush
)
handle
=
dc
->
funcs
->
pSelectBrush
(
dc
->
physDev
,
handle
);
if
(
handle
)
GDI_inc_ref_count
(
handle
);
GDI_ReleaseObj
(
handle
);
if
(
dc
->
funcs
->
pSelectBrush
&&
!
dc
->
funcs
->
pSelectBrush
(
dc
->
physDev
,
handle
))
{
GDI_dec_ref_count
(
handle
);
}
else
{
ret
=
dc
->
hBrush
;
dc
->
hBrush
=
handle
;
GDI_inc_ref_count
(
handle
);
GDI_dec_ref_count
(
ret
);
}
GDI_ReleaseObj
(
handle
);
}
release_dc_ptr
(
dc
);
return
ret
;
...
...
dlls/gdi32/gdiobj.c
View file @
8815e638
...
...
@@ -823,7 +823,7 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
while
(
header
->
hdcs
)
{
DC
*
dc
=
DC_GetDCP
tr
(
header
->
hdcs
->
hdc
);
DC
*
dc
=
get_dc_p
tr
(
header
->
hdcs
->
hdc
);
struct
hdc_list
*
tmp
;
TRACE
(
"hdc %p has interest in %p
\n
"
,
header
->
hdcs
->
hdc
,
obj
);
...
...
@@ -831,7 +831,7 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
{
if
(
dc
->
funcs
->
pDeleteObject
)
dc
->
funcs
->
pDeleteObject
(
dc
->
physDev
,
obj
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
tmp
=
header
->
hdcs
;
header
->
hdcs
=
header
->
hdcs
->
next
;
...
...
@@ -1098,10 +1098,10 @@ DWORD WINAPI GetObjectType( HGDIOBJ handle )
HGDIOBJ
WINAPI
GetCurrentObject
(
HDC
hdc
,
UINT
type
)
{
HGDIOBJ
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
dc
)
{
switch
(
type
)
{
case
OBJ_EXTPEN
:
/* fall through */
case
OBJ_PEN
:
ret
=
dc
->
hPen
;
break
;
...
...
@@ -1112,13 +1112,12 @@ HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type)
/* tests show that OBJ_REGION is explicitly ignored */
case
OBJ_REGION
:
break
;
default:
/* the SDK only mentions those above */
FIXME
(
"(%p,%d): unknown type.
\n
"
,
hdc
,
type
);
default:
/* the SDK only mentions those above */
FIXME
(
"(%p,%d): unknown type.
\n
"
,
hdc
,
type
);
break
;
}
DC_ReleaseDCPtr
(
dc
);
}
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
@@ -1143,23 +1142,15 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
{
HGDIOBJ
ret
=
0
;
GDIOBJHDR
*
header
;
DC
*
dc
;
TRACE
(
"(%p,%p)
\n
"
,
hdc
,
hObj
);
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
SetLastError
(
ERROR_INVALID_HANDLE
);
else
header
=
GDI_GetObjPtr
(
hObj
,
MAGIC_DONTCARE
);
if
(
header
)
{
DC_ReleaseDCPtr
(
dc
);
header
=
GDI_GetObjPtr
(
hObj
,
MAGIC_DONTCARE
);
if
(
header
)
{
const
struct
gdi_obj_funcs
*
funcs
=
header
->
funcs
;
GDI_ReleaseObj
(
hObj
);
if
(
funcs
&&
funcs
->
pSelectObject
)
ret
=
funcs
->
pSelectObject
(
hObj
,
hdc
);
}
const
struct
gdi_obj_funcs
*
funcs
=
header
->
funcs
;
GDI_ReleaseObj
(
hObj
);
if
(
funcs
&&
funcs
->
pSelectObject
)
ret
=
funcs
->
pSelectObject
(
hObj
,
hdc
);
}
return
ret
;
}
...
...
@@ -1437,13 +1428,13 @@ BOOL WINAPI GetColorAdjustment(HDC hdc, LPCOLORADJUSTMENT lpca)
*/
BOOL
WINAPI
GdiComment
(
HDC
hdc
,
UINT
cbSize
,
const
BYTE
*
lpData
)
{
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
BOOL
ret
=
FALSE
;
if
(
dc
)
{
if
(
dc
->
funcs
->
pGdiComment
)
ret
=
dc
->
funcs
->
pGdiComment
(
dc
->
physDev
,
cbSize
,
lpData
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
return
ret
;
}
...
...
dlls/gdi32/pen.c
View file @
8815e638
...
...
@@ -218,19 +218,31 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
)
{
HGDIOBJ
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
!
dc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
}
if
(
!
GDI_inc_ref_count
(
handle
))
{
release_dc_ptr
(
dc
);
return
0
;
}
if
(
dc
->
funcs
->
pSelectPen
)
handle
=
dc
->
funcs
->
pSelectPen
(
dc
->
physDev
,
handle
);
if
(
handle
)
if
(
dc
->
funcs
->
pSelectPen
&&
!
dc
->
funcs
->
pSelectPen
(
dc
->
physDev
,
handle
))
{
GDI_dec_ref_count
(
handle
);
}
else
{
ret
=
dc
->
hPen
;
dc
->
hPen
=
handle
;
GDI_inc_ref_count
(
handle
);
GDI_dec_ref_count
(
ret
);
}
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
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