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
3b059b2a
Commit
3b059b2a
authored
Oct 03, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved CreateBrushIndirect16 and CreateDIBPatternBrush16 to gdi16.c.
parent
5cf56a3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
117 deletions
+79
-117
gdi16.c
dlls/gdi/gdi16.c
+32
-0
brush.c
objects/brush.c
+47
-117
No files found.
dlls/gdi/gdi16.c
View file @
3b059b2a
...
...
@@ -750,6 +750,23 @@ HBITMAP16 WINAPI CreateBitmapIndirect16( const BITMAP16 * bmp )
/***********************************************************************
* CreateBrushIndirect (GDI.50)
*/
HBRUSH16
WINAPI
CreateBrushIndirect16
(
const
LOGBRUSH16
*
brush
)
{
LOGBRUSH
brush32
;
if
(
brush
->
lbStyle
==
BS_DIBPATTERN
||
brush
->
lbStyle
==
BS_DIBPATTERN8X8
)
return
CreateDIBPatternBrush16
(
brush
->
lbHatch
,
brush
->
lbColor
);
brush32
.
lbStyle
=
brush
->
lbStyle
;
brush32
.
lbColor
=
brush
->
lbColor
;
brush32
.
lbHatch
=
brush
->
lbHatch
;
return
HBRUSH_16
(
CreateBrushIndirect
(
&
brush32
)
);
}
/***********************************************************************
* CreateCompatibleBitmap (GDI.51)
*/
HBITMAP16
WINAPI
CreateCompatibleBitmap16
(
HDC16
hdc
,
INT16
width
,
INT16
height
)
...
...
@@ -1905,6 +1922,21 @@ HRGN16 WINAPI CreateRoundRectRgn16( INT16 left, INT16 top, INT16 right, INT16 bo
}
/***********************************************************************
* CreateDIBPatternBrush (GDI.445)
*/
HBRUSH16
WINAPI
CreateDIBPatternBrush16
(
HGLOBAL16
hbitmap
,
UINT16
coloruse
)
{
BITMAPINFO
*
bmi
;
HBRUSH16
ret
;
if
(
!
(
bmi
=
GlobalLock16
(
hbitmap
)))
return
0
;
ret
=
HBRUSH_16
(
CreateDIBPatternBrushPt
(
bmi
,
coloruse
));
GlobalUnlock16
(
hbitmap
);
return
ret
;
}
/**********************************************************************
* PolyPolygon (GDI.450)
*/
...
...
objects/brush.c
View file @
3b059b2a
...
...
@@ -79,93 +79,6 @@ static HGLOBAL16 dib_copy(BITMAPINFO *info, UINT coloruse)
}
static
BOOL
create_brush_indirect
(
BRUSHOBJ
*
brushPtr
,
BOOL
v16
)
{
LOGBRUSH
*
brush
=
&
brushPtr
->
logbrush
;
switch
(
brush
->
lbStyle
)
{
case
BS_PATTERN8X8
:
brush
->
lbStyle
=
BS_PATTERN
;
case
BS_PATTERN
:
brush
->
lbHatch
=
(
LONG
)
BITMAP_CopyBitmap
(
(
HBITMAP
)
brush
->
lbHatch
);
if
(
!
brush
->
lbHatch
)
break
;
return
TRUE
;
case
BS_DIBPATTERNPT
:
brush
->
lbStyle
=
BS_DIBPATTERN
;
brush
->
lbHatch
=
(
LONG
)
dib_copy
(
(
BITMAPINFO
*
)
brush
->
lbHatch
,
brush
->
lbColor
);
if
(
!
brush
->
lbHatch
)
break
;
return
TRUE
;
case
BS_DIBPATTERN8X8
:
case
BS_DIBPATTERN
:
{
BITMAPINFO
*
bmi
;
HGLOBAL
h
=
brush
->
lbHatch
;
brush
->
lbStyle
=
BS_DIBPATTERN
;
if
(
v16
)
{
if
(
!
(
bmi
=
(
BITMAPINFO
*
)
GlobalLock16
(
h
)))
break
;
}
else
{
if
(
!
(
bmi
=
(
BITMAPINFO
*
)
GlobalLock
(
h
)))
break
;
}
brush
->
lbHatch
=
dib_copy
(
bmi
,
brush
->
lbColor
);
if
(
v16
)
GlobalUnlock16
(
h
);
else
GlobalUnlock
(
h
);
if
(
!
brush
->
lbHatch
)
break
;
return
TRUE
;
}
default:
if
(
brush
->
lbStyle
<=
BS_MONOPATTERN
)
return
TRUE
;
}
return
FALSE
;
}
/***********************************************************************
* CreateBrushIndirect (GDI.50)
*/
HBRUSH16
WINAPI
CreateBrushIndirect16
(
const
LOGBRUSH16
*
brush
)
{
BOOL
success
;
BRUSHOBJ
*
brushPtr
;
HBRUSH
hbrush
;
if
(
!
(
brushPtr
=
GDI_AllocObject
(
sizeof
(
BRUSHOBJ
),
BRUSH_MAGIC
,
&
hbrush
,
&
brush_funcs
)))
return
0
;
brushPtr
->
logbrush
.
lbStyle
=
brush
->
lbStyle
;
brushPtr
->
logbrush
.
lbColor
=
brush
->
lbColor
;
brushPtr
->
logbrush
.
lbHatch
=
brush
->
lbHatch
;
success
=
create_brush_indirect
(
brushPtr
,
TRUE
);
if
(
!
success
)
{
GDI_FreeObject
(
hbrush
,
brushPtr
);
hbrush
=
0
;
}
else
GDI_ReleaseObj
(
hbrush
);
TRACE
(
"%04x
\n
"
,
hbrush
);
return
hbrush
;
}
/***********************************************************************
* CreateBrushIndirect (GDI32.@)
*
...
...
@@ -177,23 +90,57 @@ HBRUSH16 WINAPI CreateBrushIndirect16( const LOGBRUSH16 * brush )
*/
HBRUSH
WINAPI
CreateBrushIndirect
(
const
LOGBRUSH
*
brush
)
{
BOOL
success
;
BRUSHOBJ
*
brushPtr
;
BRUSHOBJ
*
ptr
;
HBRUSH
hbrush
;
if
(
!
(
brushPtr
=
GDI_AllocObject
(
sizeof
(
BRUSHOBJ
),
BRUSH_MAGIC
,
&
hbrush
,
&
brush_funcs
)))
return
0
;
brushP
tr
->
logbrush
.
lbStyle
=
brush
->
lbStyle
;
brushP
tr
->
logbrush
.
lbColor
=
brush
->
lbColor
;
brushP
tr
->
logbrush
.
lbHatch
=
brush
->
lbHatch
;
success
=
create_brush_indirect
(
brushPtr
,
FALSE
);
if
(
!
success
)
if
(
!
(
ptr
=
GDI_AllocObject
(
sizeof
(
BRUSHOBJ
),
BRUSH_MAGIC
,
&
hbrush
,
&
brush_funcs
)))
return
0
;
p
tr
->
logbrush
.
lbStyle
=
brush
->
lbStyle
;
p
tr
->
logbrush
.
lbColor
=
brush
->
lbColor
;
p
tr
->
logbrush
.
lbHatch
=
brush
->
lbHatch
;
switch
(
ptr
->
logbrush
.
lbStyle
)
{
GDI_FreeObject
(
hbrush
,
brushPtr
);
hbrush
=
0
;
case
BS_PATTERN8X8
:
ptr
->
logbrush
.
lbStyle
=
BS_PATTERN
;
/* fall through */
case
BS_PATTERN
:
ptr
->
logbrush
.
lbHatch
=
(
LONG
)
BITMAP_CopyBitmap
(
(
HBITMAP
)
ptr
->
logbrush
.
lbHatch
);
if
(
!
ptr
->
logbrush
.
lbHatch
)
goto
error
;
break
;
case
BS_DIBPATTERNPT
:
ptr
->
logbrush
.
lbStyle
=
BS_DIBPATTERN
;
ptr
->
logbrush
.
lbHatch
=
(
LONG
)
dib_copy
(
(
BITMAPINFO
*
)
ptr
->
logbrush
.
lbHatch
,
ptr
->
logbrush
.
lbColor
);
if
(
!
ptr
->
logbrush
.
lbHatch
)
goto
error
;
break
;
case
BS_DIBPATTERN8X8
:
case
BS_DIBPATTERN
:
{
BITMAPINFO
*
bmi
;
HGLOBAL
h
=
(
HGLOBAL
)
ptr
->
logbrush
.
lbHatch
;
ptr
->
logbrush
.
lbStyle
=
BS_DIBPATTERN
;
if
(
!
(
bmi
=
(
BITMAPINFO
*
)
GlobalLock
(
h
)))
goto
error
;
ptr
->
logbrush
.
lbHatch
=
dib_copy
(
bmi
,
ptr
->
logbrush
.
lbColor
);
GlobalUnlock
(
h
);
if
(
!
ptr
->
logbrush
.
lbHatch
)
goto
error
;
break
;
}
default:
if
(
ptr
->
logbrush
.
lbStyle
>
BS_MONOPATTERN
)
goto
error
;
break
;
}
else
GDI_ReleaseObj
(
hbrush
);
GDI_ReleaseObj
(
hbrush
);
TRACE
(
"%08x
\n
"
,
hbrush
);
return
hbrush
;
error:
GDI_FreeObject
(
hbrush
,
ptr
);
return
0
;
}
...
...
@@ -222,29 +169,12 @@ HBRUSH WINAPI CreatePatternBrush( HBITMAP hbitmap )
LOGBRUSH
logbrush
=
{
BS_PATTERN
,
0
,
0
};
TRACE
(
"%04x
\n
"
,
hbitmap
);
logbrush
.
lbHatch
=
hbitmap
;
logbrush
.
lbHatch
=
(
ULONG_PTR
)
hbitmap
;
return
CreateBrushIndirect
(
&
logbrush
);
}
/***********************************************************************
* CreateDIBPatternBrush (GDI.445)
*/
HBRUSH16
WINAPI
CreateDIBPatternBrush16
(
HGLOBAL16
hbitmap
,
UINT16
coloruse
)
{
LOGBRUSH16
logbrush
;
TRACE
(
"%04x
\n
"
,
hbitmap
);
logbrush
.
lbStyle
=
BS_DIBPATTERN
;
logbrush
.
lbColor
=
coloruse
;
logbrush
.
lbHatch
=
hbitmap
;
return
CreateBrushIndirect16
(
&
logbrush
);
}
/***********************************************************************
* CreateDIBPatternBrush (GDI32.@)
*
* Create a logical brush which has the pattern specified by the DIB
...
...
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