Added LGPL standard comment, and copyright notices where necessary.
[wine] / graphics / enhmetafiledrv / mapping.c
1 /*
2  * Enhanced MetaFile driver mapping functions
3  *
4  * Copyright 1999 Huw D M Davies
5  *
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.
10  *
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.
15  *
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
19  */
20 #include "enhmetafiledrv.h"
21
22 BOOL EMFDRV_SetViewportExt( DC *dc, INT cx, INT cy )
23 {
24     EMRSETVIEWPORTEXTEX emr;
25
26     emr.emr.iType = EMR_SETVIEWPORTEXTEX;
27     emr.emr.nSize = sizeof(emr);
28     emr.szlExtent.cx = cx;
29     emr.szlExtent.cy = cy;
30
31     return EMFDRV_WriteRecord( dc, &emr.emr );
32 }
33
34 BOOL EMFDRV_SetWindowExt( DC *dc, INT cx, INT cy )
35 {
36     EMRSETWINDOWEXTEX emr;
37
38     emr.emr.iType = EMR_SETWINDOWEXTEX;
39     emr.emr.nSize = sizeof(emr);
40     emr.szlExtent.cx = cx;
41     emr.szlExtent.cy = cy;
42
43     return EMFDRV_WriteRecord( dc, &emr.emr );
44 }
45
46 BOOL EMFDRV_SetViewportOrg( DC *dc, INT x, INT y )
47 {
48     EMRSETVIEWPORTORGEX emr;
49
50     emr.emr.iType = EMR_SETVIEWPORTORGEX;
51     emr.emr.nSize = sizeof(emr);
52     emr.ptlOrigin.x = x;
53     emr.ptlOrigin.y = y;
54
55     return EMFDRV_WriteRecord( dc, &emr.emr );
56 }
57
58 BOOL EMFDRV_SetWindowOrg( DC *dc, INT x, INT y )
59 {
60     EMRSETWINDOWORGEX emr;
61
62     emr.emr.iType = EMR_SETWINDOWORGEX;
63     emr.emr.nSize = sizeof(emr);
64     emr.ptlOrigin.x = x;
65     emr.ptlOrigin.y = y;
66
67     return EMFDRV_WriteRecord( dc, &emr.emr );
68 }
69
70 BOOL EMFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom, INT yNum,
71                               INT yDenom )
72 {
73     EMRSCALEVIEWPORTEXTEX emr;
74
75     emr.emr.iType = EMR_SCALEVIEWPORTEXTEX;
76     emr.emr.nSize = sizeof(emr);
77     emr.xNum      = xNum;
78     emr.xDenom    = xDenom;
79     emr.yNum      = yNum;
80     emr.yDenom    = yDenom;
81
82     return EMFDRV_WriteRecord( dc, &emr.emr );
83 }
84
85 BOOL EMFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom, INT yNum,
86                             INT yDenom )
87 {
88     EMRSCALEWINDOWEXTEX emr;
89
90     emr.emr.iType = EMR_SCALEWINDOWEXTEX;
91     emr.emr.nSize = sizeof(emr);
92     emr.xNum      = xNum;
93     emr.xDenom    = xDenom;
94     emr.yNum      = yNum;
95     emr.yDenom    = yDenom;
96
97     return EMFDRV_WriteRecord( dc, &emr.emr );
98 }
99
100