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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "enhmfdrv/enhmetafiledrv.h"
23 INT
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
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
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
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
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
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
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
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
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
EMFDRV_OffsetViewportOrg( PHYSDEV dev
, INT x
, INT y
)
136 EMRSETVIEWPORTORGEX emr
;
137 EMFDRV_PDEVICE
* physDev
= (EMFDRV_PDEVICE
*)dev
;
139 emr
.emr
.iType
= EMR_SETVIEWPORTORGEX
;
140 emr
.emr
.nSize
= sizeof(emr
);
141 emr
.ptlOrigin
.x
= physDev
->dc
->vportOrgX
+ x
;
142 emr
.ptlOrigin
.y
= physDev
->dc
->vportOrgY
+ y
;
144 return EMFDRV_WriteRecord( dev
, &emr
.emr
);
147 INT
EMFDRV_OffsetWindowOrg( PHYSDEV dev
, INT x
, INT y
)
149 EMRSETWINDOWORGEX emr
;
150 EMFDRV_PDEVICE
* physDev
= (EMFDRV_PDEVICE
*)dev
;
152 emr
.emr
.iType
= EMR_SETWINDOWORGEX
;
153 emr
.emr
.nSize
= sizeof(emr
);
154 emr
.ptlOrigin
.x
= physDev
->dc
->wndOrgX
+ x
;
155 emr
.ptlOrigin
.y
= physDev
->dc
->wndOrgY
+ y
;
157 return EMFDRV_WriteRecord( dev
, &emr
.emr
);