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
497714a0
Commit
497714a0
authored
Apr 28, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Merge the contents of clipping.c into graphics.c.
parent
618709d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
123 deletions
+99
-123
Makefile.in
dlls/winex11.drv/Makefile.in
+0
-1
clipping.c
dlls/winex11.drv/clipping.c
+0
-122
graphics.c
dlls/winex11.drv/graphics.c
+99
-0
No files found.
dlls/winex11.drv/Makefile.in
View file @
497714a0
...
...
@@ -13,7 +13,6 @@ C_SRCS = \
bitmap.c
\
brush.c
\
clipboard.c
\
clipping.c
\
codepage.c
\
desktop.c
\
dib.c
\
...
...
dlls/winex11.drv/clipping.c
deleted
100644 → 0
View file @
618709d2
/*
* X11DRV clipping functions
*
* Copyright 1998 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdio.h>
#include "x11drv.h"
/***********************************************************************
* X11DRV_GetRegionData
*
* Calls GetRegionData on the given region and converts the rectangle
* array to XRectangle format. The returned buffer must be freed by
* caller using HeapFree(GetProcessHeap(),...).
* If hdc_lptodp is not 0, the rectangles are converted through LPtoDP.
*/
RGNDATA
*
X11DRV_GetRegionData
(
HRGN
hrgn
,
HDC
hdc_lptodp
)
{
RGNDATA
*
data
;
DWORD
size
;
unsigned
int
i
;
RECT
*
rect
,
tmp
;
XRectangle
*
xrect
;
if
(
!
(
size
=
GetRegionData
(
hrgn
,
0
,
NULL
)))
return
NULL
;
if
(
sizeof
(
XRectangle
)
>
sizeof
(
RECT
))
{
/* add extra size for XRectangle array */
int
count
=
(
size
-
sizeof
(
RGNDATAHEADER
))
/
sizeof
(
RECT
);
size
+=
count
*
(
sizeof
(
XRectangle
)
-
sizeof
(
RECT
));
}
if
(
!
(
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
NULL
;
if
(
!
GetRegionData
(
hrgn
,
size
,
data
))
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
NULL
;
}
rect
=
(
RECT
*
)
data
->
Buffer
;
xrect
=
(
XRectangle
*
)
data
->
Buffer
;
if
(
hdc_lptodp
)
/* map to device coordinates */
{
LPtoDP
(
hdc_lptodp
,
(
POINT
*
)
rect
,
data
->
rdh
.
nCount
*
2
);
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
if
(
rect
[
i
].
right
<
rect
[
i
].
left
)
{
INT
tmp
=
rect
[
i
].
right
;
rect
[
i
].
right
=
rect
[
i
].
left
;
rect
[
i
].
left
=
tmp
;
}
if
(
rect
[
i
].
bottom
<
rect
[
i
].
top
)
{
INT
tmp
=
rect
[
i
].
bottom
;
rect
[
i
].
bottom
=
rect
[
i
].
top
;
rect
[
i
].
top
=
tmp
;
}
}
}
if
(
sizeof
(
XRectangle
)
>
sizeof
(
RECT
))
{
int
j
;
/* need to start from the end */
for
(
j
=
data
->
rdh
.
nCount
-
1
;
j
>=
0
;
j
--
)
{
tmp
=
rect
[
j
];
xrect
[
j
].
x
=
tmp
.
left
;
xrect
[
j
].
y
=
tmp
.
top
;
xrect
[
j
].
width
=
tmp
.
right
-
tmp
.
left
;
xrect
[
j
].
height
=
tmp
.
bottom
-
tmp
.
top
;
}
}
else
{
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
tmp
=
rect
[
i
];
xrect
[
i
].
x
=
tmp
.
left
;
xrect
[
i
].
y
=
tmp
.
top
;
xrect
[
i
].
width
=
tmp
.
right
-
tmp
.
left
;
xrect
[
i
].
height
=
tmp
.
bottom
-
tmp
.
top
;
}
}
return
data
;
}
/***********************************************************************
* X11DRV_SetDeviceClipping
*/
void
X11DRV_SetDeviceClipping
(
X11DRV_PDEVICE
*
physDev
,
HRGN
vis_rgn
,
HRGN
clip_rgn
)
{
RGNDATA
*
data
;
CombineRgn
(
physDev
->
region
,
vis_rgn
,
clip_rgn
,
clip_rgn
?
RGN_AND
:
RGN_COPY
);
if
(
!
(
data
=
X11DRV_GetRegionData
(
physDev
->
region
,
0
)))
return
;
wine_tsx11_lock
();
XSetClipRectangles
(
gdi_display
,
physDev
->
gc
,
physDev
->
dc_rect
.
left
,
physDev
->
dc_rect
.
top
,
(
XRectangle
*
)
data
->
Buffer
,
data
->
rdh
.
nCount
,
YXBanded
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
dlls/winex11.drv/graphics.c
View file @
497714a0
...
...
@@ -2,6 +2,7 @@
* X11 graphics driver graphics functions
*
* Copyright 1993,1994 Alexandre Julliard
* Copyright 1998 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -72,6 +73,104 @@ const int X11DRV_XROPfunction[16] =
/***********************************************************************
* X11DRV_GetRegionData
*
* Calls GetRegionData on the given region and converts the rectangle
* array to XRectangle format. The returned buffer must be freed by
* caller using HeapFree(GetProcessHeap(),...).
* If hdc_lptodp is not 0, the rectangles are converted through LPtoDP.
*/
RGNDATA
*
X11DRV_GetRegionData
(
HRGN
hrgn
,
HDC
hdc_lptodp
)
{
RGNDATA
*
data
;
DWORD
size
;
unsigned
int
i
;
RECT
*
rect
,
tmp
;
XRectangle
*
xrect
;
if
(
!
(
size
=
GetRegionData
(
hrgn
,
0
,
NULL
)))
return
NULL
;
if
(
sizeof
(
XRectangle
)
>
sizeof
(
RECT
))
{
/* add extra size for XRectangle array */
int
count
=
(
size
-
sizeof
(
RGNDATAHEADER
))
/
sizeof
(
RECT
);
size
+=
count
*
(
sizeof
(
XRectangle
)
-
sizeof
(
RECT
));
}
if
(
!
(
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
NULL
;
if
(
!
GetRegionData
(
hrgn
,
size
,
data
))
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
NULL
;
}
rect
=
(
RECT
*
)
data
->
Buffer
;
xrect
=
(
XRectangle
*
)
data
->
Buffer
;
if
(
hdc_lptodp
)
/* map to device coordinates */
{
LPtoDP
(
hdc_lptodp
,
(
POINT
*
)
rect
,
data
->
rdh
.
nCount
*
2
);
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
if
(
rect
[
i
].
right
<
rect
[
i
].
left
)
{
INT
tmp
=
rect
[
i
].
right
;
rect
[
i
].
right
=
rect
[
i
].
left
;
rect
[
i
].
left
=
tmp
;
}
if
(
rect
[
i
].
bottom
<
rect
[
i
].
top
)
{
INT
tmp
=
rect
[
i
].
bottom
;
rect
[
i
].
bottom
=
rect
[
i
].
top
;
rect
[
i
].
top
=
tmp
;
}
}
}
if
(
sizeof
(
XRectangle
)
>
sizeof
(
RECT
))
{
int
j
;
/* need to start from the end */
for
(
j
=
data
->
rdh
.
nCount
-
1
;
j
>=
0
;
j
--
)
{
tmp
=
rect
[
j
];
xrect
[
j
].
x
=
tmp
.
left
;
xrect
[
j
].
y
=
tmp
.
top
;
xrect
[
j
].
width
=
tmp
.
right
-
tmp
.
left
;
xrect
[
j
].
height
=
tmp
.
bottom
-
tmp
.
top
;
}
}
else
{
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
tmp
=
rect
[
i
];
xrect
[
i
].
x
=
tmp
.
left
;
xrect
[
i
].
y
=
tmp
.
top
;
xrect
[
i
].
width
=
tmp
.
right
-
tmp
.
left
;
xrect
[
i
].
height
=
tmp
.
bottom
-
tmp
.
top
;
}
}
return
data
;
}
/***********************************************************************
* X11DRV_SetDeviceClipping
*/
void
X11DRV_SetDeviceClipping
(
X11DRV_PDEVICE
*
physDev
,
HRGN
vis_rgn
,
HRGN
clip_rgn
)
{
RGNDATA
*
data
;
CombineRgn
(
physDev
->
region
,
vis_rgn
,
clip_rgn
,
clip_rgn
?
RGN_AND
:
RGN_COPY
);
if
(
!
(
data
=
X11DRV_GetRegionData
(
physDev
->
region
,
0
)))
return
;
wine_tsx11_lock
();
XSetClipRectangles
(
gdi_display
,
physDev
->
gc
,
physDev
->
dc_rect
.
left
,
physDev
->
dc_rect
.
top
,
(
XRectangle
*
)
data
->
Buffer
,
data
->
rdh
.
nCount
,
YXBanded
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
/***********************************************************************
* X11DRV_SetupGCForPatBlt
*
* Setup the GC for a PatBlt operation using current brush.
...
...
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