ReactOS 0.4.15-dev-8100-g1887773
metafiledrv.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "gdi_private.h"
Include dependency graph for metafiledrv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  METAFILEDRV_PDEVICE
 

Macros

#define HANDLE_LIST_INC   20
 

Functions

BOOL MFDRV_MetaParam0 (PHYSDEV dev, short func) DECLSPEC_HIDDEN
 
BOOL MFDRV_MetaParam1 (PHYSDEV dev, short func, short param1) DECLSPEC_HIDDEN
 
BOOL MFDRV_MetaParam2 (PHYSDEV dev, short func, short param1, short param2) DECLSPEC_HIDDEN
 
BOOL MFDRV_MetaParam4 (PHYSDEV dev, short func, short param1, short param2, short param3, short param4) DECLSPEC_HIDDEN
 
BOOL MFDRV_MetaParam6 (PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6) DECLSPEC_HIDDEN
 
BOOL MFDRV_MetaParam8 (PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8) DECLSPEC_HIDDEN
 
BOOL MFDRV_WriteRecord (PHYSDEV dev, METARECORD *mr, DWORD rlen) DECLSPEC_HIDDEN
 
UINT MFDRV_AddHandle (PHYSDEV dev, HGDIOBJ obj) DECLSPEC_HIDDEN
 
BOOL MFDRV_RemoveHandle (PHYSDEV dev, UINT index) DECLSPEC_HIDDEN
 
INT16 MFDRV_CreateBrushIndirect (PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
 
BOOL MFDRV_AbortPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_Arc (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL MFDRV_BeginPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_Chord (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL MFDRV_CloseFigure (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_DeleteObject (PHYSDEV dev, HGDIOBJ obj) DECLSPEC_HIDDEN
 
BOOL MFDRV_Ellipse (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL MFDRV_EndPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
INT MFDRV_ExcludeClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL MFDRV_ExtFloodFill (PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType) DECLSPEC_HIDDEN
 
INT MFDRV_ExtSelectClipRgn (PHYSDEV dev, HRGN hrgn, INT mode) DECLSPEC_HIDDEN
 
BOOL MFDRV_ExtTextOut (PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx) DECLSPEC_HIDDEN
 
BOOL MFDRV_FillPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_FillRgn (PHYSDEV dev, HRGN hrgn, HBRUSH hbrush) DECLSPEC_HIDDEN
 
BOOL MFDRV_FlattenPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_FrameRgn (PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y) DECLSPEC_HIDDEN
 
INT MFDRV_IntersectClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL MFDRV_InvertRgn (PHYSDEV dev, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL MFDRV_LineTo (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL MFDRV_MoveTo (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
INT MFDRV_OffsetClipRgn (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL MFDRV_OffsetViewportOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL MFDRV_OffsetWindowOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL MFDRV_PaintRgn (PHYSDEV dev, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL MFDRV_PatBlt (PHYSDEV dev, struct bitblt_coords *dst, DWORD rop) DECLSPEC_HIDDEN
 
BOOL MFDRV_Pie (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL MFDRV_PolyBezier (PHYSDEV dev, const POINT *pt, DWORD count) DECLSPEC_HIDDEN
 
BOOL MFDRV_PolyBezierTo (PHYSDEV dev, const POINT *pt, DWORD count) DECLSPEC_HIDDEN
 
BOOL MFDRV_PolyPolygon (PHYSDEV dev, const POINT *pt, const INT *counts, UINT polygons) DECLSPEC_HIDDEN
 
BOOL MFDRV_Polygon (PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
 
BOOL MFDRV_Polyline (PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
 
BOOL MFDRV_Rectangle (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL MFDRV_RestoreDC (PHYSDEV dev, INT level) DECLSPEC_HIDDEN
 
BOOL MFDRV_RoundRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height) DECLSPEC_HIDDEN
 
INT MFDRV_SaveDC (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_ScaleViewportExtEx (PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size) DECLSPEC_HIDDEN
 
BOOL MFDRV_ScaleWindowExtEx (PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size) DECLSPEC_HIDDEN
 
HBITMAP MFDRV_SelectBitmap (PHYSDEV dev, HBITMAP handle) DECLSPEC_HIDDEN
 
HBRUSH MFDRV_SelectBrush (PHYSDEV dev, HBRUSH hbrush, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
 
BOOL MFDRV_SelectClipPath (PHYSDEV dev, INT iMode) DECLSPEC_HIDDEN
 
HFONT MFDRV_SelectFont (PHYSDEV dev, HFONT handle, UINT *aa_flags) DECLSPEC_HIDDEN
 
HPEN MFDRV_SelectPen (PHYSDEV dev, HPEN handle, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
 
HPALETTE MFDRV_SelectPalette (PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground) DECLSPEC_HIDDEN
 
UINT MFDRV_RealizePalette (PHYSDEV dev, HPALETTE hPalette, BOOL primary) DECLSPEC_HIDDEN
 
COLORREF MFDRV_SetBkColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
INT MFDRV_SetBkMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
COLORREF MFDRV_SetDCBrushColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
COLORREF MFDRV_SetDCPenColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
INT MFDRV_SetMapMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
DWORD MFDRV_SetMapperFlags (PHYSDEV dev, DWORD flags) DECLSPEC_HIDDEN
 
COLORREF MFDRV_SetPixel (PHYSDEV dev, INT x, INT y, COLORREF color) DECLSPEC_HIDDEN
 
INT MFDRV_SetPolyFillMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
INT MFDRV_SetROP2 (PHYSDEV dev, INT rop) DECLSPEC_HIDDEN
 
INT MFDRV_SetRelAbs (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
INT MFDRV_SetStretchBltMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
UINT MFDRV_SetTextAlign (PHYSDEV dev, UINT align) DECLSPEC_HIDDEN
 
INT MFDRV_SetTextCharacterExtra (PHYSDEV dev, INT extra) DECLSPEC_HIDDEN
 
COLORREF MFDRV_SetTextColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
BOOL MFDRV_SetTextJustification (PHYSDEV dev, INT extra, INT breaks) DECLSPEC_HIDDEN
 
BOOL MFDRV_SetViewportExtEx (PHYSDEV dev, INT x, INT y, SIZE *size) DECLSPEC_HIDDEN
 
BOOL MFDRV_SetViewportOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL MFDRV_SetWindowExtEx (PHYSDEV dev, INT x, INT y, SIZE *size) DECLSPEC_HIDDEN
 
BOOL MFDRV_SetWindowOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL MFDRV_StretchBlt (PHYSDEV devDst, struct bitblt_coords *dst, PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop) DECLSPEC_HIDDEN
 
INT MFDRV_SetDIBitsToDevice (PHYSDEV dev, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, BITMAPINFO *info, UINT coloruse) DECLSPEC_HIDDEN
 
INT MFDRV_StretchDIBits (PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, const void *bits, BITMAPINFO *info, UINT wUsage, DWORD dwRop) DECLSPEC_HIDDEN
 
BOOL MFDRV_StrokeAndFillPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_StrokePath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL MFDRV_WidenPath (PHYSDEV dev) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

Definition at line 42 of file metafiledrv.h.

Function Documentation

◆ MFDRV_AbortPath()

BOOL MFDRV_AbortPath ( PHYSDEV  dev)

Definition at line 148 of file dc.c.

149{
150 return FALSE;
151}
#define FALSE
Definition: types.h:117

◆ MFDRV_AddHandle()

UINT MFDRV_AddHandle ( PHYSDEV  dev,
HGDIOBJ  obj 
)

Definition at line 39 of file objects.c.

40{
43
44 for(index = 0; index < physDev->handles_size; index++)
45 if(physDev->handles[index] == 0) break;
46 if(index == physDev->handles_size) {
47 physDev->handles_size += HANDLE_LIST_INC;
49 physDev->handles,
50 physDev->handles_size * sizeof(physDev->handles[0]));
51 }
52 physDev->handles[index] = get_full_gdi_handle( obj );
53
54 physDev->cur_handles++;
55 if(physDev->cur_handles > physDev->mh->mtNoObjects)
56 physDev->mh->mtNoObjects++;
57
58 return index ; /* index 0 is not reserved for metafiles */
59}
unsigned short UINT16
#define index(s, c)
Definition: various.h:29
#define GetProcessHeap()
Definition: compat.h:736
#define HeapReAlloc
Definition: compat.h:734
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define HANDLE_LIST_INC
Definition: gdi32p.h:74
#define get_full_gdi_handle
Definition: gdi_private.h:229
GLuint index
Definition: glext.h:6031
METAHEADER * mh
Definition: metafiledrv.h:36
WORD mtNoObjects
Definition: wingdi.h:2314

Referenced by MFDRV_CreateBrushIndirect(), MFDRV_CreateFontIndirect(), MFDRV_CreatePalette(), MFDRV_CreatePenIndirect(), and MFDRV_CreateRegion().

◆ MFDRV_Arc()

BOOL MFDRV_Arc ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 53 of file graphics.c.

55{
57 xstart, ystart, xend, yend);
58}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
Definition: init.c:609
#define META_ARC
Definition: wingdi.h:233

◆ MFDRV_BeginPath()

BOOL MFDRV_BeginPath ( PHYSDEV  dev)

Definition at line 153 of file dc.c.

154{
155 return FALSE;
156}

◆ MFDRV_Chord()

BOOL MFDRV_Chord ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 75 of file graphics.c.

77{
79 xstart, ystart, xend, yend);
80}
#define META_CHORD
Definition: wingdi.h:257

◆ MFDRV_CloseFigure()

BOOL MFDRV_CloseFigure ( PHYSDEV  dev)

Definition at line 158 of file dc.c.

159{
160 return FALSE;
161}

◆ MFDRV_CreateBrushIndirect()

INT16 MFDRV_CreateBrushIndirect ( PHYSDEV  dev,
HBRUSH  hBrush 
)

Definition at line 149 of file objects.c.

150{
151 DWORD size;
152 METARECORD *mr;
153 LOGBRUSH logbrush;
154 BOOL r;
155
156 if (!GetObjectA( hBrush, sizeof(logbrush), &logbrush )) return -1;
157
158 switch(logbrush.lbStyle)
159 {
160 case BS_SOLID:
161 case BS_NULL:
162 case BS_HATCHED:
163 {
164 LOGBRUSH16 lb16;
165
166 lb16.lbStyle = logbrush.lbStyle;
167 lb16.lbColor = logbrush.lbColor;
168 lb16.lbHatch = logbrush.lbHatch;
169 size = sizeof(METARECORD) + sizeof(LOGBRUSH16) - 2;
170 mr = HeapAlloc( GetProcessHeap(), 0, size );
171 mr->rdSize = size / 2;
173 memcpy( mr->rdParm, &lb16, sizeof(LOGBRUSH16));
174 break;
175 }
176 case BS_PATTERN:
177 case BS_DIBPATTERN:
178 {
179#ifdef __REACTOS__
180 char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)]; // ros
181#else
182 char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
183#endif
184 BITMAPINFO *dst_info, *src_info = (BITMAPINFO *)buffer;
185 DWORD info_size;
186 char *dst_ptr;
187 void *bits;
188 UINT usage;
189
190 if (!get_brush_bitmap_info( hBrush, src_info, &bits, &usage )) goto done;
191
192 info_size = get_dib_info_size( src_info, usage );
193 size = FIELD_OFFSET( METARECORD, rdParm[2] ) + info_size + src_info->bmiHeader.biSizeImage;
194
195 if (!(mr = HeapAlloc( GetProcessHeap(), 0, size ))) goto done;
197 mr->rdSize = size / 2;
198 mr->rdParm[0] = logbrush.lbStyle;
199 mr->rdParm[1] = usage;
200 dst_info = (BITMAPINFO *)(mr->rdParm + 2);
201 memcpy( dst_info, src_info, info_size );
202 if (dst_info->bmiHeader.biClrUsed == 1 << dst_info->bmiHeader.biBitCount)
203 dst_info->bmiHeader.biClrUsed = 0;
204 dst_ptr = (char *)dst_info + info_size;
205
206 /* always return a bottom-up DIB */
207 if (dst_info->bmiHeader.biHeight < 0)
208 {
209 int i, width_bytes = get_dib_stride( dst_info->bmiHeader.biWidth,
210 dst_info->bmiHeader.biBitCount );
211 dst_info->bmiHeader.biHeight = -dst_info->bmiHeader.biHeight;
212 dst_ptr += (dst_info->bmiHeader.biHeight - 1) * width_bytes;
213 for (i = 0; i < dst_info->bmiHeader.biHeight; i++, dst_ptr -= width_bytes)
214 memcpy( dst_ptr, (char *)bits + i * width_bytes, width_bytes );
215 }
216 else memcpy( dst_ptr, bits, src_info->bmiHeader.biSizeImage );
217 break;
218 }
219
220 default:
221 FIXME("Unknown brush style %x\n", logbrush.lbStyle);
222 return 0;
223 }
224 r = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
225 HeapFree(GetProcessHeap(), 0, mr);
226 if( !r )
227 return -1;
228done:
229 return MFDRV_AddHandle( dev, hBrush );
230}
#define FIXME(fmt,...)
Definition: debug.h:114
static int get_dib_stride(int width, int bpp)
Definition: imagelist.c:198
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
ULONG RGBQUAD
Definition: precomp.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:212
BOOL get_brush_bitmap_info(HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage) DECLSPEC_HIDDEN
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define bits
Definition: infblock.c:15
UINT MFDRV_AddHandle(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static UINT width_bytes(UINT width, UINT bpp)
Definition: tiffformat.c:888
unsigned int UINT
Definition: ndis.h:50
UINT16 lbStyle
Definition: wingdi16.h:32
INT16 lbHatch
Definition: wingdi16.h:34
COLORREF lbColor
Definition: wingdi16.h:33
USHORT biBitCount
Definition: precomp.h:46
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
UINT lbStyle
Definition: wingdi.h:1747
ULONG_PTR lbHatch
Definition: wingdi.h:1749
COLORREF lbColor
Definition: wingdi.h:1748
DWORD rdSize
Definition: wingdi.h:2345
WORD rdParm[1]
Definition: wingdi.h:2347
WORD rdFunction
Definition: wingdi.h:2346
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
BOOL MFDRV_WriteRecord(PHYSDEV dev, METARECORD *mr, DWORD rlen)
Definition: init.c:475
#define META_CREATEBRUSHINDIRECT
Definition: wingdi.h:277
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define BS_HATCHED
Definition: wingdi.h:1089
#define BS_PATTERN
Definition: wingdi.h:1090
#define BS_DIBPATTERN
Definition: wingdi.h:1092
struct tagBITMAPINFO BITMAPINFO
#define BS_NULL
Definition: wingdi.h:1087
struct tagMETARECORD METARECORD
#define META_DIBCREATEPATTERNBRUSH
Definition: wingdi.h:269
#define BS_SOLID
Definition: wingdi.h:1086

Referenced by MFDRV_FillRgn(), MFDRV_FrameRgn(), and MFDRV_SelectBrush().

◆ MFDRV_DeleteObject()

BOOL MFDRV_DeleteObject ( PHYSDEV  dev,
HGDIOBJ  obj 
)

Definition at line 98 of file objects.c.

99{
100 METARECORD mr;
102 INT16 index;
103 BOOL ret = TRUE;
104
106 if( index < 0 )
107 return FALSE;
108
109 mr.rdSize = sizeof mr / 2;
111 mr.rdParm[0] = index;
112
113 if(!MFDRV_WriteRecord( dev, &mr, mr.rdSize*2 ))
114 ret = FALSE;
115
116 physDev->handles[index] = 0;
117 physDev->cur_handles--;
118 return ret;
119}
signed short INT16
#define TRUE
Definition: types.h:120
static INT16 MFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:81
int ret
#define META_DELETEOBJECT
Definition: wingdi.h:272

◆ MFDRV_Ellipse()

BOOL MFDRV_Ellipse ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 85 of file graphics.c.

86{
88}
BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, short param3, short param4)
Definition: init.c:566
#define META_ELLIPSE
Definition: wingdi.h:234

◆ MFDRV_EndPath()

BOOL MFDRV_EndPath ( PHYSDEV  dev)

Definition at line 163 of file dc.c.

164{
165 return FALSE;
166}

◆ MFDRV_ExcludeClipRect()

INT MFDRV_ExcludeClipRect ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 78 of file dc.c.

79{
81}
#define META_EXCLUDECLIPRECT
Definition: wingdi.h:231

◆ MFDRV_ExtFloodFill()

BOOL MFDRV_ExtFloodFill ( PHYSDEV  dev,
INT  x,
INT  y,
COLORREF  color,
UINT  fillType 
)

Definition at line 244 of file graphics.c.

245{
247 LOWORD(color));
248}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint color
Definition: glext.h:6243
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
#define META_FLOODFILL
Definition: wingdi.h:235

◆ MFDRV_ExtSelectClipRgn()

INT MFDRV_ExtSelectClipRgn ( PHYSDEV  dev,
HRGN  hrgn,
INT  mode 
)

Definition at line 407 of file graphics.c.

408{
409 INT16 iRgn;
410 INT ret;
411
412 if (mode != RGN_COPY) return ERROR;
413 if (!hrgn) return NULLREGION;
414 iRgn = MFDRV_CreateRegion( dev, hrgn );
415 if(iRgn == -1) return ERROR;
418 MFDRV_RemoveHandle( dev, iRgn );
419 return ret;
420}
static HRGN hrgn
#define ERROR(name)
Definition: error_private.h:53
GLenum mode
Definition: glext.h:6217
BOOL MFDRV_RemoveHandle(PHYSDEV dev, UINT index) DECLSPEC_HIDDEN
Definition: objects.c:64
int32_t INT
Definition: typedefs.h:58
static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn)
Definition: graphics.c:257
BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1)
Definition: init.c:532
#define NULLREGION
Definition: wingdi.h:361
#define RGN_COPY
Definition: wingdi.h:357
#define META_SELECTOBJECT
Definition: wingdi.h:255

◆ MFDRV_ExtTextOut()

BOOL MFDRV_ExtTextOut ( PHYSDEV  dev,
INT  x,
INT  y,
UINT  flags,
const RECT lprect,
LPCWSTR  str,
UINT  count,
const INT lpDx 
)

Definition at line 75 of file text.c.

77{
78 RECT16 rect16;
79 LPINT16 lpdx16 = NULL;
80 BOOL ret;
81 unsigned int i, j;
82 LPSTR ascii;
83 DWORD len;
84 CHARSETINFO csi;
85 int charset = GetTextCharset( dev->hdc );
86 UINT cp = CP_ACP;
87
89 cp = csi.ciACP;
90 else {
91 switch(charset) {
92 case OEM_CHARSET:
93 cp = GetOEMCP();
94 break;
95 case DEFAULT_CHARSET:
96 cp = GetACP();
97 break;
98
99 case VISCII_CHARSET:
100 case TCVN_CHARSET:
101 case KOI8_CHARSET:
102 case ISO3_CHARSET:
103 case ISO4_CHARSET:
104 case ISO10_CHARSET:
105 case CELTIC_CHARSET:
106 /* FIXME: These have no place here, but because x11drv
107 enumerates fonts with these (made up) charsets some apps
108 might use them and then the FIXME below would become
109 annoying. Now we could pick the intended codepage for
110 each of these, but since it's broken anyway we'll just
111 use CP_ACP and hope it'll go away...
112 */
113 cp = CP_ACP;
114 break;
115
116
117 default:
118 FIXME("Can't find codepage for charset %d\n", charset);
119 break;
120 }
121 }
122
123
124 TRACE("cp == %d\n", cp);
126 ascii = HeapAlloc(GetProcessHeap(), 0, len);
127 WideCharToMultiByte(cp, 0, str, count, ascii, len, NULL, NULL);
128 TRACE("mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len));
129
130
131 if (lprect)
132 {
133 rect16.left = lprect->left;
134 rect16.top = lprect->top;
135 rect16.right = lprect->right;
136 rect16.bottom = lprect->bottom;
137 }
138
139 if(lpDx) {
140 lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16)*len );
141 for(i = j = 0; i < len; )
142 if(IsDBCSLeadByteEx(cp, ascii[i])) {
143 lpdx16[i++] = lpDx[j++];
144 lpdx16[i++] = 0;
145 } else
146 lpdx16[i++] = lpDx[j++];
147 }
148
149 ret = MFDRV_MetaExtTextOut(dev,x,y,flags,lprect?&rect16:NULL,ascii,len,lpdx16);
150 HeapFree( GetProcessHeap(), 0, ascii );
151 HeapFree( GetProcessHeap(), 0, lpdx16 );
152 return ret;
153}
#define ULongToPtr(ul)
Definition: basetsd.h:92
CFF_Charset charset
Definition: cffcmap.c:138
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define WideCharToMultiByte
Definition: compat.h:111
UINT WINAPI GetACP(void)
Definition: locale.c:2020
BOOL WINAPI IsDBCSLeadByteEx(UINT codepage, BYTE testchar)
Definition: locale.c:2103
UINT WINAPI GetOEMCP(void)
Definition: locale.c:2059
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define debugstr_wn
Definition: kernel32.h:33
POINT cp
Definition: magnifier.c:59
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
INT16 left
Definition: windef16.h:143
INT16 bottom
Definition: windef16.h:146
INT16 top
Definition: windef16.h:144
INT16 right
Definition: windef16.h:145
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
static BOOL MFDRV_MetaExtTextOut(PHYSDEV dev, short x, short y, UINT16 flags, const RECT16 *rect, LPCSTR str, short count, const INT16 *lpDx)
Definition: text.c:36
INT16 * LPINT16
Definition: windef16.h:43
#define TCVN_CHARSET
Definition: wingdi.h:408
#define ISO3_CHARSET
Definition: wingdi.h:410
#define CELTIC_CHARSET
Definition: wingdi.h:413
#define KOI8_CHARSET
Definition: wingdi.h:409
#define VISCII_CHARSET
Definition: wingdi.h:407
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define ISO10_CHARSET
Definition: wingdi.h:412
int WINAPI GetTextCharset(_In_ HDC)
Definition: text.c:187
#define TCI_SRCCHARSET
Definition: wingdi.h:961
#define OEM_CHARSET
Definition: wingdi.h:400
#define ISO4_CHARSET
Definition: wingdi.h:411
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
char * LPSTR
Definition: xmlstorage.h:182

◆ MFDRV_FillPath()

BOOL MFDRV_FillPath ( PHYSDEV  dev)

Definition at line 168 of file dc.c.

169{
170 return FALSE;
171}

◆ MFDRV_FillRgn()

BOOL MFDRV_FillRgn ( PHYSDEV  dev,
HRGN  hrgn,
HBRUSH  hbrush 
)

Definition at line 376 of file graphics.c.

377{
378 INT16 iRgn, iBrush;
379 iRgn = MFDRV_CreateRegion( dev, hrgn );
380 if(iRgn == -1)
381 return FALSE;
383 if(!iBrush)
384 return FALSE;
385 return MFDRV_MetaParam2( dev, META_FILLREGION, iRgn, iBrush );
386}
static HBRUSH hbrush
INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
Definition: objects.c:149
BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2)
Definition: init.c:548
#define META_FILLREGION
Definition: wingdi.h:250

◆ MFDRV_FlattenPath()

BOOL MFDRV_FlattenPath ( PHYSDEV  dev)

Definition at line 173 of file dc.c.

174{
175 return FALSE;
176}

◆ MFDRV_FrameRgn()

BOOL MFDRV_FrameRgn ( PHYSDEV  dev,
HRGN  hrgn,
HBRUSH  hbrush,
INT  x,
INT  y 
)

Definition at line 391 of file graphics.c.

392{
393 INT16 iRgn, iBrush;
394 iRgn = MFDRV_CreateRegion( dev, hrgn );
395 if(iRgn == -1)
396 return FALSE;
398 if(!iBrush)
399 return FALSE;
400 return MFDRV_MetaParam4( dev, META_FRAMEREGION, iRgn, iBrush, x, y );
401}
#define META_FRAMEREGION
Definition: wingdi.h:251

◆ MFDRV_IntersectClipRect()

INT MFDRV_IntersectClipRect ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 73 of file dc.c.

74{
76}
#define META_INTERSECTCLIPRECT
Definition: wingdi.h:232

◆ MFDRV_InvertRgn()

BOOL MFDRV_InvertRgn ( PHYSDEV  dev,
HRGN  hrgn 
)

Definition at line 363 of file graphics.c.

364{
365 INT16 index;
367 if(index == -1)
368 return FALSE;
370}
#define META_INVERTREGION
Definition: wingdi.h:252

◆ MFDRV_LineTo()

BOOL MFDRV_LineTo ( PHYSDEV  dev,
INT  x,
INT  y 
)

Definition at line 44 of file graphics.c.

45{
47}
#define META_LINETO
Definition: wingdi.h:229

◆ MFDRV_MetaParam0()

BOOL MFDRV_MetaParam0 ( PHYSDEV  dev,
short  func 
)

Definition at line 518 of file init.c.

519{
520 char buffer[8];
521 METARECORD *mr = (METARECORD *)&buffer;
522
523 mr->rdSize = 3;
524 mr->rdFunction = func;
525 return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
526}
GLenum func
Definition: glext.h:6028

Referenced by MFDRV_CloseMetaFile(), and MFDRV_SaveDC().

◆ MFDRV_MetaParam1()

BOOL MFDRV_MetaParam1 ( PHYSDEV  dev,
short  func,
short  param1 
)

Definition at line 532 of file init.c.

533{
534 char buffer[8];
535 METARECORD *mr = (METARECORD *)&buffer;
536 WORD *params = mr->rdParm;
537
538 mr->rdSize = 4;
539 mr->rdFunction = func;
540 params[0] = param1;
541 return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
542}
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum const GLfloat * params
Definition: glext.h:5645

Referenced by MFDRV_ExtSelectClipRgn(), MFDRV_InvertRgn(), MFDRV_PaintRgn(), MFDRV_RestoreDC(), MFDRV_SetBkMode(), MFDRV_SetMapMode(), MFDRV_SetPolyFillMode(), MFDRV_SetRelAbs(), MFDRV_SetROP2(), MFDRV_SetStretchBltMode(), and MFDRV_SetTextCharacterExtra().

◆ MFDRV_MetaParam2()

◆ MFDRV_MetaParam4()

BOOL MFDRV_MetaParam4 ( PHYSDEV  dev,
short  func,
short  param1,
short  param2,
short  param3,
short  param4 
)

Definition at line 566 of file init.c.

568{
569 char buffer[14];
570 METARECORD *mr = (METARECORD *)&buffer;
571 WORD *params = mr->rdParm;
572
573 mr->rdSize = 7;
574 mr->rdFunction = func;
575 params[0] = param4;
576 params[1] = param3;
577 params[2] = param2;
578 params[3] = param1;
579 return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
580}

Referenced by MFDRV_Ellipse(), MFDRV_ExcludeClipRect(), MFDRV_ExtFloodFill(), MFDRV_FrameRgn(), MFDRV_IntersectClipRect(), MFDRV_Rectangle(), MFDRV_ScaleViewportExtEx(), MFDRV_ScaleWindowExtEx(), and MFDRV_SetPixel().

◆ MFDRV_MetaParam6()

BOOL MFDRV_MetaParam6 ( PHYSDEV  dev,
short  func,
short  param1,
short  param2,
short  param3,
short  param4,
short  param5,
short  param6 
)

Definition at line 587 of file init.c.

589{
590 char buffer[18];
591 METARECORD *mr = (METARECORD *)&buffer;
592 WORD *params = mr->rdParm;
593
594 mr->rdSize = 9;
595 mr->rdFunction = func;
596 params[0] = param6;
597 params[1] = param5;
598 params[2] = param4;
599 params[3] = param3;
600 params[4] = param2;
601 params[5] = param1;
602 return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
603}

Referenced by MFDRV_PatBlt(), and MFDRV_RoundRect().

◆ MFDRV_MetaParam8()

BOOL MFDRV_MetaParam8 ( PHYSDEV  dev,
short  func,
short  param1,
short  param2,
short  param3,
short  param4,
short  param5,
short  param6,
short  param7,
short  param8 
)

Definition at line 609 of file init.c.

612{
613 char buffer[22];
614 METARECORD *mr = (METARECORD *)&buffer;
615 WORD *params = mr->rdParm;
616
617 mr->rdSize = 11;
618 mr->rdFunction = func;
619 params[0] = param8;
620 params[1] = param7;
621 params[2] = param6;
622 params[3] = param5;
623 params[4] = param4;
624 params[5] = param3;
625 params[6] = param2;
626 params[7] = param1;
627 return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
628}

Referenced by MFDRV_Arc(), MFDRV_Chord(), and MFDRV_Pie().

◆ MFDRV_MoveTo()

BOOL MFDRV_MoveTo ( PHYSDEV  dev,
INT  x,
INT  y 
)

Definition at line 36 of file graphics.c.

37{
39}
#define META_MOVETO
Definition: wingdi.h:230

◆ MFDRV_OffsetClipRgn()

INT MFDRV_OffsetClipRgn ( PHYSDEV  dev,
INT  x,
INT  y 
)

Definition at line 83 of file dc.c.

84{
86}
#define META_OFFSETCLIPRGN
Definition: wingdi.h:242

◆ MFDRV_OffsetViewportOrgEx()

BOOL MFDRV_OffsetViewportOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)

Definition at line 113 of file dc.c.

114{
116}
#define META_OFFSETVIEWPORTORG
Definition: wingdi.h:227

◆ MFDRV_OffsetWindowOrgEx()

BOOL MFDRV_OffsetWindowOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)

Definition at line 118 of file dc.c.

119{
121}
#define META_OFFSETWINDOWORG
Definition: wingdi.h:225

◆ MFDRV_PaintRgn()

BOOL MFDRV_PaintRgn ( PHYSDEV  dev,
HRGN  hrgn 
)

Definition at line 350 of file graphics.c.

351{
352 INT16 index;
354 if(index == -1)
355 return FALSE;
357}
#define META_PAINTREGION
Definition: wingdi.h:253

◆ MFDRV_PatBlt()

BOOL MFDRV_PatBlt ( PHYSDEV  dev,
struct bitblt_coords dst,
DWORD  rop 
)

Definition at line 31 of file bitblt.c.

32{
33 MFDRV_MetaParam6( dev, META_PATBLT, dst->log_x, dst->log_y, dst->log_width, dst->log_height,
34 HIWORD(rop), LOWORD(rop) );
35 return TRUE;
36}
GLenum GLenum dst
Definition: glext.h:6340
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6)
Definition: init.c:587
#define META_PATBLT
Definition: wingdi.h:239

◆ MFDRV_Pie()

BOOL MFDRV_Pie ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 64 of file graphics.c.

66{
68 xstart, ystart, xend, yend);
69}
#define META_PIE
Definition: wingdi.h:236

◆ MFDRV_PolyBezier()

BOOL MFDRV_PolyBezier ( PHYSDEV  dev,
const POINT pt,
DWORD  count 
)

Definition at line 428 of file graphics.c.

429{
430 return FALSE;
431}

◆ MFDRV_PolyBezierTo()

BOOL MFDRV_PolyBezierTo ( PHYSDEV  dev,
const POINT pt,
DWORD  count 
)

Definition at line 438 of file graphics.c.

439{
440 return FALSE;
441}

◆ MFDRV_Polygon()

BOOL MFDRV_Polygon ( PHYSDEV  dev,
const POINT pt,
INT  count 
)

Definition at line 167 of file graphics.c.

168{
169 int i;
170 POINTS *pts;
171 BOOL ret;
172
173 pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS)*count );
174 if(!pts) return FALSE;
175 for (i=count;i--;)
176 {
177 pts[i].x = pt[i].x;
178 pts[i].y = pt[i].y;
179 }
181
182 HeapFree( GetProcessHeap(), 0, pts );
183 return ret;
184}
#define pt(x, y)
Definition: drawing.c:79
SHORT y
Definition: windef.h:343
SHORT x
Definition: windef.h:342
static BOOL MFDRV_MetaPoly(PHYSDEV dev, short func, POINTS *pt, short count)
Definition: graphics.c:121
#define META_POLYGON
Definition: wingdi.h:246

◆ MFDRV_Polyline()

BOOL MFDRV_Polyline ( PHYSDEV  dev,
const POINT pt,
INT  count 
)

Definition at line 144 of file graphics.c.

145{
146 int i;
147 POINTS *pts;
148 BOOL ret;
149
150 pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS)*count );
151 if(!pts) return FALSE;
152 for (i=count;i--;)
153 {
154 pts[i].x = pt[i].x;
155 pts[i].y = pt[i].y;
156 }
158
159 HeapFree( GetProcessHeap(), 0, pts );
160 return ret;
161}
#define META_POLYLINE
Definition: wingdi.h:247

◆ MFDRV_PolyPolygon()

BOOL MFDRV_PolyPolygon ( PHYSDEV  dev,
const POINT pt,
const INT counts,
UINT  polygons 
)

Definition at line 190 of file graphics.c.

191{
192 BOOL ret;
193 DWORD len;
194 METARECORD *mr;
195 unsigned int i,j;
196 POINTS *pts;
197 INT16 totalpoint16 = 0;
198 INT16 * pointcounts;
199
200 for (i=0;i<polygons;i++) {
201 totalpoint16 += counts[i];
202 }
203
204 /* allocate space for all points */
205 pts=HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * totalpoint16 );
206 pointcounts = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * totalpoint16 );
207
208 /* copy point counts */
209 for (i=0;i<polygons;i++) {
210 pointcounts[i] = counts[i];
211 }
212
213 /* convert all points */
214 for (j = totalpoint16; j--;){
215 pts[j].x = pt[j].x;
216 pts[j].y = pt[j].y;
217 }
218
219 len = sizeof(METARECORD) + sizeof(WORD) + polygons*sizeof(INT16) + totalpoint16*sizeof(*pts);
220
221 if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ))) {
222 HeapFree( GetProcessHeap(), 0, pts );
223 HeapFree( GetProcessHeap(), 0, pointcounts );
224 return FALSE;
225 }
226
227 mr->rdSize = len /2;
229 *(mr->rdParm) = polygons;
230 memcpy(mr->rdParm + 1, pointcounts, polygons*sizeof(INT16));
231 memcpy(mr->rdParm + 1+polygons, pts , totalpoint16*sizeof(*pts));
232 ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
233
234 HeapFree( GetProcessHeap(), 0, pts );
235 HeapFree( GetProcessHeap(), 0, pointcounts );
236 HeapFree( GetProcessHeap(), 0, mr);
237 return ret;
238}
#define META_POLYPOLYGON
Definition: wingdi.h:265

◆ MFDRV_RealizePalette()

UINT MFDRV_RealizePalette ( PHYSDEV  dev,
HPALETTE  hPalette,
BOOL  primary 
)

Definition at line 449 of file objects.c.

450{
451 char buffer[sizeof(METARECORD) - sizeof(WORD)];
452 METARECORD *mr = (METARECORD *)&buffer;
453
454 mr->rdSize = (sizeof(METARECORD) - sizeof(WORD)) / sizeof(WORD);
456
457 if (!(MFDRV_WriteRecord( dev, mr, mr->rdSize * sizeof(WORD)))) return 0;
458
459 /* The return value is suppose to be the number of entries
460 in the logical palette mapped to the system palette or 0
461 if the function failed. Since it's not trivial here to
462 get that kind of information and since it's of little
463 use in the case of metafiles, we'll always return 1. */
464 return 1;
465}
#define META_REALIZEPALETTE
Definition: wingdi.h:262

◆ MFDRV_Rectangle()

BOOL MFDRV_Rectangle ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 93 of file graphics.c.

94{
96}
#define META_RECTANGLE
Definition: wingdi.h:237

◆ MFDRV_RemoveHandle()

BOOL MFDRV_RemoveHandle ( PHYSDEV  dev,
UINT  index 
)

Definition at line 64 of file objects.c.

65{
67 BOOL ret = FALSE;
68
69 if (index < physDev->handles_size && physDev->handles[index])
70 {
71 physDev->handles[index] = 0;
72 physDev->cur_handles--;
73 ret = TRUE;
74 }
75 return ret;
76}

Referenced by MFDRV_ExtSelectClipRgn().

◆ MFDRV_RestoreDC()

BOOL MFDRV_RestoreDC ( PHYSDEV  dev,
INT  level 
)

Definition at line 28 of file dc.c.

29{
31}
GLint level
Definition: gl.h:1546
#define META_RESTOREDC
Definition: wingdi.h:249

◆ MFDRV_RoundRect()

BOOL MFDRV_RoundRect ( PHYSDEV  dev,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  ell_width,
INT  ell_height 
)

Definition at line 101 of file graphics.c.

103{
105 ell_width, ell_height);
106}
#define META_ROUNDRECT
Definition: wingdi.h:238

◆ MFDRV_SaveDC()

INT MFDRV_SaveDC ( PHYSDEV  dev)

Definition at line 23 of file dc.c.

24{
26}
BOOL MFDRV_MetaParam0(PHYSDEV dev, short func)
Definition: init.c:518
#define META_SAVEDC
Definition: wingdi.h:240

◆ MFDRV_ScaleViewportExtEx()

BOOL MFDRV_ScaleViewportExtEx ( PHYSDEV  dev,
INT  xNum,
INT  xDenom,
INT  yNum,
INT  yDenom,
SIZE size 
)

Definition at line 123 of file dc.c.

124{
125 return MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom );
126}
#define META_SCALEVIEWPORTEXT
Definition: wingdi.h:228

◆ MFDRV_ScaleWindowExtEx()

BOOL MFDRV_ScaleWindowExtEx ( PHYSDEV  dev,
INT  xNum,
INT  xDenom,
INT  yNum,
INT  yDenom,
SIZE size 
)

Definition at line 128 of file dc.c.

129{
130 return MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom );
131}
#define META_SCALEWINDOWEXT
Definition: wingdi.h:226

◆ MFDRV_SelectBitmap()

HBITMAP MFDRV_SelectBitmap ( PHYSDEV  dev,
HBITMAP  handle 
)

Definition at line 140 of file objects.c.

141{
142 return 0;
143}

◆ MFDRV_SelectBrush()

HBRUSH MFDRV_SelectBrush ( PHYSDEV  dev,
HBRUSH  hbrush,
const struct brush_pattern pattern 
)

Definition at line 236 of file objects.c.

237{
238 INT16 index;
239
241 if( index < 0 )
242 {
244 if( index < 0 )
245 return 0;
247 }
248 return MFDRV_SelectObject( dev, index ) ? hbrush : 0;
249}
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:166
INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush)
Definition: objects.c:149
static BOOL MFDRV_SelectObject(PHYSDEV dev, INT16 index)
Definition: objects.c:125

◆ MFDRV_SelectClipPath()

BOOL MFDRV_SelectClipPath ( PHYSDEV  dev,
INT  iMode 
)

Definition at line 178 of file dc.c.

179{
180 return FALSE;
181}

◆ MFDRV_SelectFont()

HFONT MFDRV_SelectFont ( PHYSDEV  dev,
HFONT  handle,
UINT aa_flags 
)

Definition at line 292 of file objects.c.

293{
295 INT16 index;
296
297 *aa_flags = GGO_BITMAP; /* no point in anti-aliasing on metafiles */
299 if( index < 0 )
300 {
301 if (!GetObjectW( hfont, sizeof(font), &font ))
302 return 0;
304 if( index < 0 )
305 return 0;
307 }
308 return MFDRV_SelectObject( dev, index ) ? hfont : 0;
309}
static HFONT hfont
static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONTW *logfont)
Definition: objects.c:255
Definition: mk_font.cpp:20
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define GGO_BITMAP
Definition: wingdi.h:849

◆ MFDRV_SelectPalette()

HPALETTE MFDRV_SelectPalette ( PHYSDEV  dev,
HPALETTE  hPalette,
BOOL  bForceBackground 
)

Definition at line 413 of file objects.c.

414{
415#define PALVERSION 0x0300
416
417 PLOGPALETTE logPalette;
418 WORD wNumEntries = 0;
419 BOOL creationSucceed;
420 int sizeofPalette;
421
422 GetObjectA(hPalette, sizeof(WORD), &wNumEntries);
423
424 if (wNumEntries == 0) return 0;
425
426 sizeofPalette = sizeof(LOGPALETTE) + ((wNumEntries-1) * sizeof(PALETTEENTRY));
427 logPalette = HeapAlloc( GetProcessHeap(), 0, sizeofPalette );
428
429 if (logPalette == NULL) return 0;
430
431 logPalette->palVersion = PALVERSION;
432 logPalette->palNumEntries = wNumEntries;
433
434 GetPaletteEntries(hPalette, 0, wNumEntries, logPalette->palPalEntry);
435
436 creationSucceed = MFDRV_CreatePalette( dev, hPalette, logPalette, sizeofPalette );
437
438 HeapFree( GetProcessHeap(), 0, logPalette );
439
440 if (creationSucceed)
441 return hPalette;
442
443 return 0;
444}
#define PALVERSION
static BOOL MFDRV_CreatePalette(PHYSDEV dev, HPALETTE hPalette, LOGPALETTE *logPalette, int sizeofPalette)
Definition: objects.c:380
WORD palNumEntries
Definition: wingdi.h:1834
WORD palVersion
Definition: wingdi.h:1833
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
struct tagPALETTEENTRY PALETTEENTRY
struct tagLOGPALETTE LOGPALETTE

◆ MFDRV_SelectPen()

HPEN MFDRV_SelectPen ( PHYSDEV  dev,
HPEN  handle,
const struct brush_pattern pattern 
)

Definition at line 331 of file objects.c.

332{
333 LOGPEN16 logpen;
334 INT16 index;
335
337 if( index < 0 )
338 {
339 /* must be an extended pen */
340 INT size = GetObjectW( hpen, 0, NULL );
341
342 if (!size) return 0;
343
344 if (size == sizeof(LOGPEN))
345 {
346 LOGPEN pen;
347
348 GetObjectW( hpen, sizeof(pen), &pen );
349 logpen.lopnStyle = pen.lopnStyle;
350 logpen.lopnWidth.x = pen.lopnWidth.x;
351 logpen.lopnWidth.y = pen.lopnWidth.y;
352 logpen.lopnColor = pen.lopnColor;
353 }
354 else /* must be an extended pen */
355 {
356 EXTLOGPEN *elp = HeapAlloc( GetProcessHeap(), 0, size );
357
358 GetObjectW( hpen, size, elp );
359 /* FIXME: add support for user style pens */
360 logpen.lopnStyle = elp->elpPenStyle;
361 logpen.lopnWidth.x = elp->elpWidth;
362 logpen.lopnWidth.y = 0;
363 logpen.lopnColor = elp->elpColor;
364
365 HeapFree( GetProcessHeap(), 0, elp );
366 }
367
368 index = MFDRV_CreatePenIndirect( dev, hpen, &logpen );
369 if( index < 0 )
370 return 0;
372 }
373 return MFDRV_SelectObject( dev, index ) ? hpen : 0;
374}
static HPEN hpen
static UINT16 MFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen, LOGPEN16 *logpen)
Definition: objects.c:314
POINT16 lopnWidth
Definition: wingdi16.h:66
COLORREF lopnColor
Definition: wingdi16.h:67
UINT16 lopnStyle
Definition: wingdi16.h:65
INT16 x
Definition: windef16.h:135
INT16 y
Definition: windef16.h:136
DWORD elpWidth
Definition: wingdi.h:1943
DWORD elpPenStyle
Definition: wingdi.h:1942
COLORREF elpColor
Definition: wingdi.h:1945
COLORREF lopnColor
Definition: wingdi.h:1847
POINT lopnWidth
Definition: wingdi.h:1846
UINT lopnStyle
Definition: wingdi.h:1845
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

◆ MFDRV_SetBkColor()

COLORREF MFDRV_SetBkColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 43 of file dc.c.

44{
46}
#define CLR_INVALID
Definition: wingdi.h:883
#define META_SETBKCOLOR
Definition: wingdi.h:210

◆ MFDRV_SetBkMode()

INT MFDRV_SetBkMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 38 of file dc.c.

39{
41}
#define META_SETBKMODE
Definition: wingdi.h:211

◆ MFDRV_SetDCBrushColor()

COLORREF MFDRV_SetDCBrushColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 198 of file dc.c.

199{
200 return CLR_INVALID;
201}

◆ MFDRV_SetDCPenColor()

COLORREF MFDRV_SetDCPenColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 203 of file dc.c.

204{
205 return CLR_INVALID;
206}

◆ MFDRV_SetDIBitsToDevice()

INT MFDRV_SetDIBitsToDevice ( PHYSDEV  dev,
INT  xDest,
INT  yDest,
DWORD  cx,
DWORD  cy,
INT  xSrc,
INT  ySrc,
UINT  startscan,
UINT  lines,
LPCVOID  bits,
BITMAPINFO info,
UINT  coloruse 
)

Definition at line 166 of file bitblt.c.

170{
171 DWORD infosize = get_dib_info_size(info, coloruse);
172 DWORD len = sizeof(METARECORD) + 8 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
173 METARECORD *mr = HeapAlloc( GetProcessHeap(), 0, len );
174 if(!mr) return 0;
175
176 mr->rdSize = len / 2;
178 mr->rdParm[0] = coloruse;
179 mr->rdParm[1] = lines;
180 mr->rdParm[2] = startscan;
181 mr->rdParm[3] = (INT16)ySrc;
182 mr->rdParm[4] = (INT16)xSrc;
183 mr->rdParm[5] = (INT16)cy;
184 mr->rdParm[6] = (INT16)cx;
185 mr->rdParm[7] = (INT16)yDst;
186 mr->rdParm[8] = (INT16)xDst;
187 memcpy(mr->rdParm + 9, info, infosize);
188 memcpy(mr->rdParm + 9 + infosize / 2, bits, info->bmiHeader.biSizeImage);
189 MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
190 HeapFree( GetProcessHeap(), 0, mr );
191 return lines;
192}
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
eMaj lines
Definition: tritemp.h:206
#define META_SETDIBTODEV
Definition: wingdi.h:260

◆ MFDRV_SetMapMode()

INT MFDRV_SetMapMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 88 of file dc.c.

89{
91}
#define META_SETMAPMODE
Definition: wingdi.h:212

◆ MFDRV_SetMapperFlags()

DWORD MFDRV_SetMapperFlags ( PHYSDEV  dev,
DWORD  flags 
)

Definition at line 143 of file dc.c.

144{
146}
#define GDI_ERROR
Definition: wingdi.h:1309
#define META_SETMAPPERFLAGS
Definition: wingdi.h:258

◆ MFDRV_SetPixel()

COLORREF MFDRV_SetPixel ( PHYSDEV  dev,
INT  x,
INT  y,
COLORREF  color 
)

Definition at line 111 of file graphics.c.

112{
114 LOWORD(color));
115}
#define META_SETPIXEL
Definition: wingdi.h:241

◆ MFDRV_SetPolyFillMode()

INT MFDRV_SetPolyFillMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 63 of file dc.c.

64{
66}
#define META_SETPOLYFILLMODE
Definition: wingdi.h:215

◆ MFDRV_SetRelAbs()

INT MFDRV_SetRelAbs ( PHYSDEV  dev,
INT  mode 
)

Definition at line 58 of file dc.c.

59{
61}
#define META_SETRELABS
Definition: wingdi.h:214

◆ MFDRV_SetROP2()

INT MFDRV_SetROP2 ( PHYSDEV  dev,
INT  rop 
)

Definition at line 53 of file dc.c.

54{
55 return MFDRV_MetaParam1( dev, META_SETROP2, (WORD)rop) ? rop : 0;
56}
#define META_SETROP2
Definition: wingdi.h:213

◆ MFDRV_SetStretchBltMode()

INT MFDRV_SetStretchBltMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 68 of file dc.c.

69{
71}
#define META_SETSTRETCHBLTMODE
Definition: wingdi.h:216

◆ MFDRV_SetTextAlign()

UINT MFDRV_SetTextAlign ( PHYSDEV  dev,
UINT  align 
)

Definition at line 33 of file dc.c.

34{
36}
int align(int length, int align)
Definition: dsound8.c:36
#define META_SETTEXTALIGN
Definition: wingdi.h:256

◆ MFDRV_SetTextCharacterExtra()

INT MFDRV_SetTextCharacterExtra ( PHYSDEV  dev,
INT  extra 
)

Definition at line 138 of file dc.c.

139{
140 return MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra ) ? extra : 0x80000000;
141}
@ extra
Definition: id3.c:95
#define META_SETTEXTCHAREXTRA
Definition: wingdi.h:217

◆ MFDRV_SetTextColor()

COLORREF MFDRV_SetTextColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 48 of file dc.c.

49{
51}
#define META_SETTEXTCOLOR
Definition: wingdi.h:219

◆ MFDRV_SetTextJustification()

BOOL MFDRV_SetTextJustification ( PHYSDEV  dev,
INT  extra,
INT  breaks 
)

Definition at line 133 of file dc.c.

134{
136}
#define META_SETTEXTJUSTIFICATION
Definition: wingdi.h:220

◆ MFDRV_SetViewportExtEx()

BOOL MFDRV_SetViewportExtEx ( PHYSDEV  dev,
INT  x,
INT  y,
SIZE size 
)

Definition at line 93 of file dc.c.

94{
96}
#define META_SETVIEWPORTEXT
Definition: wingdi.h:224

◆ MFDRV_SetViewportOrgEx()

BOOL MFDRV_SetViewportOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)

Definition at line 98 of file dc.c.

99{
101}
#define META_SETVIEWPORTORG
Definition: wingdi.h:223

◆ MFDRV_SetWindowExtEx()

BOOL MFDRV_SetWindowExtEx ( PHYSDEV  dev,
INT  x,
INT  y,
SIZE size 
)

Definition at line 103 of file dc.c.

104{
106}
#define META_SETWINDOWEXT
Definition: wingdi.h:222

◆ MFDRV_SetWindowOrgEx()

BOOL MFDRV_SetWindowOrgEx ( PHYSDEV  dev,
INT  x,
INT  y,
POINT pt 
)

Definition at line 108 of file dc.c.

109{
111}
#define META_SETWINDOWORG
Definition: wingdi.h:221

◆ MFDRV_StretchBlt()

BOOL MFDRV_StretchBlt ( PHYSDEV  devDst,
struct bitblt_coords dst,
PHYSDEV  devSrc,
struct bitblt_coords src,
DWORD  rop 
)

Definition at line 47 of file bitblt.c.

49{
50 BOOL ret;
51 DWORD len;
52 METARECORD *mr;
53 BITMAP BM;
54#ifdef STRETCH_VIA_DIB
56 WORD nBPP;
57#endif
59
60 if (devSrc->funcs == devDst->funcs) return FALSE; /* can't use a metafile DC as source */
61
62 if (GetObjectW(hBitmap, sizeof(BITMAP), &BM) != sizeof(BITMAP))
63 {
64 WARN("bad bitmap object %p passed for hdc %p\n", hBitmap, devSrc->hdc);
65 return FALSE;
66 }
67#ifdef STRETCH_VIA_DIB
68 nBPP = BM.bmPlanes * BM.bmBitsPixel;
69 if(nBPP > 8) nBPP = 24; /* FIXME Can't get 16bpp to work for some reason */
70 len = sizeof(METARECORD) + 10 * sizeof(INT16)
71 + sizeof(BITMAPINFOHEADER) + (nBPP <= 8 ? 1 << nBPP: 0) * sizeof(RGBQUAD)
72 + get_dib_stride( BM.bmWidth, nBPP ) * BM.bmHeight;
73 if (!(mr = HeapAlloc( GetProcessHeap(), 0, len)))
74 return FALSE;
76 lpBMI=(LPBITMAPINFOHEADER)(mr->rdParm+10);
77 lpBMI->biSize = sizeof(BITMAPINFOHEADER);
78 lpBMI->biWidth = BM.bmWidth;
79 lpBMI->biHeight = BM.bmHeight;
80 lpBMI->biPlanes = 1;
81 lpBMI->biBitCount = nBPP;
82 lpBMI->biSizeImage = get_dib_image_size( (BITMAPINFO *)lpBMI );
83 lpBMI->biClrUsed = nBPP <= 8 ? 1 << nBPP : 0;
84 lpBMI->biCompression = BI_RGB;
85 lpBMI->biXPelsPerMeter = MulDiv(GetDeviceCaps(devSrc->hdc,LOGPIXELSX),3937,100);
86 lpBMI->biYPelsPerMeter = MulDiv(GetDeviceCaps(devSrc->hdc,LOGPIXELSY),3937,100);
87 lpBMI->biClrImportant = 0; /* 1 meter = 39.37 inch */
88
89 TRACE("MF_StretchBltViaDIB->len = %d rop=%x PixYPM=%d Caps=%d\n",
91
92 if (GetDIBits(devSrc->hdc, hBitmap, 0, (UINT)lpBMI->biHeight,
95#else
96 len = sizeof(METARECORD) + 15 * sizeof(INT16) + BM.bmWidthBytes * BM.bmHeight;
97 if (!(mr = HeapAlloc( GetProcessHeap(), 0, len )))
98 return FALSE;
100 *(mr->rdParm +10) = BM.bmWidth;
101 *(mr->rdParm +11) = BM.bmHeight;
102 *(mr->rdParm +12) = BM.bmWidthBytes;
103 *(mr->rdParm +13) = BM.bmPlanes;
104 *(mr->rdParm +14) = BM.bmBitsPixel;
105 TRACE("len = %ld rop=%lx\n", len, rop);
106 if (GetBitmapBits( hBitmap, BM.bmWidthBytes * BM.bmHeight, mr->rdParm + 15))
107#endif
108 {
109 mr->rdSize = len / sizeof(INT16);
110 *(mr->rdParm) = LOWORD(rop);
111 *(mr->rdParm + 1) = HIWORD(rop);
112 *(mr->rdParm + 2) = src->log_height;
113 *(mr->rdParm + 3) = src->log_width;
114 *(mr->rdParm + 4) = src->log_y;
115 *(mr->rdParm + 5) = src->log_x;
116 *(mr->rdParm + 6) = dst->log_height;
117 *(mr->rdParm + 7) = dst->log_width;
118 *(mr->rdParm + 8) = dst->log_y;
119 *(mr->rdParm + 9) = dst->log_x;
120 ret = MFDRV_WriteRecord( devDst, mr, mr->rdSize * 2);
121 }
122 else
123 ret = FALSE;
124 HeapFree( GetProcessHeap(), 0, mr);
125 return ret;
126}
struct BITMAPINFOHEADER * LPBITMAPINFOHEADER
#define WARN(fmt,...)
Definition: debug.h:115
static HBITMAP hBitmap
Definition: timezone.c:26
static int get_dib_image_size(const BITMAPINFO *info)
Definition: imagelist.c:203
#define BI_RGB
Definition: precomp.h:56
GLenum src
Definition: glext.h:6340
static HBITMAP
Definition: button.c:44
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define OBJ_BITMAP
Definition: objidl.idl:1415
LONG biYPelsPerMeter
Definition: amvideo.idl:38
DWORD biCompression
Definition: amvideo.idl:35
DWORD biClrImportant
Definition: amvideo.idl:40
LONG biXPelsPerMeter
Definition: amvideo.idl:37
DWORD biSizeImage
Definition: amvideo.idl:36
Definition: bl.h:1331
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
#define META_DIBSTRETCHBLT
Definition: wingdi.h:268
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
#define LOGPIXELSY
Definition: wingdi.h:719
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
#define LOGPIXELSX
Definition: wingdi.h:718
#define META_STRETCHBLT
Definition: wingdi.h:245

◆ MFDRV_StretchDIBits()

INT MFDRV_StretchDIBits ( PHYSDEV  dev,
INT  xDst,
INT  yDst,
INT  widthDst,
INT  heightDst,
INT  xSrc,
INT  ySrc,
INT  widthSrc,
INT  heightSrc,
const void bits,
BITMAPINFO info,
UINT  wUsage,
DWORD  dwRop 
)

Definition at line 132 of file bitblt.c.

136{
137 DWORD infosize = get_dib_info_size(info, wUsage);
138 DWORD len = sizeof(METARECORD) + 10 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
139 METARECORD *mr = HeapAlloc( GetProcessHeap(), 0, len );
140 if(!mr) return 0;
141
142 mr->rdSize = len / 2;
144 mr->rdParm[0] = LOWORD(dwRop);
145 mr->rdParm[1] = HIWORD(dwRop);
146 mr->rdParm[2] = wUsage;
147 mr->rdParm[3] = (INT16)heightSrc;
148 mr->rdParm[4] = (INT16)widthSrc;
149 mr->rdParm[5] = (INT16)ySrc;
150 mr->rdParm[6] = (INT16)xSrc;
151 mr->rdParm[7] = (INT16)heightDst;
152 mr->rdParm[8] = (INT16)widthDst;
153 mr->rdParm[9] = (INT16)yDst;
154 mr->rdParm[10] = (INT16)xDst;
155 memcpy(mr->rdParm + 11, info, infosize);
156 memcpy(mr->rdParm + 11 + infosize / 2, bits, info->bmiHeader.biSizeImage);
157 MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
158 HeapFree( GetProcessHeap(), 0, mr );
159 return heightSrc;
160}
#define META_STRETCHDIB
Definition: wingdi.h:270

◆ MFDRV_StrokeAndFillPath()

BOOL MFDRV_StrokeAndFillPath ( PHYSDEV  dev)

Definition at line 183 of file dc.c.

184{
185 return FALSE;
186}

◆ MFDRV_StrokePath()

BOOL MFDRV_StrokePath ( PHYSDEV  dev)

Definition at line 188 of file dc.c.

189{
190 return FALSE;
191}

◆ MFDRV_WidenPath()

BOOL MFDRV_WidenPath ( PHYSDEV  dev)

Definition at line 193 of file dc.c.

194{
195 return FALSE;
196}

◆ MFDRV_WriteRecord()

BOOL MFDRV_WriteRecord ( PHYSDEV  dev,
METARECORD mr,
DWORD  rlen 
)

Definition at line 475 of file init.c.

476{
477 DWORD len, size;
478 METAHEADER *mh;
480
481 switch(physDev->mh->mtType)
482 {
483 case METAFILE_MEMORY:
484 len = physDev->mh->mtSize * 2 + rlen;
485 /* reallocate memory if needed */
486 size = HeapSize( GetProcessHeap(), 0, physDev->mh );
487 if (len > size)
488 {
489 /*expand size*/
490 size += size / 2 + rlen;
491 mh = HeapReAlloc( GetProcessHeap(), 0, physDev->mh, size);
492 if (!mh) return FALSE;
493 physDev->mh = mh;
494 TRACE("Reallocated metafile: new size is %d\n",size);
495 }
496 memcpy((WORD *)physDev->mh + physDev->mh->mtSize, mr, rlen);
497 break;
498 case METAFILE_DISK:
499 TRACE("Writing record to disk\n");
500 if (!WriteFile(physDev->hFile, mr, rlen, NULL, NULL))
501 return FALSE;
502 break;
503 default:
504 ERR("Unknown metafile type %d\n", physDev->mh->mtType );
505 return FALSE;
506 }
507
508 physDev->mh->mtSize += rlen / 2;
509 physDev->mh->mtMaxRecord = max(physDev->mh->mtMaxRecord, rlen / 2);
510 return TRUE;
511}
#define ERR(fmt,...)
Definition: debug.h:113
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define METAFILE_MEMORY
Definition: gdi32p.h:76
#define METAFILE_DISK
Definition: gdi32p.h:77
DWORD mtMaxRecord
Definition: wingdi.h:2315
DWORD mtSize
Definition: wingdi.h:2313
WORD mtType
Definition: wingdi.h:2310
#define max(a, b)
Definition: svc.c:63
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)

Referenced by MFDRV_CreateBrushIndirect(), MFDRV_CreateFontIndirect(), MFDRV_CreatePalette(), MFDRV_CreatePenIndirect(), MFDRV_CreateRegion(), MFDRV_DeleteObject(), MFDRV_ExtEscape(), MFDRV_MetaExtTextOut(), MFDRV_MetaParam0(), MFDRV_MetaParam1(), MFDRV_MetaParam2(), MFDRV_MetaParam4(), MFDRV_MetaParam6(), MFDRV_MetaParam8(), MFDRV_MetaPoly(), MFDRV_PolyPolygon(), MFDRV_RealizePalette(), MFDRV_SelectObject(), MFDRV_SetDIBitsToDevice(), MFDRV_StretchBlt(), and MFDRV_StretchDIBits().