xref: /reactos/win32ss/gdi/gdi32/wine/mfdrv/dc.c (revision c2c66aff)
1 /*
2  * MetaFile driver DC value 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include "mfdrv/metafiledrv.h"
22 
MFDRV_SaveDC(PHYSDEV dev)23 INT MFDRV_SaveDC( PHYSDEV dev )
24 {
25     return MFDRV_MetaParam0( dev, META_SAVEDC );
26 }
27 
MFDRV_RestoreDC(PHYSDEV dev,INT level)28 BOOL MFDRV_RestoreDC( PHYSDEV dev, INT level )
29 {
30     return MFDRV_MetaParam1( dev, META_RESTOREDC, level );
31 }
32 
MFDRV_SetTextAlign(PHYSDEV dev,UINT align)33 UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align )
34 {
35     return MFDRV_MetaParam2( dev, META_SETTEXTALIGN, HIWORD(align), LOWORD(align)) ? align : GDI_ERROR;
36 }
37 
MFDRV_SetBkMode(PHYSDEV dev,INT mode)38 INT MFDRV_SetBkMode( PHYSDEV dev, INT mode )
39 {
40     return MFDRV_MetaParam1( dev, META_SETBKMODE, (WORD)mode) ? mode : 0;
41 }
42 
MFDRV_SetBkColor(PHYSDEV dev,COLORREF color)43 COLORREF MFDRV_SetBkColor( PHYSDEV dev, COLORREF color )
44 {
45     return MFDRV_MetaParam2(dev, META_SETBKCOLOR, HIWORD(color), LOWORD(color)) ? color : CLR_INVALID;
46 }
47 
MFDRV_SetTextColor(PHYSDEV dev,COLORREF color)48 COLORREF MFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
49 {
50     return MFDRV_MetaParam2(dev, META_SETTEXTCOLOR, HIWORD(color), LOWORD(color)) ? color : CLR_INVALID;
51 }
52 
MFDRV_SetROP2(PHYSDEV dev,INT rop)53 INT MFDRV_SetROP2( PHYSDEV dev, INT rop )
54 {
55     return MFDRV_MetaParam1( dev, META_SETROP2, (WORD)rop) ? rop : 0;
56 }
57 
MFDRV_SetRelAbs(PHYSDEV dev,INT mode)58 INT MFDRV_SetRelAbs( PHYSDEV dev, INT mode )
59 {
60     return MFDRV_MetaParam1( dev, META_SETRELABS, (WORD)mode) ? mode : 0;
61 }
62 
MFDRV_SetPolyFillMode(PHYSDEV dev,INT mode)63 INT MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
64 {
65     return MFDRV_MetaParam1( dev, META_SETPOLYFILLMODE, (WORD)mode) ? mode : 0;
66 }
67 
MFDRV_SetStretchBltMode(PHYSDEV dev,INT mode)68 INT MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
69 {
70     return MFDRV_MetaParam1( dev, META_SETSTRETCHBLTMODE, (WORD)mode) ? mode : 0;
71 }
72 
MFDRV_IntersectClipRect(PHYSDEV dev,INT left,INT top,INT right,INT bottom)73 INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
74 {
75     return MFDRV_MetaParam4( dev, META_INTERSECTCLIPRECT, left, top, right, bottom );
76 }
77 
MFDRV_ExcludeClipRect(PHYSDEV dev,INT left,INT top,INT right,INT bottom)78 INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
79 {
80     return MFDRV_MetaParam4( dev, META_EXCLUDECLIPRECT, left, top, right, bottom );
81 }
82 
MFDRV_OffsetClipRgn(PHYSDEV dev,INT x,INT y)83 INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
84 {
85     return MFDRV_MetaParam2( dev, META_OFFSETCLIPRGN, x, y );
86 }
87 
MFDRV_SetMapMode(PHYSDEV dev,INT mode)88 INT MFDRV_SetMapMode( PHYSDEV dev, INT mode )
89 {
90     return MFDRV_MetaParam1( dev, META_SETMAPMODE, mode );
91 }
92 
MFDRV_SetViewportExtEx(PHYSDEV dev,INT x,INT y,SIZE * size)93 BOOL MFDRV_SetViewportExtEx( PHYSDEV dev, INT x, INT y, SIZE *size )
94 {
95     return MFDRV_MetaParam2( dev, META_SETVIEWPORTEXT, x, y );
96 }
97 
MFDRV_SetViewportOrgEx(PHYSDEV dev,INT x,INT y,POINT * pt)98 BOOL MFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
99 {
100     return MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y );
101 }
102 
MFDRV_SetWindowExtEx(PHYSDEV dev,INT x,INT y,SIZE * size)103 BOOL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size )
104 {
105     return MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y );
106 }
107 
MFDRV_SetWindowOrgEx(PHYSDEV dev,INT x,INT y,POINT * pt)108 BOOL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
109 {
110     return MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y );
111 }
112 
MFDRV_OffsetViewportOrgEx(PHYSDEV dev,INT x,INT y,POINT * pt)113 BOOL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
114 {
115     return MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y );
116 }
117 
MFDRV_OffsetWindowOrgEx(PHYSDEV dev,INT x,INT y,POINT * pt)118 BOOL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
119 {
120     return MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y );
121 }
122 
MFDRV_ScaleViewportExtEx(PHYSDEV dev,INT xNum,INT xDenom,INT yNum,INT yDenom,SIZE * size)123 BOOL MFDRV_ScaleViewportExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
124 {
125     return MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom );
126 }
127 
MFDRV_ScaleWindowExtEx(PHYSDEV dev,INT xNum,INT xDenom,INT yNum,INT yDenom,SIZE * size)128 BOOL MFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
129 {
130     return MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom );
131 }
132 
MFDRV_SetTextJustification(PHYSDEV dev,INT extra,INT breaks)133 BOOL MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks )
134 {
135     return MFDRV_MetaParam2( dev, META_SETTEXTJUSTIFICATION, extra, breaks );
136 }
137 
MFDRV_SetTextCharacterExtra(PHYSDEV dev,INT extra)138 INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra )
139 {
140     return MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra ) ? extra : 0x80000000;
141 }
142 
MFDRV_SetMapperFlags(PHYSDEV dev,DWORD flags)143 DWORD MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
144 {
145     return MFDRV_MetaParam2( dev, META_SETMAPPERFLAGS, HIWORD(flags), LOWORD(flags) ) ? flags : GDI_ERROR;
146 }
147 
MFDRV_AbortPath(PHYSDEV dev)148 BOOL MFDRV_AbortPath( PHYSDEV dev )
149 {
150     return FALSE;
151 }
152 
MFDRV_BeginPath(PHYSDEV dev)153 BOOL MFDRV_BeginPath( PHYSDEV dev )
154 {
155     return FALSE;
156 }
157 
MFDRV_CloseFigure(PHYSDEV dev)158 BOOL MFDRV_CloseFigure( PHYSDEV dev )
159 {
160     return FALSE;
161 }
162 
MFDRV_EndPath(PHYSDEV dev)163 BOOL MFDRV_EndPath( PHYSDEV dev )
164 {
165     return FALSE;
166 }
167 
MFDRV_FillPath(PHYSDEV dev)168 BOOL MFDRV_FillPath( PHYSDEV dev )
169 {
170     return FALSE;
171 }
172 
MFDRV_FlattenPath(PHYSDEV dev)173 BOOL MFDRV_FlattenPath( PHYSDEV dev )
174 {
175     return FALSE;
176 }
177 
MFDRV_SelectClipPath(PHYSDEV dev,INT iMode)178 BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
179 {
180     return FALSE;
181 }
182 
MFDRV_StrokeAndFillPath(PHYSDEV dev)183 BOOL MFDRV_StrokeAndFillPath( PHYSDEV dev )
184 {
185     return FALSE;
186 }
187 
MFDRV_StrokePath(PHYSDEV dev)188 BOOL MFDRV_StrokePath( PHYSDEV dev )
189 {
190     return FALSE;
191 }
192 
MFDRV_WidenPath(PHYSDEV dev)193 BOOL MFDRV_WidenPath( PHYSDEV dev )
194 {
195     return FALSE;
196 }
197 
MFDRV_SetDCBrushColor(PHYSDEV dev,COLORREF color)198 COLORREF MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color )
199 {
200     return CLR_INVALID;
201 }
202 
MFDRV_SetDCPenColor(PHYSDEV dev,COLORREF color)203 COLORREF MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color )
204 {
205     return CLR_INVALID;
206 }
207