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
f925f816
Commit
f925f816
authored
Jul 24, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of all the ugly macros.
parent
4bc1ebb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
515 additions
and
200 deletions
+515
-200
dcvalues.c
objects/dcvalues.c
+515
-200
No files found.
objects/dcvalues.c
View file @
f925f816
...
...
@@ -12,358 +12,673 @@
#include "gdi.h"
/* Define pseudo types */
#define COLORREF16 COLORREF
#define DWORD16 DWORD
#define DC_GET_VAL_16( func_type, func_name, dc_field ) \
func_type##16 WINAPI func_name##16( HDC16 hdc ) \
{ \
func_type ret = 0; \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = dc->dc_field; \
GDI_ReleaseObj( hdc ); \
} \
return ret; \
}
#define DC_GET_VAL_32( func_type, func_name, dc_field ) \
func_type WINAPI func_name( HDC hdc ) \
{ \
func_type ret = 0; \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = dc->dc_field; \
GDI_ReleaseObj( hdc ); \
} \
return ret; \
}
#define DC_GET_X_Y_16( func_type, func_name, ret_x, ret_y ) \
func_type##16 WINAPI func_name##16( HDC16 hdc ) \
{ \
func_type ret = 0; \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = MAKELONG( dc->ret_x, dc->ret_y ); \
GDI_ReleaseObj( hdc ); \
} \
return ret; \
}
/* DC_GET_VAL_EX is used to define functions returning a POINT or a SIZE. It is
* important that the function has the right signature, for the implementation
* we can do whatever we want.
*/
#define DC_GET_VAL_EX_16( func_name, ret_x, ret_y, type ) \
BOOL16 WINAPI func_name##16( HDC16 hdc, LP##type##16 pt ) \
{ \
DC * dc = DC_GetDCPtr( hdc ); \
if (!dc) return FALSE; \
((LPPOINT16)pt)->x = dc->ret_x; \
((LPPOINT16)pt)->y = dc->ret_y; \
GDI_ReleaseObj( hdc ); \
return TRUE; \
}
#define DC_GET_VAL_EX_32( func_name, ret_x, ret_y, type ) \
BOOL WINAPI func_name( HDC hdc, LP##type pt ) \
{ \
DC * dc = DC_GetDCPtr( hdc ); \
if (!dc) return FALSE; \
((LPPOINT)pt)->x = dc->ret_x; \
((LPPOINT)pt)->y = dc->ret_y; \
GDI_ReleaseObj( hdc ); \
return TRUE; \
}
#define DC_SET_MODE_16( func_name, dc_field, min_val, max_val ) \
INT16 WINAPI func_name##16( HDC16 hdc, INT16 mode ) \
{ \
return func_name( hdc, mode ); \
} \
#define DC_SET_MODE_32( func_name, dc_field, min_val, max_val ) \
INT WINAPI func_name( HDC hdc, INT mode ) \
{ \
INT prevMode; \
DC *dc; \
if ((mode < min_val) || (mode > max_val)) { \
SetLastError(ERROR_INVALID_PARAMETER); \
return 0; \
} \
if (!(dc = DC_GetDCPtr( hdc ))) return 0; \
if (dc->funcs->p##func_name) { \
prevMode = dc->funcs->p##func_name( dc, mode ); \
} else { \
prevMode = dc->dc_field; \
dc->dc_field = mode; \
} \
GDI_ReleaseObj( hdc ); \
return prevMode; \
}
/***********************************************************************
* SetBkMode (GDI.2)
*/
DC_SET_MODE_16
(
SetBkMode
,
backgroundMode
,
TRANSPARENT
,
OPAQUE
)
/***********************************************************************
* SetBkMode (GDI32.@)
*/
DC_SET_MODE_32
(
SetBkMode
,
backgroundMode
,
TRANSPARENT
,
OPAQUE
)
INT
WINAPI
SetBkMode
(
HDC
hdc
,
INT
mode
)
{
INT
ret
;
DC
*
dc
;
if
((
mode
<=
0
)
||
(
mode
>
BKMODE_LAST
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetBkMode
)
ret
=
dc
->
funcs
->
pSetBkMode
(
dc
,
mode
);
else
{
ret
=
dc
->
backgroundMode
;
dc
->
backgroundMode
=
mode
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
* SetROP2 (GDI.4)
*/
DC_SET_MODE_16
(
SetROP2
,
ROPmode
,
R2_BLACK
,
R2_WHITE
)
/***********************************************************************
* SetROP2 (GDI32.@)
*/
DC_SET_MODE_32
(
SetROP2
,
ROPmode
,
R2_BLACK
,
R2_WHITE
)
INT
WINAPI
SetROP2
(
HDC
hdc
,
INT
mode
)
{
INT
ret
;
DC
*
dc
;
if
((
mode
<
R2_BLACK
)
||
(
mode
>
R2_WHITE
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetROP2
)
ret
=
dc
->
funcs
->
pSetROP2
(
dc
,
mode
);
else
{
ret
=
dc
->
ROPmode
;
dc
->
ROPmode
=
mode
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
* SetRelAbs (GDI
.5
)
* SetRelAbs (GDI
32.@
)
*/
DC_SET_MODE_16
(
SetRelAbs
,
relAbsMode
,
ABSOLUTE
,
RELATIVE
)
INT
WINAPI
SetRelAbs
(
HDC
hdc
,
INT
mode
)
{
INT
ret
;
DC
*
dc
;
if
((
mode
!=
ABSOLUTE
)
&&
(
mode
!=
RELATIVE
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetRelAbs
)
ret
=
dc
->
funcs
->
pSetRelAbs
(
dc
,
mode
);
else
{
ret
=
dc
->
relAbsMode
;
dc
->
relAbsMode
=
mode
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
* Set
RelAbs
(GDI32.@)
* Set
PolyFillMode
(GDI32.@)
*/
DC_SET_MODE_32
(
SetRelAbs
,
relAbsMode
,
ABSOLUTE
,
RELATIVE
)
INT
WINAPI
SetPolyFillMode
(
HDC
hdc
,
INT
mode
)
{
INT
ret
;
DC
*
dc
;
if
((
mode
<=
0
)
||
(
mode
>
POLYFILL_LAST
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetPolyFillMode
)
ret
=
dc
->
funcs
->
pSetPolyFillMode
(
dc
,
mode
);
else
{
ret
=
dc
->
polyFillMode
;
dc
->
polyFillMode
=
mode
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
* Set
PolyFillMode (GDI.6
)
* Set
StretchBltMode (GDI32.@
)
*/
DC_SET_MODE_16
(
SetPolyFillMode
,
polyFillMode
,
ALTERNATE
,
WINDING
)
INT
WINAPI
SetStretchBltMode
(
HDC
hdc
,
INT
mode
)
{
INT
ret
;
DC
*
dc
;
if
((
mode
<=
0
)
||
(
mode
>
MAXSTRETCHBLTMODE
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetStretchBltMode
)
ret
=
dc
->
funcs
->
pSetStretchBltMode
(
dc
,
mode
);
else
{
ret
=
dc
->
stretchBltMode
;
dc
->
stretchBltMode
=
mode
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
*
SetPolyFillMode
(GDI32.@)
*
GetBkColor
(GDI32.@)
*/
DC_SET_MODE_32
(
SetPolyFillMode
,
polyFillMode
,
ALTERNATE
,
WINDING
)
COLORREF
WINAPI
GetBkColor
(
HDC
hdc
)
{
COLORREF
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
backgroundColor
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
*
SetStretchBltMode (GDI.7
)
*
GetBkMode (GDI32.@
)
*/
DC_SET_MODE_16
(
SetStretchBltMode
,
stretchBltMode
,
BLACKONWHITE
,
HALFTONE
)
INT
WINAPI
GetBkMode
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
backgroundMode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
*
SetStretchBlt
Mode (GDI32.@)
*
GetMap
Mode (GDI32.@)
*/
DC_SET_MODE_32
(
SetStretchBltMode
,
stretchBltMode
,
BLACKONWHITE
,
HALFTONE
)
INT
WINAPI
GetMapMode
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
MapMode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
BkColor (GDI.75
)
* Get
PolyFillMode (GDI32.@
)
*/
DC_GET_VAL_16
(
COLORREF
,
GetBkColor
,
backgroundColor
)
INT
WINAPI
GetPolyFillMode
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
polyFillMode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
BkColor
(GDI32.@)
* Get
ROP2
(GDI32.@)
*/
DC_GET_VAL_32
(
COLORREF
,
GetBkColor
,
backgroundColor
)
INT
WINAPI
GetROP2
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
ROPmode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
BkMode (GDI.76
)
* Get
StretchBltMode (GDI32.@
)
*/
DC_GET_VAL_16
(
INT
,
GetBkMode
,
backgroundMode
)
INT
WINAPI
GetStretchBltMode
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
stretchBltMode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
BkMode
(GDI32.@)
* Get
TextColor
(GDI32.@)
*/
DC_GET_VAL_32
(
INT
,
GetBkMode
,
backgroundMode
)
COLORREF
WINAPI
GetTextColor
(
HDC
hdc
)
{
COLORREF
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
textColor
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
CurrentPosition (GDI.78
)
* Get
TextAlign (GDI32.@
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetCurrentPosition
,
CursPosX
,
CursPosY
)
UINT
WINAPI
GetTextAlign
(
HDC
hdc
)
{
UINT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
textAlign
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
MapMode (GDI.81
)
* Get
ArcDirection (GDI32.@
)
*/
DC_GET_VAL_16
(
INT
,
GetMapMode
,
MapMode
)
INT
WINAPI
GetArcDirection
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
ArcDirection
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
Map
Mode (GDI32.@)
* Get
Graphics
Mode (GDI32.@)
*/
DC_GET_VAL_32
(
INT
,
GetMapMode
,
MapMode
)
INT
WINAPI
GetGraphicsMode
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
GraphicsMode
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
PolyFillMode (GDI.84
)
* Get
BrushOrgEx (GDI32.@
)
*/
DC_GET_VAL_16
(
INT
,
GetPolyFillMode
,
polyFillMode
)
BOOL
WINAPI
GetBrushOrgEx
(
HDC
hdc
,
LPPOINT
pt
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
pt
->
x
=
dc
->
brushOrgX
;
pt
->
y
=
dc
->
brushOrgY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/***********************************************************************
* Get
PolyFillMode
(GDI32.@)
* Get
CurrentPositionEx
(GDI32.@)
*/
DC_GET_VAL_32
(
INT
,
GetPolyFillMode
,
polyFillMode
)
BOOL
WINAPI
GetCurrentPositionEx
(
HDC
hdc
,
LPPOINT
pt
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
pt
->
x
=
dc
->
CursPosX
;
pt
->
y
=
dc
->
CursPosY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/***********************************************************************
* Get
ROP2 (GDI.85
)
* Get
ViewportExtEx (GDI32.@
)
*/
DC_GET_VAL_16
(
INT
,
GetROP2
,
ROPmode
)
BOOL
WINAPI
GetViewportExtEx
(
HDC
hdc
,
LPSIZE
size
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
size
->
cx
=
dc
->
vportExtX
;
size
->
cy
=
dc
->
vportExtY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/***********************************************************************
* Get
ROP2
(GDI32.@)
* Get
ViewportOrgEx
(GDI32.@)
*/
DC_GET_VAL_32
(
INT
,
GetROP2
,
ROPmode
)
BOOL
WINAPI
GetViewportOrgEx
(
HDC
hdc
,
LPPOINT
pt
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
pt
->
x
=
dc
->
vportOrgX
;
pt
->
y
=
dc
->
vportOrgY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/***********************************************************************
* Get
RelAbs (GDI.86
)
* Get
WindowExtEx (GDI32.@
)
*/
DC_GET_VAL_16
(
INT
,
GetRelAbs
,
relAbsMode
)
BOOL
WINAPI
GetWindowExtEx
(
HDC
hdc
,
LPSIZE
size
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
size
->
cx
=
dc
->
wndExtX
;
size
->
cy
=
dc
->
wndExtY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/***********************************************************************
* Get
StretchBltMode (GDI.88
)
* Get
WindowOrgEx (GDI32.@
)
*/
BOOL
WINAPI
GetWindowOrgEx
(
HDC
hdc
,
LPPOINT
pt
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
pt
->
x
=
dc
->
wndOrgX
;
pt
->
y
=
dc
->
wndOrgY
;
GDI_ReleaseObj
(
hdc
);
return
TRUE
;
}
/**** 16-bit functions ****/
DC_GET_VAL_16
(
INT
,
GetStretchBltMode
,
stretchBltMode
)
/***********************************************************************
*
GetStretchBltMode (GDI32.@
)
*
SetBkMode (GDI.2
)
*/
DC_GET_VAL_32
(
INT
,
GetStretchBltMode
,
stretchBltMode
)
INT16
WINAPI
SetBkMode16
(
HDC16
hdc
,
INT16
mode
)
{
return
SetBkMode
(
hdc
,
mode
);
}
/***********************************************************************
*
GetTextColor (GDI.90
)
*
SetROP2 (GDI.4
)
*/
DC_GET_VAL_16
(
COLORREF
,
GetTextColor
,
textColor
)
INT16
WINAPI
SetROP216
(
HDC16
hdc
,
INT16
mode
)
{
return
SetROP2
(
hdc
,
mode
);
}
/***********************************************************************
*
GetTextColor (GDI32.@
)
*
SetRelAbs (GDI.5
)
*/
DC_GET_VAL_32
(
COLORREF
,
GetTextColor
,
textColor
)
INT16
WINAPI
SetRelAbs16
(
HDC16
hdc
,
INT16
mode
)
{
return
SetRelAbs
(
hdc
,
mode
);
}
/***********************************************************************
*
GetViewportExt (GDI.94
)
*
SetPolyFillMode (GDI.6
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetViewportExt
,
vportExtX
,
vportExtY
)
INT16
WINAPI
SetPolyFillMode16
(
HDC16
hdc
,
INT16
mode
)
{
return
SetPolyFillMode
(
hdc
,
mode
);
}
/***********************************************************************
*
GetViewportOrg (GDI.95
)
*
SetStretchBltMode (GDI.7
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetViewportOrg
,
vportOrgX
,
vportOrgY
)
INT16
WINAPI
SetStretchBltMode16
(
HDC16
hdc
,
INT16
mode
)
{
return
SetStretchBltMode
(
hdc
,
mode
);
}
/***********************************************************************
* Get
WindowExt (GDI.96
)
* Get
BkColor (GDI.75
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetWindowExt
,
wndExtX
,
wndExtY
)
COLORREF
WINAPI
GetBkColor16
(
HDC16
hdc
)
{
return
GetBkColor
(
hdc
);
}
/***********************************************************************
* Get
WindowOrg (GDI.97
)
* Get
BkMode (GDI.76
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetWindowOrg
,
wndOrgX
,
wndOrgY
)
INT16
WINAPI
GetBkMode16
(
HDC16
hdc
)
{
return
GetBkMode
(
hdc
);
}
/***********************************************************************
*
InquireVisRgn (GDI.131
)
*
GetCurrentPosition (GDI.78
)
*/
DC_GET_VAL_16
(
HRGN
,
InquireVisRgn
,
hVisRgn
)
DWORD
WINAPI
GetCurrentPosition16
(
HDC16
hdc
)
{
POINT
pt32
;
if
(
!
GetCurrentPositionEx
(
hdc
,
&
pt32
))
return
0
;
return
MAKELONG
(
pt32
.
x
,
pt32
.
y
);
}
/***********************************************************************
* Get
ClipRgn (GDI.173
)
* Get
MapMode (GDI.81
)
*/
DC_GET_VAL_16
(
HRGN
,
GetClipRgn
,
hClipRgn
)
INT16
WINAPI
GetMapMode16
(
HDC16
hdc
)
{
return
GetMapMode
(
hdc
);
}
/***********************************************************************
* Get
BrushOrg (GDI.149
)
* Get
PolyFillMode (GDI.84
)
*/
DC_GET_X_Y_16
(
DWORD
,
GetBrushOrg
,
brushOrgX
,
brushOrgY
)
INT16
WINAPI
GetPolyFillMode16
(
HDC16
hdc
)
{
return
GetPolyFillMode
(
hdc
);
}
/***********************************************************************
* Get
TextAlign (GDI.34
5)
* Get
ROP2 (GDI.8
5)
*/
DC_GET_VAL_16
(
UINT
,
GetTextAlign
,
textAlign
)
INT16
WINAPI
GetROP216
(
HDC16
hdc
)
{
return
GetROP2
(
hdc
);
}
/***********************************************************************
* Get
TextAlign (GDI32.@
)
* Get
RelAbs (GDI.86
)
*/
DC_GET_VAL_32
(
UINT
,
GetTextAlign
,
textAlign
)
INT16
WINAPI
GetRelAbs16
(
HDC16
hdc
)
{
return
GetRelAbs
(
hdc
,
0
);
}
/***********************************************************************
* Get
CurLogFont (GDI.411
)
* Get
StretchBltMode (GDI.88
)
*/
DC_GET_VAL_16
(
HFONT
,
GetCurLogFont
,
hFont
)
INT16
WINAPI
GetStretchBltMode16
(
HDC16
hdc
)
{
return
GetStretchBltMode
(
hdc
);
}
/***********************************************************************
* Get
ArcDirection (GDI.524
)
* Get
TextColor (GDI.90
)
*/
DC_GET_VAL_16
(
INT
,
GetArcDirection
,
ArcDirection
)
COLORREF
WINAPI
GetTextColor16
(
HDC16
hdc
)
{
return
GetTextColor
(
hdc
);
}
/***********************************************************************
* Get
ArcDirection (GDI32.@
)
* Get
ViewportExt (GDI.94
)
*/
DC_GET_VAL_32
(
INT
,
GetArcDirection
,
ArcDirection
)
DWORD
WINAPI
GetViewportExt16
(
HDC16
hdc
)
{
SIZE
size
;
if
(
!
GetViewportExtEx
(
hdc
,
&
size
))
return
0
;
return
MAKELONG
(
size
.
cx
,
size
.
cy
);
}
/***********************************************************************
* Get
GraphicsMode (GDI32.@
)
* Get
ViewportOrg (GDI.95
)
*/
DC_GET_VAL_16
(
INT
,
GetGraphicsMode
,
GraphicsMode
)
DWORD
WINAPI
GetViewportOrg16
(
HDC16
hdc
)
{
POINT
pt
;
if
(
!
GetViewportOrgEx
(
hdc
,
&
pt
))
return
0
;
return
MAKELONG
(
pt
.
x
,
pt
.
y
);
}
/***********************************************************************
* Get
GraphicsMode (GDI32.@
)
* Get
WindowExt (GDI.96
)
*/
DC_GET_VAL_32
(
INT
,
GetGraphicsMode
,
GraphicsMode
)
DWORD
WINAPI
GetWindowExt16
(
HDC16
hdc
)
{
SIZE
size
;
if
(
!
GetWindowExtEx
(
hdc
,
&
size
))
return
0
;
return
MAKELONG
(
size
.
cx
,
size
.
cy
);
}
/***********************************************************************
* Get
BrushOrgEx (GDI.469
)
* Get
WindowOrg (GDI.97
)
*/
DC_GET_VAL_EX_16
(
GetBrushOrgEx
,
brushOrgX
,
brushOrgY
,
POINT
)
/* */
DWORD
WINAPI
GetWindowOrg16
(
HDC16
hdc
)
{
POINT
pt
;
if
(
!
GetWindowOrgEx
(
hdc
,
&
pt
))
return
0
;
return
MAKELONG
(
pt
.
x
,
pt
.
y
);
}
/***********************************************************************
*
GetBrushOrgEx (GDI32.@
)
*
InquireVisRgn (GDI.131
)
*/
DC_GET_VAL_EX_32
(
GetBrushOrgEx
,
brushOrgX
,
brushOrgY
,
POINT
)
/* */
HRGN16
WINAPI
InquireVisRgn16
(
HDC16
hdc
)
{
HRGN16
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
hVisRgn
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
CurrentPositionEx (GDI.470
)
* Get
BrushOrg (GDI.149
)
*/
DC_GET_VAL_EX_16
(
GetCurrentPositionEx
,
CursPosX
,
CursPosY
,
POINT
)
DWORD
WINAPI
GetBrushOrg16
(
HDC16
hdc
)
{
POINT
pt
;
if
(
!
GetBrushOrgEx
(
hdc
,
&
pt
))
return
0
;
return
MAKELONG
(
pt
.
x
,
pt
.
y
);
}
/***********************************************************************
* GetC
urrentPositionEx (GDI32.@
)
* GetC
lipRgn (GDI.173
)
*/
DC_GET_VAL_EX_32
(
GetCurrentPositionEx
,
CursPosX
,
CursPosY
,
POINT
)
HRGN16
WINAPI
GetClipRgn16
(
HDC16
hdc
)
{
HRGN16
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
hClipRgn
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
ViewportExtEx (GDI.472
)
* Get
TextAlign (GDI.345
)
*/
DC_GET_VAL_EX_16
(
GetViewportExtEx
,
vportExtX
,
vportExtY
,
SIZE
)
UINT16
WINAPI
GetTextAlign16
(
HDC16
hdc
)
{
return
GetTextAlign
(
hdc
);
}
/***********************************************************************
* Get
ViewportExtEx (GDI32.@
)
* Get
CurLogFont (GDI.411
)
*/
DC_GET_VAL_EX_32
(
GetViewportExtEx
,
vportExtX
,
vportExtY
,
SIZE
)
HFONT16
WINAPI
GetCurLogFont16
(
HDC16
hdc
)
{
HFONT16
ret
=
0
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
)
{
ret
=
dc
->
hFont
;
GDI_ReleaseObj
(
hdc
);
}
return
ret
;
}
/***********************************************************************
* Get
ViewportOrgEx (GDI.473
)
* Get
BrushOrgEx (GDI.469
)
*/
DC_GET_VAL_EX_16
(
GetViewportOrgEx
,
vportOrgX
,
vportOrgY
,
POINT
)
BOOL16
WINAPI
GetBrushOrgEx16
(
HDC16
hdc
,
LPPOINT16
pt
)
{
POINT
pt32
;
if
(
!
GetBrushOrgEx
(
hdc
,
&
pt32
))
return
FALSE
;
pt
->
x
=
pt32
.
x
;
pt
->
y
=
pt32
.
y
;
return
TRUE
;
}
/***********************************************************************
* Get
ViewportOrgEx (GDI32.@
)
* Get
CurrentPositionEx (GDI.470
)
*/
DC_GET_VAL_EX_32
(
GetViewportOrgEx
,
vportOrgX
,
vportOrgY
,
POINT
)
BOOL16
WINAPI
GetCurrentPositionEx16
(
HDC16
hdc
,
LPPOINT16
pt
)
{
POINT
pt32
;
if
(
!
GetCurrentPositionEx
(
hdc
,
&
pt32
))
return
FALSE
;
pt
->
x
=
pt32
.
x
;
pt
->
y
=
pt32
.
y
;
return
TRUE
;
}
/***********************************************************************
* Get
WindowExtEx (GDI.474
)
* Get
ViewportExtEx (GDI.472
)
*/
DC_GET_VAL_EX_16
(
GetWindowExtEx
,
wndExtX
,
wndExtY
,
SIZE
)
BOOL16
WINAPI
GetViewportExtEx16
(
HDC16
hdc
,
LPSIZE16
size
)
{
SIZE
size32
;
if
(
!
GetViewportExtEx
(
hdc
,
&
size32
))
return
FALSE
;
size
->
cx
=
size32
.
cx
;
size
->
cy
=
size32
.
cy
;
return
TRUE
;
}
/***********************************************************************
* Get
WindowExtEx (GDI32.@
)
* Get
ViewportOrgEx (GDI.473
)
*/
DC_GET_VAL_EX_32
(
GetWindowExtEx
,
wndExtX
,
wndExtY
,
SIZE
)
BOOL16
WINAPI
GetViewportOrgEx16
(
HDC16
hdc
,
LPPOINT16
pt
)
{
POINT
pt32
;
if
(
!
GetViewportOrgEx
(
hdc
,
&
pt32
))
return
FALSE
;
pt
->
x
=
pt32
.
x
;
pt
->
y
=
pt32
.
y
;
return
TRUE
;
}
/***********************************************************************
* GetWindowExtEx (GDI.474)
*/
BOOL16
WINAPI
GetWindowExtEx16
(
HDC16
hdc
,
LPSIZE16
size
)
{
SIZE
size32
;
if
(
!
GetWindowExtEx
(
hdc
,
&
size32
))
return
FALSE
;
size
->
cx
=
size32
.
cx
;
size
->
cy
=
size32
.
cy
;
return
TRUE
;
}
/***********************************************************************
* GetWindowOrgEx (GDI.475)
*/
DC_GET_VAL_EX_16
(
GetWindowOrgEx
,
wndOrgX
,
wndOrgY
,
POINT
)
BOOL16
WINAPI
GetWindowOrgEx16
(
HDC16
hdc
,
LPPOINT16
pt
)
{
POINT
pt32
;
if
(
!
GetWindowOrgEx
(
hdc
,
&
pt32
))
return
FALSE
;
pt
->
x
=
pt32
.
x
;
pt
->
y
=
pt32
.
y
;
return
TRUE
;
}
/***********************************************************************
* Get
WindowOrgEx (GDI32.@
)
* Get
ArcDirection (GDI.524
)
*/
DC_GET_VAL_EX_32
(
GetWindowOrgEx
,
wndOrgX
,
wndOrgY
,
POINT
)
INT16
WINAPI
GetArcDirection16
(
HDC16
hdc
)
{
return
GetArcDirection
(
hdc
);
}
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