2 * Enhanced MetaFile driver mapping functions
4 * Copyright 1999 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "enhmfdrv/enhmetafiledrv.h"
23 INT CDECL
EMFDRV_SetMapMode( PHYSDEV dev
, INT mode
)
26 emr
.emr
.iType
= EMR_SETMAPMODE
;
27 emr
.emr
.nSize
= sizeof(emr
);
30 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
33 INT CDECL
EMFDRV_SetViewportExt( PHYSDEV dev
, INT cx
, INT cy
)
35 EMRSETVIEWPORTEXTEX emr
;
37 emr
.emr
.iType
= EMR_SETVIEWPORTEXTEX
;
38 emr
.emr
.nSize
= sizeof(emr
);
39 emr
.szlExtent
.cx
= cx
;
40 emr
.szlExtent
.cy
= cy
;
42 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
45 INT CDECL
EMFDRV_SetWindowExt( PHYSDEV dev
, INT cx
, INT cy
)
47 EMRSETWINDOWEXTEX emr
;
49 emr
.emr
.iType
= EMR_SETWINDOWEXTEX
;
50 emr
.emr
.nSize
= sizeof(emr
);
51 emr
.szlExtent
.cx
= cx
;
52 emr
.szlExtent
.cy
= cy
;
54 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
57 INT CDECL
EMFDRV_SetViewportOrg( PHYSDEV dev
, INT x
, INT y
)
59 EMRSETVIEWPORTORGEX emr
;
61 emr
.emr
.iType
= EMR_SETVIEWPORTORGEX
;
62 emr
.emr
.nSize
= sizeof(emr
);
66 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
69 INT CDECL
EMFDRV_SetWindowOrg( PHYSDEV dev
, INT x
, INT y
)
71 EMRSETWINDOWORGEX emr
;
73 emr
.emr
.iType
= EMR_SETWINDOWORGEX
;
74 emr
.emr
.nSize
= sizeof(emr
);
78 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
81 INT CDECL
EMFDRV_ScaleViewportExt( PHYSDEV dev
, INT xNum
, INT xDenom
, INT yNum
,
84 EMRSCALEVIEWPORTEXTEX emr
;
86 emr
.emr
.iType
= EMR_SCALEVIEWPORTEXTEX
;
87 emr
.emr
.nSize
= sizeof(emr
);
93 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
96 INT CDECL
EMFDRV_ScaleWindowExt( PHYSDEV dev
, INT xNum
, INT xDenom
, INT yNum
,
99 EMRSCALEWINDOWEXTEX emr
;
101 emr
.emr
.iType
= EMR_SCALEWINDOWEXTEX
;
102 emr
.emr
.nSize
= sizeof(emr
);
108 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
111 BOOL CDECL
EMFDRV_SetWorldTransform( PHYSDEV dev
, const XFORM
*xform
)
113 EMRSETWORLDTRANSFORM emr
;
115 emr
.emr
.iType
= EMR_SETWORLDTRANSFORM
;
116 emr
.emr
.nSize
= sizeof(emr
);
119 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
122 BOOL CDECL
EMFDRV_ModifyWorldTransform( PHYSDEV dev
, const XFORM
*xform
, INT mode
)
124 EMRMODIFYWORLDTRANSFORM emr
;
126 emr
.emr
.iType
= EMR_MODIFYWORLDTRANSFORM
;
127 emr
.emr
.nSize
= sizeof(emr
);
131 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
134 INT CDECL
EMFDRV_OffsetViewportOrg( PHYSDEV dev
, INT x
, INT y
)
137 EMRSETVIEWPORTORGEX emr
;
138 EMFDRV_PDEVICE
* physDev
= (EMFDRV_PDEVICE
*)dev
;
140 GetViewportOrgEx(physDev
->hdc
, &pt
);
142 emr
.emr
.iType
= EMR_SETVIEWPORTORGEX
;
143 emr
.emr
.nSize
= sizeof(emr
);
144 emr
.ptlOrigin
.x
= pt
.x
+ x
;
145 emr
.ptlOrigin
.y
= pt
.y
+ y
;
147 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
150 INT CDECL
EMFDRV_OffsetWindowOrg( PHYSDEV dev
, INT x
, INT y
)
153 EMRSETWINDOWORGEX emr
;
154 EMFDRV_PDEVICE
* physDev
= (EMFDRV_PDEVICE
*)dev
;
156 GetWindowOrgEx(physDev
->hdc
, &pt
);
158 emr
.emr
.iType
= EMR_SETWINDOWORGEX
;
159 emr
.emr
.nSize
= sizeof(emr
);
160 emr
.ptlOrigin
.x
= pt
.x
+ x
;
161 emr
.ptlOrigin
.y
= pt
.y
+ y
;
163 return EMFDRV_WriteRecord( dev
, &emr
.emr
);