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

Go to the source code of this file.

Classes

struct  EMFDRV_PDEVICE
 

Macros

#define HANDLE_LIST_INC   20
 

Functions

static EMFDRV_PDEVICEget_emf_physdev (PHYSDEV dev)
 
BOOL EMFDRV_WriteRecord (PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
 
void EMFDRV_UpdateBBox (PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
 
DWORD EMFDRV_CreateBrushIndirect (PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
 
BOOL EMFDRV_AbortPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_AngleArc (PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Arc (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ArcTo (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL EMFDRV_BeginPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_BitBlt (PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Chord (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL EMFDRV_CloseFigure (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_DeleteObject (PHYSDEV dev, HGDIOBJ obj) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Ellipse (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDRV_EndPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
INT EMFDRV_ExcludeClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ExtFloodFill (PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType) DECLSPEC_HIDDEN
 
INT EMFDRV_ExtSelectClipRgn (PHYSDEV dev, HRGN hrgn, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ExtTextOut (PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx) DECLSPEC_HIDDEN
 
BOOL EMFDRV_FillPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_FillRgn (PHYSDEV dev, HRGN hrgn, HBRUSH hbrush) DECLSPEC_HIDDEN
 
BOOL EMFDRV_FlattenPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_FrameRgn (PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height) DECLSPEC_HIDDEN
 
BOOL EMFDRV_GdiComment (PHYSDEV dev, UINT bytes, const BYTE *buffer) DECLSPEC_HIDDEN
 
INT EMFDRV_GetDeviceCaps (PHYSDEV dev, INT cap) DECLSPEC_HIDDEN
 
BOOL EMFDRV_GradientFill (PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode) DECLSPEC_HIDDEN
 
INT EMFDRV_IntersectClipRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDRV_InvertRgn (PHYSDEV dev, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL EMFDRV_LineTo (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ModifyWorldTransform (PHYSDEV dev, const XFORM *xform, DWORD mode) DECLSPEC_HIDDEN
 
BOOL EMFDRV_MoveTo (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
INT EMFDRV_OffsetClipRgn (PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDRV_OffsetViewportOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL EMFDRV_OffsetWindowOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PaintRgn (PHYSDEV dev, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PatBlt (PHYSDEV dev, struct bitblt_coords *dst, DWORD rop) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Pie (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolyBezier (PHYSDEV dev, const POINT *pts, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolyBezierTo (PHYSDEV dev, const POINT *pts, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolyDraw (PHYSDEV dev, const POINT *pts, const BYTE *types, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolyPolygon (PHYSDEV dev, const POINT *pt, const INT *counts, UINT polys) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolyPolyline (PHYSDEV dev, const POINT *pt, const DWORD *counts, DWORD polys) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Polygon (PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Polyline (PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_PolylineTo (PHYSDEV dev, const POINT *pt, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDRV_Rectangle (PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDRV_RestoreDC (PHYSDEV dev, INT level) DECLSPEC_HIDDEN
 
BOOL EMFDRV_RoundRect (PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height) DECLSPEC_HIDDEN
 
INT EMFDRV_SaveDC (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ScaleViewportExtEx (PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size) DECLSPEC_HIDDEN
 
BOOL EMFDRV_ScaleWindowExtEx (PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size) DECLSPEC_HIDDEN
 
HBITMAP EMFDRV_SelectBitmap (PHYSDEV dev, HBITMAP handle) DECLSPEC_HIDDEN
 
HBRUSH EMFDRV_SelectBrush (PHYSDEV dev, HBRUSH hbrush, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SelectClipPath (PHYSDEV dev, INT iMode) DECLSPEC_HIDDEN
 
HFONT EMFDRV_SelectFont (PHYSDEV dev, HFONT handle, UINT *aa_flags) DECLSPEC_HIDDEN
 
HPEN EMFDRV_SelectPen (PHYSDEV dev, HPEN handle, const struct brush_pattern *pattern) DECLSPEC_HIDDEN
 
HPALETTE EMFDRV_SelectPalette (PHYSDEV dev, HPALETTE hPal, BOOL force) DECLSPEC_HIDDEN
 
INT EMFDRV_SetArcDirection (PHYSDEV dev, INT arcDirection) DECLSPEC_HIDDEN
 
COLORREF EMFDRV_SetBkColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
INT EMFDRV_SetBkMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
COLORREF EMFDRV_SetDCBrushColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
COLORREF EMFDRV_SetDCPenColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
INT EMFDRV_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
 
DWORD EMFDRV_SetLayout (PHYSDEV dev, DWORD layout) DECLSPEC_HIDDEN
 
INT EMFDRV_SetMapMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
DWORD EMFDRV_SetMapperFlags (PHYSDEV dev, DWORD flags) DECLSPEC_HIDDEN
 
COLORREF EMFDRV_SetPixel (PHYSDEV dev, INT x, INT y, COLORREF color) DECLSPEC_HIDDEN
 
INT EMFDRV_SetPolyFillMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
INT EMFDRV_SetROP2 (PHYSDEV dev, INT rop) DECLSPEC_HIDDEN
 
INT EMFDRV_SetStretchBltMode (PHYSDEV dev, INT mode) DECLSPEC_HIDDEN
 
UINT EMFDRV_SetTextAlign (PHYSDEV dev, UINT align) DECLSPEC_HIDDEN
 
COLORREF EMFDRV_SetTextColor (PHYSDEV dev, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetTextJustification (PHYSDEV dev, INT nBreakExtra, INT nBreakCount) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetViewportExtEx (PHYSDEV dev, INT x, INT y, SIZE *size) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetViewportOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetWindowExtEx (PHYSDEV dev, INT x, INT y, SIZE *size) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetWindowOrgEx (PHYSDEV dev, INT x, INT y, POINT *pt) DECLSPEC_HIDDEN
 
BOOL EMFDRV_SetWorldTransform (PHYSDEV dev, const XFORM *xform) DECLSPEC_HIDDEN
 
BOOL EMFDRV_StretchBlt (PHYSDEV devDst, struct bitblt_coords *dst, PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop) DECLSPEC_HIDDEN
 
INT EMFDRV_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 EMFDRV_StrokeAndFillPath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_StrokePath (PHYSDEV dev) DECLSPEC_HIDDEN
 
BOOL EMFDRV_WidenPath (PHYSDEV dev) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

Definition at line 58 of file enhmetafiledrv.h.

Function Documentation

◆ EMFDRV_AbortPath()

BOOL EMFDRV_AbortPath ( PHYSDEV  dev)

Definition at line 417 of file dc.c.

418{
419 EMRABORTPATH emr;
420
421 emr.emr.iType = EMR_ABORTPATH;
422 emr.emr.nSize = sizeof(emr);
423
424 return EMFDRV_WriteRecord( dev, &emr.emr );
425}
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:194
DWORD iType
Definition: wingdi.h:1690
DWORD nSize
Definition: wingdi.h:1691
#define EMR_ABORTPATH
Definition: wingdi.h:142

◆ EMFDRV_AngleArc()

BOOL EMFDRV_AngleArc ( PHYSDEV  dev,
INT  x,
INT  y,
DWORD  radius,
FLOAT  start,
FLOAT  sweep 
)

Definition at line 390 of file graphics.c.

391{
392 EMRANGLEARC emr;
393
394 emr.emr.iType = EMR_ANGLEARC;
395 emr.emr.nSize = sizeof( emr );
396 emr.ptlCenter.x = x;
397 emr.ptlCenter.y = y;
398 emr.nRadius = radius;
399 emr.eStartAngle = start;
400 emr.eSweepAngle = sweep;
401
402 return EMFDRV_WriteRecord( dev, &emr.emr );
403}
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
FLOAT eSweepAngle
Definition: wingdi.h:1712
FLOAT eStartAngle
Definition: wingdi.h:1711
DWORD nRadius
Definition: wingdi.h:1710
POINTL ptlCenter
Definition: wingdi.h:1709
#define EMR_ANGLEARC
Definition: wingdi.h:115

◆ EMFDRV_Arc()

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

Definition at line 349 of file graphics.c.

351{
352 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
353 xend, yend, EMR_ARC );
354}
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
static BOOL EMFDRV_ArcChordPie(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend, DWORD iType)
Definition: graphics.c:226
#define EMR_ARC
Definition: wingdi.h:119

◆ EMFDRV_ArcTo()

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

Definition at line 359 of file graphics.c.

361{
362 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
363 xend, yend, EMR_ARCTO );
364}
#define EMR_ARCTO
Definition: wingdi.h:129

◆ EMFDRV_BeginPath()

BOOL EMFDRV_BeginPath ( PHYSDEV  dev)

Definition at line 427 of file dc.c.

428{
429 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
430 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pBeginPath );
431 EMRBEGINPATH emr;
432 DC *dc = get_physdev_dc( dev );
433
434 emr.emr.iType = EMR_BEGINPATH;
435 emr.emr.nSize = sizeof(emr);
436
437 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
438 if (physDev->path) return TRUE; /* already open */
439
440 if (!next->funcs->pBeginPath( next )) return FALSE;
441 push_dc_driver( &dc->physDev, &physDev->pathdev, &emfpath_driver );
442 physDev->path = TRUE;
443 return TRUE;
444}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:215
static const WCHAR dc[]
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: polytest.cpp:41
struct gdi_physdev pathdev
static const struct gdi_dc_funcs emfpath_driver
Definition: dc.c:31
#define EMR_BEGINPATH
Definition: wingdi.h:133

◆ EMFDRV_BitBlt()

BOOL EMFDRV_BitBlt ( PHYSDEV  devDst,
INT  xDst,
INT  yDst,
INT  width,
INT  height,
PHYSDEV  devSrc,
INT  xSrc,
INT  ySrc,
DWORD  rop 
)

◆ EMFDRV_Chord()

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

Definition at line 380 of file graphics.c.

382{
383 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
384 xend, yend, EMR_CHORD );
385}
#define EMR_CHORD
Definition: wingdi.h:120

◆ EMFDRV_CloseFigure()

BOOL EMFDRV_CloseFigure ( PHYSDEV  dev)

Definition at line 446 of file dc.c.

447{
448 EMRCLOSEFIGURE emr;
449
451 emr.emr.nSize = sizeof(emr);
452
453 EMFDRV_WriteRecord( dev, &emr.emr );
454 return FALSE; /* always fails without a path */
455}
#define EMR_CLOSEFIGURE
Definition: wingdi.h:135

◆ EMFDRV_CreateBrushIndirect()

DWORD EMFDRV_CreateBrushIndirect ( PHYSDEV  dev,
HBRUSH  hBrush 
)

Definition at line 111 of file objects.c.

112{
113 DWORD index = 0;
114 LOGBRUSH logbrush;
115
116 if (!GetObjectA( hBrush, sizeof(logbrush), &logbrush )) return 0;
117
118 switch (logbrush.lbStyle) {
119 case BS_SOLID:
120 case BS_HATCHED:
121 case BS_NULL:
122 {
125 emr.emr.nSize = sizeof(emr);
126 emr.ihBrush = index = EMFDRV_AddHandle( dev, hBrush );
127 emr.lb.lbStyle = logbrush.lbStyle;
128 emr.lb.lbColor = logbrush.lbColor;
129 emr.lb.lbHatch = logbrush.lbHatch;
130
131 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
132 index = 0;
133 }
134 break;
135 case BS_PATTERN:
136 case BS_DIBPATTERN:
137 {
139#ifdef __REACTOS__
140 char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)]; // ros
141#else
142 char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
143#endif
145 DWORD info_size;
146 void *bits;
147 UINT usage;
148
149 if (!get_brush_bitmap_info( hBrush, info, &bits, &usage )) break;
150 info_size = get_dib_info_size( info, usage );
151
152 emr = HeapAlloc( GetProcessHeap(), 0,
153 sizeof(EMRCREATEDIBPATTERNBRUSHPT)+info_size+info->bmiHeader.biSizeImage );
154 if(!emr) break;
155
156 if (logbrush.lbStyle == BS_PATTERN && info->bmiHeader.biBitCount == 1)
157 {
158 /* Presumably to reduce the size of the written EMF, MS supports an
159 * undocumented iUsage value of 2, indicating a mono bitmap without the
160 * 8 byte 2 entry black/white palette. Stupidly, they could have saved
161 * over 20 bytes more by also ignoring the BITMAPINFO fields that are
162 * irrelevant/constant for monochrome bitmaps.
163 * FIXME: It may be that the DIB functions themselves accept this value.
164 */
167 /* FIXME: There is an extra DWORD written by native before the BMI.
168 * Not sure what it's meant to contain.
169 */
170 emr->offBmi = sizeof( EMRCREATEDIBPATTERNBRUSHPT ) + sizeof(DWORD);
171 emr->cbBmi = sizeof( BITMAPINFOHEADER );
172 }
173 else
174 {
176 emr->offBmi = sizeof( EMRCREATEDIBPATTERNBRUSHPT );
177 emr->cbBmi = info_size;
178 }
179 emr->ihBrush = index = EMFDRV_AddHandle( dev, hBrush );
180 emr->iUsage = usage;
181 emr->offBits = emr->offBmi + emr->cbBmi;
182 emr->cbBits = info->bmiHeader.biSizeImage;
183 emr->emr.nSize = emr->offBits + emr->cbBits;
184
185 memcpy( (BYTE *)emr + emr->offBmi, info, emr->cbBmi );
186 memcpy( (BYTE *)emr + emr->offBits, bits, emr->cbBits );
187
188 if(!EMFDRV_WriteRecord( dev, &emr->emr ))
189 index = 0;
190 HeapFree( GetProcessHeap(), 0, emr );
191 }
192 break;
193
194 default:
195 FIXME("Unknown style %x\n", logbrush.lbStyle);
196 break;
197 }
198 return index;
199}
#define index(s, c)
Definition: various.h:29
#define FIXME(fmt,...)
Definition: debug.h:111
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
ULONG RGBQUAD
Definition: precomp.h:59
static UINT EMFDRV_AddHandle(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:35
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
#define DIB_PAL_MONO
Definition: gdi_private.h:196
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define bits
Definition: infblock.c:15
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
ULONG lbHatch
Definition: wingdi.h:1755
UINT lbStyle
Definition: wingdi.h:1753
COLORREF lbColor
Definition: wingdi.h:1754
UINT lbStyle
Definition: wingdi.h:1747
ULONG_PTR lbHatch
Definition: wingdi.h:1749
COLORREF lbColor
Definition: wingdi.h:1748
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
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 EMR_CREATEMONOBRUSH
Definition: wingdi.h:166
#define BS_DIBPATTERN
Definition: wingdi.h:1092
struct tagBITMAPINFO BITMAPINFO
#define BS_NULL
Definition: wingdi.h:1087
struct tagEMRCREATEDIBPATTERNBRUSHPT EMRCREATEDIBPATTERNBRUSHPT
#define EMR_CREATEDIBPATTERNBRUSHPT
Definition: wingdi.h:167
#define EMR_CREATEBRUSHINDIRECT
Definition: wingdi.h:113
#define BS_SOLID
Definition: wingdi.h:1086
unsigned char BYTE
Definition: xxhash.c:193

Referenced by EMFDRV_FillRgn(), EMFDRV_FrameRgn(), EMFDRV_SelectBrush(), and EMFDRV_SetDCBrushColor().

◆ EMFDRV_DeleteObject()

BOOL EMFDRV_DeleteObject ( PHYSDEV  dev,
HGDIOBJ  obj 
)

Definition at line 77 of file objects.c.

78{
81 UINT index;
82 BOOL ret = TRUE;
83
84 if(!(index = EMFDRV_FindObject(dev, obj))) return FALSE;
85
87 emr.emr.nSize = sizeof(emr);
88 emr.ihObject = index;
89
90 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
91 ret = FALSE;
92
93 physDev->handles[index - 1] = 0;
94 physDev->cur_handles--;
95 return ret;
96}
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
unsigned int BOOL
Definition: ntddk_ex.h:94
HGDIOBJ * handles
int ret
#define EMR_DELETEOBJECT
Definition: wingdi.h:114

◆ EMFDRV_Ellipse()

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

Definition at line 408 of file graphics.c.

409{
410 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
411#ifndef __REACTOS__
412 DC *dc = get_physdev_dc( dev );
413#endif
414 EMRELLIPSE emr;
415 INT temp;
416
417 TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
418
419 if(left == right || top == bottom) return FALSE;
420
421 if(left > right) {temp = left; left = right; right = temp;}
422 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
423#ifdef __REACTOS__
424 if(GetGraphicsMode(dev->hdc) == GM_COMPATIBLE) {
425#else
426 if(dc->GraphicsMode == GM_COMPATIBLE) {
427#endif
428 right--;
429 bottom--;
430 }
431
432 emr.emr.iType = EMR_ELLIPSE;
433 emr.emr.nSize = sizeof(emr);
434 emr.rclBox.left = left;
435 emr.rclBox.top = top;
436 emr.rclBox.right = right;
437 emr.rclBox.bottom = bottom;
438
439 if(!physDev->path)
441 return EMFDRV_WriteRecord( dev, &emr.emr );
442}
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:231
static calc_node_t temp
Definition: rpn_ieee.c:38
#define TRACE(s)
Definition: solgame.cpp:4
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
RECTL rclBox
Definition: wingdi.h:1856
int32_t INT
Definition: typedefs.h:58
#define GM_COMPATIBLE
Definition: wingdi.h:864
int WINAPI GetGraphicsMode(_In_ HDC)
#define EMR_ELLIPSE
Definition: wingdi.h:116

◆ EMFDRV_EndPath()

BOOL EMFDRV_EndPath ( PHYSDEV  dev)

Definition at line 457 of file dc.c.

458{
459 EMRENDPATH emr;
460
461 emr.emr.iType = EMR_ENDPATH;
462 emr.emr.nSize = sizeof(emr);
463
464 EMFDRV_WriteRecord( dev, &emr.emr );
465 return FALSE; /* always fails without a path */
466}
#define EMR_ENDPATH
Definition: wingdi.h:134

◆ EMFDRV_ExcludeClipRect()

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

Definition at line 164 of file dc.c.

165{
166 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExcludeClipRect );
168
170 emr.emr.nSize = sizeof(emr);
171 emr.rclClip.left = left;
172 emr.rclClip.top = top;
173 emr.rclClip.right = right;
174 emr.rclClip.bottom = bottom;
175 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
176 return next->funcs->pExcludeClipRect( next, left, top, right, bottom );
177}
#define ERROR(name)
Definition: error_private.h:53
#define EMR_EXCLUDECLIPRECT
Definition: wingdi.h:103

◆ EMFDRV_ExtFloodFill()

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

Definition at line 747 of file graphics.c.

748{
749 EMREXTFLOODFILL emr;
750
752 emr.emr.nSize = sizeof(emr);
753 emr.ptlStart.x = x;
754 emr.ptlStart.y = y;
755 emr.crColor = color;
756 emr.iMode = fillType;
757
758 return EMFDRV_WriteRecord( dev, &emr.emr );
759}
GLuint color
Definition: glext.h:6243
COLORREF crColor
Definition: wingdi.h:1962
#define EMR_EXTFLOODFILL
Definition: wingdi.h:127

◆ EMFDRV_ExtSelectClipRgn()

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

Definition at line 207 of file dc.c.

208{
209 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExtSelectClipRgn );
211 DWORD size, rgnsize;
212 BOOL ret;
213
214 if (!hrgn)
215 {
216 if (mode != RGN_COPY) return ERROR;
217 rgnsize = 0;
218 }
219 else rgnsize = GetRegionData( hrgn, 0, NULL );
220
221 size = rgnsize + offsetof(EMREXTSELECTCLIPRGN,RgnData);
222 emr = HeapAlloc( GetProcessHeap(), 0, size );
223 if (rgnsize) GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
224
226 emr->emr.nSize = size;
227 emr->cbRgnData = rgnsize;
228 emr->iMode = mode;
229
230 ret = EMFDRV_WriteRecord( dev, &emr->emr );
231 HeapFree( GetProcessHeap(), 0, emr );
232 return ret ? next->funcs->pExtSelectClipRgn( next, hrgn, mode ) : ERROR;
233}
static HRGN hrgn
#define NULL
Definition: types.h:112
GLsizeiptr size
Definition: glext.h:5919
GLenum mode
Definition: glext.h:6217
#define offsetof(TYPE, MEMBER)
#define EMR_EXTSELECTCLIPRGN
Definition: wingdi.h:148
#define RGN_COPY
Definition: wingdi.h:357
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)

◆ EMFDRV_ExtTextOut()

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

Definition at line 883 of file graphics.c.

885{
886 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
887#ifndef __REACTOS__
888 DC *dc = get_physdev_dc( dev );
889#endif
890 EMREXTTEXTOUTW *pemr;
891 DWORD nSize;
892 BOOL ret;
893 int textHeight = 0;
894 int textWidth = 0;
895#ifdef __REACTOS__
896 const UINT textAlign = GetTextAlign( dev->hdc );
897 const INT graphicsMode = GetGraphicsMode( dev->hdc );
898#else
899 const UINT textAlign = dc->textAlign;
900 const INT graphicsMode = dc->GraphicsMode;
901#endif
902 FLOAT exScale, eyScale;
903
904 nSize = sizeof(*pemr) + ((count+1) & ~1) * sizeof(WCHAR) + count * sizeof(INT);
905
906 TRACE("%s %s count %d nSize = %d\n", debugstr_wn(str, count),
907 wine_dbgstr_rect(lprect), count, nSize);
909
910 if (graphicsMode == GM_COMPATIBLE)
911 {
912 const INT horzSize = GetDeviceCaps( dev->hdc, HORZSIZE );
913 const INT horzRes = GetDeviceCaps( dev->hdc, HORZRES );
914 const INT vertSize = GetDeviceCaps( dev->hdc, VERTSIZE );
915 const INT vertRes = GetDeviceCaps( dev->hdc, VERTRES );
916 SIZE wndext, vportext;
917
918 GetViewportExtEx( dev->hdc, &vportext );
919 GetWindowExtEx( dev->hdc, &wndext );
920 exScale = 100.0 * ((FLOAT)horzSize / (FLOAT)horzRes) /
921 ((FLOAT)wndext.cx / (FLOAT)vportext.cx);
922 eyScale = 100.0 * ((FLOAT)vertSize / (FLOAT)vertRes) /
923 ((FLOAT)wndext.cy / (FLOAT)vportext.cy);
924 }
925 else
926 {
927 exScale = 0.0;
928 eyScale = 0.0;
929 }
930
931 pemr->emr.iType = EMR_EXTTEXTOUTW;
932 pemr->emr.nSize = nSize;
933 pemr->iGraphicsMode = graphicsMode;
934 pemr->exScale = exScale;
935 pemr->eyScale = eyScale;
936 pemr->emrtext.ptlReference.x = x;
937 pemr->emrtext.ptlReference.y = y;
938 pemr->emrtext.nChars = count;
939 pemr->emrtext.offString = sizeof(*pemr);
940 memcpy((char*)pemr + pemr->emrtext.offString, str, count * sizeof(WCHAR));
941 pemr->emrtext.fOptions = flags;
942 if(!lprect) {
943 pemr->emrtext.rcl.left = pemr->emrtext.rcl.top = 0;
944 pemr->emrtext.rcl.right = pemr->emrtext.rcl.bottom = -1;
945 } else {
946 pemr->emrtext.rcl.left = lprect->left;
947 pemr->emrtext.rcl.top = lprect->top;
948 pemr->emrtext.rcl.right = lprect->right;
949 pemr->emrtext.rcl.bottom = lprect->bottom;
950 }
951
952 pemr->emrtext.offDx = pemr->emrtext.offString + ((count+1) & ~1) * sizeof(WCHAR);
953 if(lpDx) {
954 UINT i;
955 SIZE strSize;
956 memcpy((char*)pemr + pemr->emrtext.offDx, lpDx, count * sizeof(INT));
957 for (i = 0; i < count; i++) {
958 textWidth += lpDx[i];
959 }
960 if (GetTextExtentPoint32W( dev->hdc, str, count, &strSize ))
961 textHeight = strSize.cy;
962 }
963 else {
964 UINT i;
965 INT *dx = (INT *)((char*)pemr + pemr->emrtext.offDx);
966 SIZE charSize;
967 for (i = 0; i < count; i++) {
968 if (GetTextExtentPoint32W( dev->hdc, str + i, 1, &charSize )) {
969 dx[i] = charSize.cx;
970 textWidth += charSize.cx;
971 textHeight = max(textHeight, charSize.cy);
972 }
973 }
974 }
975
976 if (physDev->path)
977 {
978 pemr->rclBounds.left = pemr->rclBounds.top = 0;
979 pemr->rclBounds.right = pemr->rclBounds.bottom = -1;
980 goto no_bounds;
981 }
982
983 /* FIXME: handle font escapement */
984 switch (textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER)) {
985 case TA_CENTER: {
986 pemr->rclBounds.left = x - (textWidth / 2) - 1;
987 pemr->rclBounds.right = x + (textWidth / 2) + 1;
988 break;
989 }
990 case TA_RIGHT: {
991 pemr->rclBounds.left = x - textWidth - 1;
992 pemr->rclBounds.right = x;
993 break;
994 }
995 default: { /* TA_LEFT */
996 pemr->rclBounds.left = x;
997 pemr->rclBounds.right = x + textWidth + 1;
998 }
999 }
1000
1001 switch (textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE)) {
1002 case TA_BASELINE: {
1004 if (!GetTextMetricsW( dev->hdc, &tm ))
1005 tm.tmDescent = 0;
1006 /* Play safe here... it's better to have a bounding box */
1007 /* that is too big than too small. */
1008 pemr->rclBounds.top = y - textHeight - 1;
1009 pemr->rclBounds.bottom = y + tm.tmDescent + 1;
1010 break;
1011 }
1012 case TA_BOTTOM: {
1013 pemr->rclBounds.top = y - textHeight - 1;
1014 pemr->rclBounds.bottom = y;
1015 break;
1016 }
1017 default: { /* TA_TOP */
1018 pemr->rclBounds.top = y;
1019 pemr->rclBounds.bottom = y + textHeight + 1;
1020 }
1021 }
1022 EMFDRV_UpdateBBox( dev, &pemr->rclBounds );
1023
1024no_bounds:
1025 ret = EMFDRV_WriteRecord( dev, &pemr->emr );
1026 HeapFree( GetProcessHeap(), 0, pemr );
1027 return ret;
1028}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
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 FLOAT
Definition: i386-dis.c:525
#define debugstr_wn
Definition: kernel32.h:33
GLint dx
Definition: linetemp.h:97
const WCHAR * str
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
Definition: time.h:68
#define max(a, b)
Definition: svc.c:63
float FLOAT
Definition: typedefs.h:69
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2084
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:838
#define VERTSIZE
Definition: wingdi.h:715
#define EMR_EXTTEXTOUTW
Definition: wingdi.h:157
#define TA_RIGHT
Definition: wingdi.h:933
#define TA_LEFT
Definition: wingdi.h:932
#define HORZSIZE
Definition: wingdi.h:714
#define VERTRES
Definition: wingdi.h:717
BOOL WINAPI GetWindowExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:411
#define TA_TOP
Definition: wingdi.h:930
#define TA_BOTTOM
Definition: wingdi.h:929
#define TA_BASELINE
Definition: wingdi.h:928
#define TA_CENTER
Definition: wingdi.h:931
BOOL WINAPI GetViewportExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:351
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ EMFDRV_FillPath()

BOOL EMFDRV_FillPath ( PHYSDEV  dev)

Definition at line 1087 of file graphics.c.

1088{
1090}
static BOOL emfdrv_stroke_and_fill_path(PHYSDEV dev, INT type)
Definition: graphics.c:144
#define EMR_FILLPATH
Definition: wingdi.h:136

◆ EMFDRV_FillRgn()

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

Definition at line 765 of file graphics.c.

766{
767 EMRFILLRGN *emr;
768 DWORD size, rgnsize, index;
769 BOOL ret;
770
772 if(!index) return FALSE;
773
774 rgnsize = GetRegionData( hrgn, 0, NULL );
775 size = rgnsize + offsetof(EMRFILLRGN,RgnData);
776 emr = HeapAlloc( GetProcessHeap(), 0, size );
777
778 GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
779
780 emr->emr.iType = EMR_FILLRGN;
781 emr->emr.nSize = size;
782 emr->rclBounds.left = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.left;
783 emr->rclBounds.top = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.top;
784 emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1;
785 emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
786 emr->cbRgnData = rgnsize;
787 emr->ihBrush = index;
788
789 ret = EMFDRV_WriteRecord( dev, &emr->emr );
790 if(ret)
792 HeapFree( GetProcessHeap(), 0, emr );
793 return ret;
794}
static HBRUSH hbrush
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
Definition: objects.c:111
BYTE RgnData[1]
Definition: wingdi.h:1996
DWORD cbRgnData
Definition: wingdi.h:1994
RECTL rclBounds
Definition: wingdi.h:1993
DWORD ihBrush
Definition: wingdi.h:1995
#define EMR_FILLRGN
Definition: wingdi.h:144

◆ EMFDRV_FlattenPath()

BOOL EMFDRV_FlattenPath ( PHYSDEV  dev)

Definition at line 468 of file dc.c.

469{
470 EMRFLATTENPATH emr;
471
473 emr.emr.nSize = sizeof(emr);
474
475 return EMFDRV_WriteRecord( dev, &emr.emr );
476}
#define EMR_FLATTENPATH
Definition: wingdi.h:139

◆ EMFDRV_FrameRgn()

BOOL EMFDRV_FrameRgn ( PHYSDEV  dev,
HRGN  hrgn,
HBRUSH  hbrush,
INT  width,
INT  height 
)

Definition at line 798 of file graphics.c.

799{
800 EMRFRAMERGN *emr;
801 DWORD size, rgnsize, index;
802 BOOL ret;
803
805 if(!index) return FALSE;
806
807 rgnsize = GetRegionData( hrgn, 0, NULL );
808 size = rgnsize + offsetof(EMRFRAMERGN,RgnData);
809 emr = HeapAlloc( GetProcessHeap(), 0, size );
810
811 GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
812
813 emr->emr.iType = EMR_FRAMERGN;
814 emr->emr.nSize = size;
815 emr->rclBounds.left = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.left;
816 emr->rclBounds.top = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.top;
817 emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1;
818 emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
819 emr->cbRgnData = rgnsize;
820 emr->ihBrush = index;
821 emr->szlStroke.cx = width;
822 emr->szlStroke.cy = height;
823
824 ret = EMFDRV_WriteRecord( dev, &emr->emr );
825 if(ret)
827 HeapFree( GetProcessHeap(), 0, emr );
828 return ret;
829}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
SIZEL szlStroke
Definition: wingdi.h:2018
RECTL rclBounds
Definition: wingdi.h:2015
DWORD ihBrush
Definition: wingdi.h:2017
DWORD cbRgnData
Definition: wingdi.h:2016
BYTE RgnData[1]
Definition: wingdi.h:2019
#define EMR_FRAMERGN
Definition: wingdi.h:145

◆ EMFDRV_GdiComment()

BOOL EMFDRV_GdiComment ( PHYSDEV  dev,
UINT  bytes,
const BYTE buffer 
)

Definition at line 520 of file objects.c.

521{
522 EMRGDICOMMENT *emr;
523 UINT total, rounded_size;
524 BOOL ret;
525
526 rounded_size = (bytes+3) & ~3;
527 total = offsetof(EMRGDICOMMENT,Data) + rounded_size;
528
529 emr = HeapAlloc(GetProcessHeap(), 0, total);
530 emr->emr.iType = EMR_GDICOMMENT;
531 emr->emr.nSize = total;
532 emr->cbData = bytes;
533 memset(&emr->Data[bytes], 0, rounded_size - bytes);
534 memcpy(&emr->Data[0], buffer, bytes);
535
536 ret = EMFDRV_WriteRecord( dev, &emr->emr );
537
538 HeapFree(GetProcessHeap(), 0, emr);
539
540 return ret;
541}
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
size_t total
#define memset(x, y, z)
Definition: compat.h:39
BYTE Data[1]
Definition: wingdi.h:2024
#define EMR_GDICOMMENT
Definition: wingdi.h:143

◆ EMFDRV_GetDeviceCaps()

INT EMFDRV_GetDeviceCaps ( PHYSDEV  dev,
INT  cap 
)

Definition at line 510 of file dc.c.

511{
512 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
513
514 return GetDeviceCaps( physDev->ref_dc, cap );
515}
GLenum cap
Definition: glext.h:9639

◆ EMFDRV_GradientFill()

BOOL EMFDRV_GradientFill ( PHYSDEV  dev,
TRIVERTEX vert_array,
ULONG  nvert,
void grad_array,
ULONG  ngrad,
ULONG  mode 
)

Definition at line 1033 of file graphics.c.

1035{
1036 EMRGRADIENTFILL *emr;
1037 ULONG i, pt, size, num_pts = ngrad * (mode == GRADIENT_FILL_TRIANGLE ? 3 : 2);
1038 const ULONG *pts = (const ULONG *)grad_array;
1039 BOOL ret;
1040
1041 size = FIELD_OFFSET(EMRGRADIENTFILL, Ver[nvert]) + num_pts * sizeof(pts[0]);
1042
1043 emr = HeapAlloc( GetProcessHeap(), 0, size );
1044 if (!emr) return FALSE;
1045
1046 for (i = 0; i < num_pts; i++)
1047 {
1048 pt = pts[i];
1049
1050 if (i == 0)
1051 {
1052 emr->rclBounds.left = emr->rclBounds.right = vert_array[pt].x;
1053 emr->rclBounds.top = emr->rclBounds.bottom = vert_array[pt].y;
1054 }
1055 else
1056 {
1057 if (vert_array[pt].x < emr->rclBounds.left)
1058 emr->rclBounds.left = vert_array[pt].x;
1059 else if (vert_array[pt].x > emr->rclBounds.right)
1060 emr->rclBounds.right = vert_array[pt].x;
1061 if (vert_array[pt].y < emr->rclBounds.top)
1062 emr->rclBounds.top = vert_array[pt].y;
1063 else if (vert_array[pt].y > emr->rclBounds.bottom)
1064 emr->rclBounds.bottom = vert_array[pt].y;
1065 }
1066 }
1067 emr->rclBounds.right--;
1068 emr->rclBounds.bottom--;
1069
1070 emr->emr.iType = EMR_GRADIENTFILL;
1071 emr->emr.nSize = size;
1072 emr->nVer = nvert;
1073 emr->nTri = ngrad;
1074 emr->ulMode = mode;
1075 memcpy( emr->Ver, vert_array, nvert * sizeof(vert_array[0]) );
1076 memcpy( emr->Ver + nvert, pts, num_pts * sizeof(pts[0]) );
1077
1079 ret = EMFDRV_WriteRecord( dev, &emr->emr );
1080 HeapFree( GetProcessHeap(), 0, emr );
1081 return ret;
1082}
#define pt(x, y)
Definition: drawing.c:79
LONG y
Definition: wingdi.h:2785
LONG x
Definition: wingdi.h:2784
TRIVERTEX Ver[1]
Definition: wingdi.h:2797
uint32_t ULONG
Definition: typedefs.h:59

◆ EMFDRV_IntersectClipRect()

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

Definition at line 179 of file dc.c.

180{
181 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pIntersectClipRect );
183
185 emr.emr.nSize = sizeof(emr);
186 emr.rclClip.left = left;
187 emr.rclClip.top = top;
188 emr.rclClip.right = right;
189 emr.rclClip.bottom = bottom;
190 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
191 return next->funcs->pIntersectClipRect( next, left, top, right, bottom );
192}
#define EMR_INTERSECTCLIPRECT
Definition: wingdi.h:104

◆ EMFDRV_InvertRgn()

BOOL EMFDRV_InvertRgn ( PHYSDEV  dev,
HRGN  hrgn 
)

Definition at line 875 of file graphics.c.

876{
878}
static BOOL EMFDRV_PaintInvertRgn(PHYSDEV dev, HRGN hrgn, DWORD iType)
Definition: graphics.c:836
#define EMR_INVERTRGN
Definition: wingdi.h:146

◆ EMFDRV_LineTo()

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

Definition at line 188 of file graphics.c.

189{
190 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
191#ifndef __REACTOS__
192 DC *dc = get_physdev_dc( dev );
193#endif
194 POINT pt;
195 EMRLINETO emr;
196 RECTL bounds;
197
198 emr.emr.iType = EMR_LINETO;
199 emr.emr.nSize = sizeof(emr);
200 emr.ptl.x = x;
201 emr.ptl.y = y;
202
203 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
204 return FALSE;
205#ifdef __REACTOS__
206 GetCurrentPositionEx( dev->hdc, &pt );
207#else
208 pt = dc->cur_pos;
209#endif
210 bounds.left = min(x, pt.x);
211 bounds.top = min(y, pt.y);
212 bounds.right = max(x, pt.x);
213 bounds.bottom = max(y, pt.y);
214
215 if(!physDev->path)
216 EMFDRV_UpdateBBox( dev, &bounds );
217
218 return TRUE;
219}
#define min(a, b)
Definition: monoChain.cc:55
POINTL ptl
Definition: wingdi.h:2034
BOOL WINAPI GetCurrentPositionEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:241
#define EMR_LINETO
Definition: wingdi.h:128

◆ EMFDRV_ModifyWorldTransform()

BOOL EMFDRV_ModifyWorldTransform ( PHYSDEV  dev,
const XFORM xform,
DWORD  mode 
)

Definition at line 358 of file dc.c.

359{
360 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pModifyWorldTransform );
362
364 emr.emr.nSize = sizeof(emr);
365 emr.xform = *xform;
366 emr.iMode = mode;
367
368 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
369 return next->funcs->pModifyWorldTransform( next, xform, mode );
370}
#define EMR_MODIFYWORLDTRANSFORM
Definition: wingdi.h:110

◆ EMFDRV_MoveTo()

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

Definition at line 173 of file graphics.c.

174{
175 EMRMOVETOEX emr;
176
177 emr.emr.iType = EMR_MOVETOEX;
178 emr.emr.nSize = sizeof(emr);
179 emr.ptl.x = x;
180 emr.ptl.y = y;
181
182 return EMFDRV_WriteRecord( dev, &emr.emr );
183}
#define EMR_MOVETOEX
Definition: wingdi.h:101

◆ EMFDRV_OffsetClipRgn()

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

Definition at line 194 of file dc.c.

195{
196 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetClipRgn );
198
200 emr.emr.nSize = sizeof(emr);
201 emr.ptlOffset.x = x;
202 emr.ptlOffset.y = y;
203 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
204 return next->funcs->pOffsetClipRgn( next, x, y );
205}
#define EMR_OFFSETCLIPRGN
Definition: wingdi.h:100

◆ EMFDRV_OffsetViewportOrgEx()

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

Definition at line 372 of file dc.c.

373{
374 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetViewportOrgEx );
376 POINT prev;
377
378 GetViewportOrgEx( dev->hdc, &prev );
379
381 emr.emr.nSize = sizeof(emr);
382 emr.ptlOrigin.x = prev.x + x;
383 emr.ptlOrigin.y = prev.y + y;
384
385 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
386 return next->funcs->pOffsetViewportOrgEx( next, x, y, pt );
387}
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define EMR_SETVIEWPORTORGEX
Definition: wingdi.h:86
BOOL WINAPI GetViewportOrgEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:383

◆ EMFDRV_OffsetWindowOrgEx()

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

Definition at line 389 of file dc.c.

390{
391 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetWindowOrgEx );
393 POINT prev;
394
395 GetWindowOrgEx( dev->hdc, &prev );
396
398 emr.emr.nSize = sizeof(emr);
399 emr.ptlOrigin.x = prev.x + x;
400 emr.ptlOrigin.y = prev.y + y;
401
402 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
403 return next->funcs->pOffsetWindowOrgEx( next, x, y, pt );
404}
BOOL WINAPI GetWindowOrgEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:439
#define EMR_SETWINDOWORGEX
Definition: wingdi.h:84

◆ EMFDRV_PaintRgn()

BOOL EMFDRV_PaintRgn ( PHYSDEV  dev,
HRGN  hrgn 
)

Definition at line 867 of file graphics.c.

868{
870}
#define EMR_PAINTRGN
Definition: wingdi.h:147

◆ EMFDRV_PatBlt()

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

Definition at line 30 of file bitblt.c.

31{
32 EMRBITBLT emr;
33 BOOL ret;
34
35 emr.emr.iType = EMR_BITBLT;
36 emr.emr.nSize = sizeof(emr);
37 emr.rclBounds.left = dst->log_x;
38 emr.rclBounds.top = dst->log_y;
39 emr.rclBounds.right = dst->log_x + dst->log_width - 1;
40 emr.rclBounds.bottom = dst->log_y + dst->log_height - 1;
41 emr.xDest = dst->log_x;
42 emr.yDest = dst->log_y;
43 emr.cxDest = dst->log_width;
44 emr.cyDest = dst->log_height;
45 emr.dwRop = rop;
46 emr.xSrc = 0;
47 emr.ySrc = 0;
48 emr.xformSrc.eM11 = 1.0;
49 emr.xformSrc.eM12 = 0.0;
50 emr.xformSrc.eM21 = 0.0;
51 emr.xformSrc.eM22 = 1.0;
52 emr.xformSrc.eDx = 0.0;
53 emr.xformSrc.eDy = 0.0;
54 emr.crBkColorSrc = 0;
55 emr.iUsageSrc = 0;
56 emr.offBmiSrc = 0;
57 emr.cbBmiSrc = 0;
58 emr.offBitsSrc = 0;
59 emr.cbBitsSrc = 0;
60
61 ret = EMFDRV_WriteRecord( dev, &emr.emr );
62 if(ret)
64 return ret;
65}
GLenum GLenum dst
Definition: glext.h:6340
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
FLOAT eDy
Definition: wingdi.h:1726
FLOAT eM11
Definition: wingdi.h:1721
FLOAT eM21
Definition: wingdi.h:1723
FLOAT eM22
Definition: wingdi.h:1724
FLOAT eM12
Definition: wingdi.h:1722
FLOAT eDx
Definition: wingdi.h:1725
LONG cyDest
Definition: wingdi.h:1734
DWORD dwRop
Definition: wingdi.h:1735
XFORM xformSrc
Definition: wingdi.h:1738
DWORD cbBitsSrc
Definition: wingdi.h:1744
COLORREF crBkColorSrc
Definition: wingdi.h:1739
LONG ySrc
Definition: wingdi.h:1737
LONG xSrc
Definition: wingdi.h:1736
RECTL rclBounds
Definition: wingdi.h:1730
DWORD offBitsSrc
Definition: wingdi.h:1743
LONG xDest
Definition: wingdi.h:1731
DWORD iUsageSrc
Definition: wingdi.h:1740
LONG cxDest
Definition: wingdi.h:1733
DWORD offBmiSrc
Definition: wingdi.h:1741
LONG yDest
Definition: wingdi.h:1732
DWORD cbBmiSrc
Definition: wingdi.h:1742
#define EMR_BITBLT
Definition: wingdi.h:149

◆ EMFDRV_Pie()

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

Definition at line 369 of file graphics.c.

371{
372 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
373 xend, yend, EMR_PIE );
374}
#define EMR_PIE
Definition: wingdi.h:121

◆ EMFDRV_PolyBezier()

BOOL EMFDRV_PolyBezier ( PHYSDEV  dev,
const POINT pts,
DWORD  count 
)

Definition at line 617 of file graphics.c.

618{
620}
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
Definition: graphics.c:552
#define EMR_POLYBEZIER
Definition: wingdi.h:76

◆ EMFDRV_PolyBezierTo()

BOOL EMFDRV_PolyBezierTo ( PHYSDEV  dev,
const POINT pts,
DWORD  count 
)

Definition at line 625 of file graphics.c.

626{
628}
#define EMR_POLYBEZIERTO
Definition: wingdi.h:79

◆ EMFDRV_PolyDraw()

BOOL EMFDRV_PolyDraw ( PHYSDEV  dev,
const POINT pts,
const BYTE types,
DWORD  count 
)

Definition at line 710 of file graphics.c.

711{
712 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
713 EMRPOLYDRAW *emr;
714 BOOL ret;
715 BYTE *types_dest;
716 BOOL use_small_emr = can_use_short_points( pts, count );
717 DWORD size;
718
719 size = use_small_emr ? offsetof( EMRPOLYDRAW16, apts[count] ) : offsetof( EMRPOLYDRAW, aptl[count] );
720 size += (count + 3) & ~3;
721
722 if (!(emr = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
723
724 emr->emr.iType = use_small_emr ? EMR_POLYDRAW16 : EMR_POLYDRAW;
725 emr->emr.nSize = size;
726 emr->cptl = count;
727
728 types_dest = store_points( emr->aptl, pts, count, use_small_emr );
729 memcpy( types_dest, types, count );
730 if (count & 3) memset( types_dest + count, 0, 4 - (count & 3) );
731
732 if (!physDev->path)
733 get_points_bounds( &emr->rclBounds, pts, count, 0 );
734 else
735 emr->rclBounds = empty_bounds;
736
737 ret = EMFDRV_WriteRecord( dev, &emr->emr );
738 if (ret && !physDev->path) EMFDRV_UpdateBBox( dev, &emr->rclBounds );
739 HeapFree( GetProcessHeap(), 0, emr );
740 return ret;
741}
static struct list apts
Definition: compobj.c:78
POINTL aptl[1]
Definition: wingdi.h:2097
RECTL rclBounds
Definition: wingdi.h:2095
DWORD cptl
Definition: wingdi.h:2096
Definition: cmds.c:130
static void * store_points(POINTL *dest, const POINT *pts, UINT count, BOOL short_points)
Definition: graphics.c:50
static const RECTL empty_bounds
Definition: graphics.c:36
static void get_points_bounds(RECTL *bounds, const POINT *pts, UINT count, DC *dc)
Definition: graphics.c:75
static BOOL can_use_short_points(const POINT *pts, UINT count)
Definition: graphics.c:39
#define EMR_POLYDRAW16
Definition: wingdi.h:165
#define EMR_POLYDRAW
Definition: wingdi.h:130

◆ EMFDRV_Polygon()

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

Definition at line 608 of file graphics.c.

609{
610 if(count < 2) return FALSE;
612}
#define EMR_POLYGON
Definition: wingdi.h:77

◆ EMFDRV_Polyline()

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

Definition at line 592 of file graphics.c.

593{
595}
#define EMR_POLYLINE
Definition: wingdi.h:78

◆ EMFDRV_PolylineTo()

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

Definition at line 600 of file graphics.c.

601{
603}
#define EMR_POLYLINETO
Definition: wingdi.h:80

◆ EMFDRV_PolyPolygon()

BOOL EMFDRV_PolyPolygon ( PHYSDEV  dev,
const POINT pt,
const INT counts,
UINT  polys 
)

Definition at line 701 of file graphics.c.

702{
703 return EMFDRV_PolyPolylinegon( dev, pt, counts, polys, EMR_POLYPOLYGON );
704}
static BOOL EMFDRV_PolyPolylinegon(PHYSDEV dev, const POINT *pt, const INT *counts, UINT polys, DWORD iType)
Definition: graphics.c:637
#define EMR_POLYPOLYGON
Definition: wingdi.h:82

◆ EMFDRV_PolyPolyline()

BOOL EMFDRV_PolyPolyline ( PHYSDEV  dev,
const POINT pt,
const DWORD counts,
DWORD  polys 
)

Definition at line 692 of file graphics.c.

693{
694 return EMFDRV_PolyPolylinegon( dev, pt, (const INT *)counts, polys,
696}
#define EMR_POLYPOLYLINE
Definition: wingdi.h:81

◆ EMFDRV_Rectangle()

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

Definition at line 447 of file graphics.c.

448{
449 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
450#ifndef __REACTOS__
451 DC *dc = get_physdev_dc( dev );
452#endif
453 EMRRECTANGLE emr;
454 INT temp;
455
456 TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
457
458 if(left == right || top == bottom) return FALSE;
459
460 if(left > right) {temp = left; left = right; right = temp;}
461 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
462#ifdef __REACTOS__
463 if(GetGraphicsMode(dev->hdc) == GM_COMPATIBLE) {
464#else
465 if(dc->GraphicsMode == GM_COMPATIBLE) {
466#endif
467 right--;
468 bottom--;
469 }
470
471 emr.emr.iType = EMR_RECTANGLE;
472 emr.emr.nSize = sizeof(emr);
473 emr.rclBox.left = left;
474 emr.rclBox.top = top;
475 emr.rclBox.right = right;
476 emr.rclBox.bottom = bottom;
477
478 if(!physDev->path)
480 return EMFDRV_WriteRecord( dev, &emr.emr );
481}
#define EMR_RECTANGLE
Definition: wingdi.h:117

◆ EMFDRV_RestoreDC()

BOOL EMFDRV_RestoreDC ( PHYSDEV  dev,
INT  level 
)

Definition at line 48 of file dc.c.

49{
50 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRestoreDC );
52 DC *dc = get_physdev_dc( dev );
53 EMRRESTOREDC emr;
54 BOOL ret;
55
57 emr.emr.nSize = sizeof(emr);
58
59 if (level < 0)
60 emr.iRelative = level;
61 else
62 emr.iRelative = level - dc->saveLevel - 1;
63
64 physDev->restoring++;
65 ret = next->funcs->pRestoreDC( next, level );
66 physDev->restoring--;
67
68 if (ret) EMFDRV_WriteRecord( dev, &emr.emr );
69 return ret;
70}
GLint level
Definition: gl.h:1546
LONG iRelative
Definition: wingdi.h:2151
#define EMR_RESTOREDC
Definition: wingdi.h:108

◆ EMFDRV_RoundRect()

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

Definition at line 486 of file graphics.c.

488{
489 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
490#ifndef __REACTOS__
491 DC *dc = get_physdev_dc( dev );
492#endif
493 EMRROUNDRECT emr;
494 INT temp;
495
496 if(left == right || top == bottom) return FALSE;
497
498 if(left > right) {temp = left; left = right; right = temp;}
499 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
500#ifdef __REACTOS__
501 if(GetGraphicsMode(dev->hdc) == GM_COMPATIBLE) {
502#else
503 if(dc->GraphicsMode == GM_COMPATIBLE) {
504#endif
505 right--;
506 bottom--;
507 }
508
509 emr.emr.iType = EMR_ROUNDRECT;
510 emr.emr.nSize = sizeof(emr);
511 emr.rclBox.left = left;
512 emr.rclBox.top = top;
513 emr.rclBox.right = right;
514 emr.rclBox.bottom = bottom;
515 emr.szlCorner.cx = ell_width;
516 emr.szlCorner.cy = ell_height;
517
518 if(!physDev->path)
520 return EMFDRV_WriteRecord( dev, &emr.emr );
521}
RECTL rclBox
Definition: wingdi.h:2155
SIZEL szlCorner
Definition: wingdi.h:2156
#define EMR_ROUNDRECT
Definition: wingdi.h:118

◆ EMFDRV_SaveDC()

INT EMFDRV_SaveDC ( PHYSDEV  dev)

Definition at line 33 of file dc.c.

34{
35 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSaveDC );
36 INT ret = next->funcs->pSaveDC( next );
37
38 if (ret)
39 {
40 EMRSAVEDC emr;
41 emr.emr.iType = EMR_SAVEDC;
42 emr.emr.nSize = sizeof(emr);
43 EMFDRV_WriteRecord( dev, &emr.emr );
44 }
45 return ret;
46}
#define EMR_SAVEDC
Definition: wingdi.h:107

◆ EMFDRV_ScaleViewportExtEx()

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

Definition at line 303 of file dc.c.

304{
305 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pScaleViewportExtEx );
307
309 emr.emr.nSize = sizeof(emr);
310 emr.xNum = xNum;
311 emr.xDenom = xDenom;
312 emr.yNum = yNum;
313 emr.yDenom = yDenom;
314
315 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
316 return next->funcs->pScaleViewportExtEx( next, xNum, xDenom, yNum, yDenom, size );
317}
#define EMR_SCALEVIEWPORTEXTEX
Definition: wingdi.h:105

◆ EMFDRV_ScaleWindowExtEx()

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

Definition at line 319 of file dc.c.

320{
321 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pScaleWindowExtEx );
323
325 emr.emr.nSize = sizeof(emr);
326 emr.xNum = xNum;
327 emr.xDenom = xDenom;
328 emr.yNum = yNum;
329 emr.yDenom = yDenom;
330
331 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
332 return next->funcs->pScaleWindowExtEx( next, xNum, xDenom, yNum, yDenom, size );
333}
#define EMR_SCALEWINDOWEXTEX
Definition: wingdi.h:106

◆ EMFDRV_SelectBitmap()

HBITMAP EMFDRV_SelectBitmap ( PHYSDEV  dev,
HBITMAP  handle 
)

Definition at line 102 of file objects.c.

103{
104 return 0;
105}

◆ EMFDRV_SelectBrush()

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

Definition at line 205 of file objects.c.

206{
207 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
208 EMRSELECTOBJECT emr;
209 DWORD index;
210 int i;
211
212 if (physDev->restoring) return hBrush; /* don't output SelectObject records during RestoreDC */
213
214 /* If the object is a stock brush object, do not need to create it.
215 * See definitions in wingdi.h for range of stock brushes.
216 * We do however have to handle setting the higher order bit to
217 * designate that this is a stock object.
218 */
219 for (i = WHITE_BRUSH; i <= DC_BRUSH; i++)
220 {
221 if (hBrush == GetStockObject(i))
222 {
223 index = i | 0x80000000;
224 goto found;
225 }
226 }
227 if((index = EMFDRV_FindObject(dev, hBrush)) != 0)
228 goto found;
229
230 if (!(index = EMFDRV_CreateBrushIndirect(dev, hBrush ))) return 0;
231 GDI_hdc_using_object(hBrush, dev->hdc);
232
233 found:
235 emr.emr.nSize = sizeof(emr);
236 emr.ihObject = index;
237 return EMFDRV_WriteRecord( dev, &emr.emr ) ? hBrush : 0;
238}
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush)
Definition: objects.c:111
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:166
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
#define WHITE_BRUSH
Definition: wingdi.h:902

◆ EMFDRV_SelectClipPath()

BOOL EMFDRV_SelectClipPath ( PHYSDEV  dev,
INT  iMode 
)

Definition at line 478 of file dc.c.

479{
480 // PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectClipPath ); This HACK breaks test_emf_clipping
482 // BOOL ret = FALSE;
483 // HRGN hrgn;
484
486 emr.emr.nSize = sizeof(emr);
487 emr.iMode = iMode;
488
489 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
490/* hrgn = PathToRegion( dev->hdc );
491 if (hrgn)
492 {
493 ret = next->funcs->pExtSelectClipRgn( next, hrgn, iMode );
494 DeleteObject( hrgn );
495 } ERR("EMFDRV_SelectClipPath ret %d\n",ret);
496 return ret;*/
497 return TRUE;
498}
_In_ ULONG iMode
Definition: winddi.h:3520
#define EMR_SELECTCLIPPATH
Definition: wingdi.h:141

◆ EMFDRV_SelectFont()

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

Definition at line 284 of file objects.c.

285{
286 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
287 EMRSELECTOBJECT emr;
288 DWORD index;
289 int i;
290
291 if (physDev->restoring) goto done; /* don't output SelectObject records during RestoreDC */
292
293 /* If the object is a stock font object, do not need to create it.
294 * See definitions in wingdi.h for range of stock fonts.
295 * We do however have to handle setting the higher order bit to
296 * designate that this is a stock object.
297 */
298
299 for (i = OEM_FIXED_FONT; i <= DEFAULT_GUI_FONT; i++)
300 {
301 if (i != DEFAULT_PALETTE && hFont == GetStockObject(i))
302 {
303 index = i | 0x80000000;
304 goto found;
305 }
306 }
307
308 if((index = EMFDRV_FindObject(dev, hFont)) != 0)
309 goto found;
310
311 if (!(index = EMFDRV_CreateFontIndirect(dev, hFont ))) return 0;
313
314 found:
316 emr.emr.nSize = sizeof(emr);
317 emr.ihObject = index;
318 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
319 return 0;
320done:
321 *aa_flags = GGO_BITMAP; /* no point in anti-aliasing on metafiles */
322 dev = GET_NEXT_PHYSDEV( dev, pSelectFont );
323 dev->funcs->pSelectFont( dev, hFont, aa_flags );
324 return hFont;
325}
HFONT hFont
Definition: main.c:53
static BOOL EMFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont)
Definition: objects.c:244
#define DEFAULT_PALETTE
Definition: wingdi.h:913
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define OEM_FIXED_FONT
Definition: wingdi.h:910
#define GGO_BITMAP
Definition: wingdi.h:849

◆ EMFDRV_SelectPalette()

HPALETTE EMFDRV_SelectPalette ( PHYSDEV  dev,
HPALETTE  hPal,
BOOL  force 
)

Definition at line 437 of file objects.c.

438{
439 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
441 DWORD index;
442
443 if (physDev->restoring) return hPal; /* don't output SelectObject records during RestoreDC */
444
445 if (hPal == GetStockObject( DEFAULT_PALETTE ))
446 {
447 index = DEFAULT_PALETTE | 0x80000000;
448 goto found;
449 }
450
451 if ((index = EMFDRV_FindObject( dev, hPal )) != 0)
452 goto found;
453
454 if (!(index = EMFDRV_CreatePalette( dev, hPal ))) return 0;
455 GDI_hdc_using_object( hPal, dev->hdc );
456
457found:
459 emr.emr.nSize = sizeof(emr);
460 emr.ihPal = index;
461 return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPal : 0;
462}
static DWORD EMFDRV_CreatePalette(PHYSDEV dev, HPALETTE hPal)
Definition: objects.c:409
#define EMR_SELECTPALETTE
Definition: wingdi.h:122

◆ EMFDRV_SelectPen()

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

Definition at line 369 of file objects.c.

370{
371 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
372 EMRSELECTOBJECT emr;
373 DWORD index;
374 int i;
375
376 if (physDev->restoring) return hPen; /* don't output SelectObject records during RestoreDC */
377
378 /* If the object is a stock pen object, do not need to create it.
379 * See definitions in wingdi.h for range of stock pens.
380 * We do however have to handle setting the higher order bit to
381 * designate that this is a stock object.
382 */
383
384 for (i = WHITE_PEN; i <= DC_PEN; i++)
385 {
386 if (hPen == GetStockObject(i))
387 {
388 index = i | 0x80000000;
389 goto found;
390 }
391 }
392 if((index = EMFDRV_FindObject(dev, hPen)) != 0)
393 goto found;
394
395 if (!(index = EMFDRV_CreatePenIndirect(dev, hPen))) return 0;
396 GDI_hdc_using_object(hPen, dev->hdc);
397
398 found:
400 emr.emr.nSize = sizeof(emr);
401 emr.ihObject = index;
402 return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPen : 0;
403}
static DWORD EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen)
Definition: objects.c:332
#define WHITE_PEN
Definition: wingdi.h:905

◆ EMFDRV_SetArcDirection()

INT EMFDRV_SetArcDirection ( PHYSDEV  dev,
INT  arcDirection 
)

Definition at line 154 of file dc.c.

155{
157
159 emr.emr.nSize = sizeof(emr);
160 emr.iArcDirection = arcDirection;
161 return EMFDRV_WriteRecord(dev, &emr.emr) ? arcDirection : 0;
162}
#define EMR_SETARCDIRECTION
Definition: wingdi.h:131

◆ EMFDRV_SetBkColor()

COLORREF EMFDRV_SetBkColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 100 of file dc.c.

101{
102 EMRSETBKCOLOR emr;
103 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
104
105 if (physDev->restoring) return color; /* don't output records during RestoreDC */
106
108 emr.emr.nSize = sizeof(emr);
109 emr.crColor = color;
110 return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
111}
COLORREF crColor
Definition: wingdi.h:2181
#define EMR_SETBKCOLOR
Definition: wingdi.h:99
#define CLR_INVALID
Definition: wingdi.h:883

◆ EMFDRV_SetBkMode()

INT EMFDRV_SetBkMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 91 of file dc.c.

92{
93 EMRSETBKMODE emr;
95 emr.emr.nSize = sizeof(emr);
96 emr.iMode = mode;
97 return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
98}
#define EMR_SETBKMODE
Definition: wingdi.h:92

◆ EMFDRV_SetDCBrushColor()

COLORREF EMFDRV_SetDCBrushColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 467 of file objects.c.

468{
469 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
470#ifndef __REACTOS__
471 DC *dc = get_physdev_dc( dev );
472#endif
473 EMRSELECTOBJECT emr;
474 DWORD index;
475#ifdef __REACTOS__
476 if (GetCurrentObject( dev->hdc, OBJ_BRUSH ) != GetStockObject( DC_BRUSH )) return color;
477#else
478 if (dc->hBrush != GetStockObject( DC_BRUSH )) return color;
479#endif
480 if (physDev->dc_brush) DeleteObject( physDev->dc_brush );
481 if (!(physDev->dc_brush = CreateSolidBrush( color ))) return CLR_INVALID;
482 if (!(index = EMFDRV_CreateBrushIndirect(dev, physDev->dc_brush ))) return CLR_INVALID;
483 GDI_hdc_using_object( physDev->dc_brush, dev->hdc );
485 emr.emr.nSize = sizeof(emr);
486 emr.ihObject = index;
487 return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
488}
pKey DeleteObject()
#define OBJ_BRUSH
Definition: objidl.idl:1410
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)

◆ EMFDRV_SetDCPenColor()

COLORREF EMFDRV_SetDCPenColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 493 of file objects.c.

494{
495 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
496#ifndef __REACTOS__
497 DC *dc = get_physdev_dc( dev );
498#endif
499 EMRSELECTOBJECT emr;
500 DWORD index;
501 LOGPEN logpen = { PS_SOLID, { 0, 0 }, color };
502#ifdef __REACTOS__
503 if (GetCurrentObject( dev->hdc, OBJ_PEN ) != GetStockObject( DC_PEN )) return color;
504#else
505 if (dc->hPen != GetStockObject( DC_PEN )) return color;
506#endif
507 if (physDev->dc_pen) DeleteObject( physDev->dc_pen );
508 if (!(physDev->dc_pen = CreatePenIndirect( &logpen ))) return CLR_INVALID;
509 if (!(index = EMFDRV_CreatePenIndirect(dev, physDev->dc_pen))) return CLR_INVALID;
510 GDI_hdc_using_object( physDev->dc_pen, dev->hdc );
512 emr.emr.nSize = sizeof(emr);
513 emr.ihObject = index;
514 return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
515}
#define OBJ_PEN
Definition: objidl.idl:1409
HPEN WINAPI CreatePenIndirect(_In_ const LOGPEN *)
#define PS_SOLID
Definition: wingdi.h:586

◆ EMFDRV_SetDIBitsToDevice()

INT EMFDRV_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 233 of file bitblt.c.

236{
238 DWORD bmiSize = get_dib_info_size(info, wUsage);
239 DWORD size = sizeof(EMRSETDIBITSTODEVICE) + bmiSize + info->bmiHeader.biSizeImage;
240
241 pEMR = HeapAlloc(GetProcessHeap(), 0, size);
242 if (!pEMR) return 0;
243
245 pEMR->emr.nSize = size;
246 pEMR->rclBounds.left = xDst;
247 pEMR->rclBounds.top = yDst;
248 pEMR->rclBounds.right = xDst + width - 1;
249 pEMR->rclBounds.bottom = yDst + height - 1;
250 pEMR->xDest = xDst;
251 pEMR->yDest = yDst;
252 pEMR->xSrc = xSrc;
253 pEMR->ySrc = ySrc;
254 pEMR->cxSrc = width;
255 pEMR->cySrc = height;
256 pEMR->offBmiSrc = sizeof(EMRSETDIBITSTODEVICE);
257 pEMR->cbBmiSrc = bmiSize;
258 pEMR->offBitsSrc = sizeof(EMRSETDIBITSTODEVICE) + bmiSize;
259 pEMR->cbBitsSrc = info->bmiHeader.biSizeImage;
260 pEMR->iUsageSrc = wUsage;
261 pEMR->iStartScan = startscan;
262 pEMR->cScans = lines;
263 memcpy((BYTE*)pEMR + pEMR->offBmiSrc, info, bmiSize);
264 memcpy((BYTE*)pEMR + pEMR->offBitsSrc, bits, info->bmiHeader.biSizeImage);
265
266 if (EMFDRV_WriteRecord(dev, (EMR*)pEMR))
267 EMFDRV_UpdateBBox(dev, &(pEMR->rclBounds));
268
269 HeapFree( GetProcessHeap(), 0, pEMR);
270 return lines;
271}
eMaj lines
Definition: tritemp.h:206
struct tagEMRSETDIBITSTODEVICE EMRSETDIBITSTODEVICE
#define EMR_SETDIBITSTODEVICE
Definition: wingdi.h:153

◆ EMFDRV_SetLayout()

DWORD EMFDRV_SetLayout ( PHYSDEV  dev,
DWORD  layout 
)

Definition at line 335 of file dc.c.

336{
337 EMRSETLAYOUT emr;
338
339 emr.emr.iType = EMR_SETLAYOUT;
340 emr.emr.nSize = sizeof(emr);
341 emr.iMode = layout;
342 return EMFDRV_WriteRecord( dev, &emr.emr ) ? layout : GDI_ERROR;
343}
static DWORD layout
Definition: bitmap.c:46
#define GDI_ERROR
Definition: wingdi.h:1309

◆ EMFDRV_SetMapMode()

INT EMFDRV_SetMapMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 235 of file dc.c.

236{
237 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
238 EMRSETMAPMODE emr;
240 emr.emr.nSize = sizeof(emr);
241 emr.iMode = mode;
242
243 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return 0;
244 return next->funcs->pSetMapMode( next, mode );
245}
#define EMR_SETMAPMODE
Definition: wingdi.h:91

◆ EMFDRV_SetMapperFlags()

DWORD EMFDRV_SetMapperFlags ( PHYSDEV  dev,
DWORD  flags 
)

Definition at line 406 of file dc.c.

407{
409
411 emr.emr.nSize = sizeof(emr);
412 emr.dwFlags = flags;
413
414 return EMFDRV_WriteRecord( dev, &emr.emr ) ? flags : GDI_ERROR;
415}
#define EMR_SETMAPPERFLAGS
Definition: wingdi.h:90

◆ EMFDRV_SetPixel()

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

Definition at line 526 of file graphics.c.

527{
528 EMRSETPIXELV emr;
529
530 emr.emr.iType = EMR_SETPIXELV;
531 emr.emr.nSize = sizeof(emr);
532 emr.ptlPixel.x = x;
533 emr.ptlPixel.y = y;
534 emr.crColor = color;
535
536 if (EMFDRV_WriteRecord( dev, &emr.emr )) {
537 RECTL bounds;
538 bounds.left = bounds.right = x;
539 bounds.top = bounds.bottom = y;
540 EMFDRV_UpdateBBox( dev, &bounds );
541 return color;
542 }
543 return -1;
544}
POINTL ptlPixel
Definition: wingdi.h:2221
COLORREF crColor
Definition: wingdi.h:2222
#define EMR_SETPIXELV
Definition: wingdi.h:89

◆ EMFDRV_SetPolyFillMode()

INT EMFDRV_SetPolyFillMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 136 of file dc.c.

137{
140 emr.emr.nSize = sizeof(emr);
141 emr.iMode = mode;
142 return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
143}
#define EMR_SETPOLYFILLMODE
Definition: wingdi.h:93

◆ EMFDRV_SetROP2()

INT EMFDRV_SetROP2 ( PHYSDEV  dev,
INT  rop 
)

Definition at line 127 of file dc.c.

128{
129 EMRSETROP2 emr;
130 emr.emr.iType = EMR_SETROP2;
131 emr.emr.nSize = sizeof(emr);
132 emr.iMode = rop;
133 return EMFDRV_WriteRecord( dev, &emr.emr ) ? rop : 0;
134}
#define EMR_SETROP2
Definition: wingdi.h:94

◆ EMFDRV_SetStretchBltMode()

INT EMFDRV_SetStretchBltMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 145 of file dc.c.

146{
149 emr.emr.nSize = sizeof(emr);
150 emr.iMode = mode;
151 return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
152}
#define EMR_SETSTRETCHBLTMODE
Definition: wingdi.h:95

◆ EMFDRV_SetTextAlign()

UINT EMFDRV_SetTextAlign ( PHYSDEV  dev,
UINT  align 
)

Definition at line 72 of file dc.c.

73{
76 emr.emr.nSize = sizeof(emr);
77 emr.iMode = align;
78 return EMFDRV_WriteRecord( dev, &emr.emr ) ? align : GDI_ERROR;
79}
int align(int length, int align)
Definition: dsound8.c:36
#define EMR_SETTEXTALIGN
Definition: wingdi.h:96

◆ EMFDRV_SetTextColor()

COLORREF EMFDRV_SetTextColor ( PHYSDEV  dev,
COLORREF  color 
)

Definition at line 114 of file dc.c.

115{
116 EMRSETTEXTCOLOR emr;
117 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
118
119 if (physDev->restoring) return color; /* don't output records during RestoreDC */
120
122 emr.emr.nSize = sizeof(emr);
123 emr.crColor = color;
124 return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
125}
#define EMR_SETTEXTCOLOR
Definition: wingdi.h:98

◆ EMFDRV_SetTextJustification()

BOOL EMFDRV_SetTextJustification ( PHYSDEV  dev,
INT  nBreakExtra,
INT  nBreakCount 
)

Definition at line 81 of file dc.c.

82{
84 emr.emr.iType = EMR_SETTEXTJUSTIFICATION;
85 emr.emr.nSize = sizeof(emr);
86 emr.nBreakExtra = nBreakExtra;
87 emr.nBreakCount = nBreakCount;
88 return EMFDRV_WriteRecord(dev, &emr.emr);
89}

◆ EMFDRV_SetViewportExtEx()

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

Definition at line 247 of file dc.c.

248{
249 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportExtEx );
251
253 emr.emr.nSize = sizeof(emr);
254 emr.szlExtent.cx = cx;
255 emr.szlExtent.cy = cy;
256
257 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
258 return next->funcs->pSetViewportExtEx( next, cx, cy, size );
259}
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define EMR_SETVIEWPORTEXTEX
Definition: wingdi.h:85

◆ EMFDRV_SetViewportOrgEx()

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

Definition at line 275 of file dc.c.

276{
277 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportOrgEx );
279
281 emr.emr.nSize = sizeof(emr);
282 emr.ptlOrigin.x = x;
283 emr.ptlOrigin.y = y;
284
285 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
286 return next->funcs->pSetViewportOrgEx( next, x, y, pt );
287}

◆ EMFDRV_SetWindowExtEx()

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

Definition at line 261 of file dc.c.

262{
263 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowExtEx );
265
267 emr.emr.nSize = sizeof(emr);
268 emr.szlExtent.cx = cx;
269 emr.szlExtent.cy = cy;
270
271 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
272 return next->funcs->pSetWindowExtEx( next, cx, cy, size );
273}
#define EMR_SETWINDOWEXTEX
Definition: wingdi.h:83

◆ EMFDRV_SetWindowOrgEx()

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

Definition at line 289 of file dc.c.

290{
291 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowOrgEx );
293
295 emr.emr.nSize = sizeof(emr);
296 emr.ptlOrigin.x = x;
297 emr.ptlOrigin.y = y;
298
299 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
300 return next->funcs->pSetWindowOrgEx( next, x, y, pt );
301}

◆ EMFDRV_SetWorldTransform()

BOOL EMFDRV_SetWorldTransform ( PHYSDEV  dev,
const XFORM xform 
)

Definition at line 345 of file dc.c.

346{
347 PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWorldTransform );
349
351 emr.emr.nSize = sizeof(emr);
352 emr.xform = *xform;
353
354 if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
355 return next->funcs->pSetWorldTransform( next, xform );
356}
#define EMR_SETWORLDTRANSFORM
Definition: wingdi.h:109

◆ EMFDRV_StretchBlt()

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

Definition at line 67 of file bitblt.c.

69{
70 BOOL ret;
71 PEMRBITBLT pEMR;
72 UINT emrSize;
73 UINT bmiSize;
74 UINT bitsSize;
75 UINT size;
76 BITMAP BM;
77 WORD nBPP = 0;
78 LPBITMAPINFOHEADER lpBmiH;
80 DWORD emrType;
81
82 if (devSrc->funcs == devDst->funcs) return FALSE; /* can't use a metafile DC as source */
83
84 if (src->log_width == dst->log_width && src->log_height == dst->log_height)
85 {
86 emrType = EMR_BITBLT;
87 emrSize = sizeof(EMRBITBLT);
88 }
89 else
90 {
91 emrType = EMR_STRETCHBLT;
92 emrSize = sizeof(EMRSTRETCHBLT);
93 }
94
96
97 if(sizeof(BITMAP) != GetObjectW(hBitmap, sizeof(BITMAP), &BM))
98 return FALSE;
99
100 nBPP = BM.bmPlanes * BM.bmBitsPixel;
101 if(nBPP > 8) nBPP = 24; /* FIXME Can't get 16bpp to work for some reason */
102 bitsSize = get_dib_stride( BM.bmWidth, nBPP ) * BM.bmHeight;
103 bmiSize = sizeof(BITMAPINFOHEADER) +
104 (nBPP <= 8 ? 1 << nBPP : 0) * sizeof(RGBQUAD);
105
106 size = emrSize + bmiSize + bitsSize;
107
108 pEMR = HeapAlloc(GetProcessHeap(), 0, size);
109 if (!pEMR) return FALSE;
110
111 /* Initialize EMR */
112 pEMR->emr.iType = emrType;
113 pEMR->emr.nSize = size;
114 pEMR->rclBounds.left = dst->log_x;
115 pEMR->rclBounds.top = dst->log_y;
116 pEMR->rclBounds.right = dst->log_x + dst->log_width - 1;
117 pEMR->rclBounds.bottom = dst->log_y + dst->log_height - 1;
118 pEMR->xDest = dst->log_x;
119 pEMR->yDest = dst->log_y;
120 pEMR->cxDest = dst->log_width;
121 pEMR->cyDest = dst->log_height;
122 pEMR->dwRop = rop;
123 pEMR->xSrc = src->log_x;
124 pEMR->ySrc = src->log_y;
125#ifdef __REACTOS__
127#else
128 GetTransform(devSrc->hdc, 0x204, &pEMR->xformSrc);
129#endif
130 pEMR->crBkColorSrc = GetBkColor(devSrc->hdc);
132 pEMR->offBmiSrc = emrSize;
133 pEMR->offBitsSrc = emrSize + bmiSize;
134 pEMR->cbBmiSrc = bmiSize;
135 pEMR->cbBitsSrc = bitsSize;
136 if (emrType == EMR_STRETCHBLT)
137 {
138 PEMRSTRETCHBLT pEMRStretch = (PEMRSTRETCHBLT)pEMR;
139 pEMRStretch->cxSrc = src->log_width;
140 pEMRStretch->cySrc = src->log_height;
141 }
142
143 /* Initialize BITMAPINFO structure */
144 lpBmiH = (LPBITMAPINFOHEADER)((BYTE*)pEMR + pEMR->offBmiSrc);
145
146 lpBmiH->biSize = sizeof(BITMAPINFOHEADER);
147 lpBmiH->biWidth = BM.bmWidth;
148 lpBmiH->biHeight = BM.bmHeight;
149 lpBmiH->biPlanes = BM.bmPlanes;
150 lpBmiH->biBitCount = nBPP;
151 /* Assume the bitmap isn't compressed and set the BI_RGB flag. */
152 lpBmiH->biCompression = BI_RGB;
153 lpBmiH->biSizeImage = bitsSize;
154 lpBmiH->biYPelsPerMeter = 0;
155 lpBmiH->biXPelsPerMeter = 0;
156 lpBmiH->biClrUsed = nBPP <= 8 ? 1 << nBPP : 0;
157 /* Set biClrImportant to 0, indicating that all of the
158 device colors are important. */
159 lpBmiH->biClrImportant = 0;
160
161 /* Initialize bitmap bits */
162 if (GetDIBits(devSrc->hdc, hBitmap, 0, (UINT)lpBmiH->biHeight,
163 (BYTE*)pEMR + pEMR->offBitsSrc,
165 {
166 ret = EMFDRV_WriteRecord(devDst, (EMR*)pEMR);
167 if (ret) EMFDRV_UpdateBBox(devDst, &(pEMR->rclBounds));
168 }
169 else
170 ret = FALSE;
171
172 HeapFree( GetProcessHeap(), 0, pEMR);
173 return ret;
174}
struct BITMAPINFOHEADER * LPBITMAPINFOHEADER
static HBITMAP hBitmap
Definition: timezone.c:26
static int get_dib_stride(int width, int bpp)
Definition: imagelist.c:198
#define BI_RGB
Definition: precomp.h:56
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL APIENTRY NtGdiGetTransform(_In_ HDC hdc, _In_ DWORD iXform, _Out_ LPXFORM pxf)
#define GdiWorldSpaceToDeviceSpace
Definition: gdi_private.h:221
GLenum src
Definition: glext.h:6340
static HBITMAP
Definition: button.c:44
#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 EMR_STRETCHBLT
Definition: wingdi.h:150
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
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)
BOOL WINAPI GetTransform(HDC, DWORD, XFORM *)
struct tagEMRBITBLT EMRBITBLT
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:978
struct tagEMRSTRETCHBLT * PEMRSTRETCHBLT
struct tagEMRSTRETCHBLT EMRSTRETCHBLT

◆ EMFDRV_StretchDIBits()

INT EMFDRV_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 176 of file bitblt.c.

179{
180 EMRSTRETCHDIBITS *emr;
181 BOOL ret;
182 UINT bmi_size, emr_size;
183
184 /* calculate the size of the colour table */
185 bmi_size = get_dib_info_size(info, wUsage);
186
187 emr_size = sizeof (EMRSTRETCHDIBITS) + bmi_size + info->bmiHeader.biSizeImage;
188 emr = HeapAlloc(GetProcessHeap(), 0, emr_size );
189 if (!emr) return 0;
190
191 /* write a bitmap info header (with colours) to the record */
192 memcpy( &emr[1], info, bmi_size);
193
194 /* write bitmap bits to the record */
195 memcpy ( ( (BYTE *) (&emr[1]) ) + bmi_size, bits, info->bmiHeader.biSizeImage);
196
197 /* fill in the EMR header at the front of our piece of memory */
199 emr->emr.nSize = emr_size;
200
201 emr->xDest = xDst;
202 emr->yDest = yDst;
203 emr->cxDest = widthDst;
204 emr->cyDest = heightDst;
205 emr->dwRop = dwRop;
206 emr->xSrc = xSrc; /* FIXME: only save the piece of the bitmap needed */
207 emr->ySrc = ySrc;
208
209 emr->iUsageSrc = wUsage;
210 emr->offBmiSrc = sizeof (EMRSTRETCHDIBITS);
211 emr->cbBmiSrc = bmi_size;
212 emr->offBitsSrc = emr->offBmiSrc + bmi_size;
213 emr->cbBitsSrc = info->bmiHeader.biSizeImage;
214
215 emr->cxSrc = widthSrc;
216 emr->cySrc = heightSrc;
217
218 emr->rclBounds.left = xDst;
219 emr->rclBounds.top = yDst;
220 emr->rclBounds.right = xDst + widthDst;
221 emr->rclBounds.bottom = yDst + heightDst;
222
223 /* save the record we just created */
224 ret = EMFDRV_WriteRecord( dev, &emr->emr );
225 if(ret)
227
228 HeapFree(GetProcessHeap(), 0, emr);
229
230 return ret ? heightSrc : GDI_ERROR;
231}
#define EMR_STRETCHDIBITS
Definition: wingdi.h:154
struct tagEMRSTRETCHDIBITS EMRSTRETCHDIBITS

◆ EMFDRV_StrokeAndFillPath()

BOOL EMFDRV_StrokeAndFillPath ( PHYSDEV  dev)

Definition at line 1095 of file graphics.c.

1096{
1098}
#define EMR_STROKEANDFILLPATH
Definition: wingdi.h:137

◆ EMFDRV_StrokePath()

BOOL EMFDRV_StrokePath ( PHYSDEV  dev)

Definition at line 1103 of file graphics.c.

1104{
1106}
#define EMR_STROKEPATH
Definition: wingdi.h:138

◆ EMFDRV_UpdateBBox()

void EMFDRV_UpdateBBox ( PHYSDEV  dev,
RECTL rect 
)

Definition at line 231 of file init.c.

232{
233 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
234 RECTL *bounds = &physDev->emh->rclBounds;
235 RECTL vportRect = *rect;
236
237 LPtoDP( dev->hdc, (LPPOINT)&vportRect, 2 );
238
239 /* The coordinate systems may be mirrored
240 (LPtoDP handles points, not rectangles) */
241 if (vportRect.left > vportRect.right)
242 {
243 LONG temp = vportRect.right;
244 vportRect.right = vportRect.left;
245 vportRect.left = temp;
246 }
247 if (vportRect.top > vportRect.bottom)
248 {
249 LONG temp = vportRect.bottom;
250 vportRect.bottom = vportRect.top;
251 vportRect.top = temp;
252 }
253
254 if (bounds->left > bounds->right)
255 {
256 /* first bounding rectangle */
257 *bounds = vportRect;
258 }
259 else
260 {
261 bounds->left = min(bounds->left, vportRect.left);
262 bounds->top = min(bounds->top, vportRect.top);
263 bounds->right = max(bounds->right, vportRect.right);
264 bounds->bottom = max(bounds->bottom, vportRect.bottom);
265 }
266}
long LONG
Definition: pedump.c:60
& rect
Definition: startmenu.cpp:1413
ENHMETAHEADER * emh
RECTL rclBounds
Definition: wingdi.h:2322
BOOL WINAPI LPtoDP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)

Referenced by EMFDRV_ArcChordPie(), EMFDRV_Ellipse(), EMFDRV_ExtTextOut(), EMFDRV_FillRgn(), EMFDRV_FrameRgn(), EMFDRV_GradientFill(), EMFDRV_LineTo(), EMFDRV_PaintInvertRgn(), EMFDRV_PatBlt(), EMFDRV_PolyDraw(), EMFDRV_Polylinegon(), EMFDRV_PolyPolylinegon(), EMFDRV_Rectangle(), EMFDRV_RoundRect(), EMFDRV_SetDIBitsToDevice(), EMFDRV_SetPixel(), EMFDRV_StretchBlt(), EMFDRV_StretchDIBits(), and emfdrv_stroke_and_fill_path().

◆ EMFDRV_WidenPath()

BOOL EMFDRV_WidenPath ( PHYSDEV  dev)

Definition at line 500 of file dc.c.

501{
502 EMRWIDENPATH emr;
503
504 emr.emr.iType = EMR_WIDENPATH;
505 emr.emr.nSize = sizeof(emr);
506
507 return EMFDRV_WriteRecord( dev, &emr.emr );
508}
#define EMR_WIDENPATH
Definition: wingdi.h:140

◆ EMFDRV_WriteRecord()

BOOL EMFDRV_WriteRecord ( PHYSDEV  dev,
EMR emr 
)

Definition at line 194 of file init.c.

195{
196 DWORD len;
197 DWORD bytes_written;
198 ENHMETAHEADER *emh;
199 EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
200
201 TRACE("record %d, size %d %s\n",
202 emr->iType, emr->nSize, physDev->hFile ? "(to disk)" : "");
203
204 assert( !(emr->nSize & 3) );
205
206 physDev->emh->nBytes += emr->nSize;
207 physDev->emh->nRecords++;
208
209 if(physDev->hFile) {
210 if (!WriteFile(physDev->hFile, emr, emr->nSize, &bytes_written, NULL))
211 return FALSE;
212 } else {
213 DWORD nEmfSize = HeapSize(GetProcessHeap(), 0, physDev->emh);
214 len = physDev->emh->nBytes;
215 if (len > nEmfSize) {
216 nEmfSize += (nEmfSize / 2) + emr->nSize;
217 emh = HeapReAlloc(GetProcessHeap(), 0, physDev->emh, nEmfSize);
218 if (!emh) return FALSE;
219 physDev->emh = emh;
220 }
221 memcpy((CHAR *)physDev->emh + physDev->emh->nBytes - emr->nSize, emr,
222 emr->nSize);
223 }
224 return TRUE;
225}
#define HeapReAlloc
Definition: compat.h:734
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 assert(x)
Definition: debug.h:53
GLenum GLsizei len
Definition: glext.h:6722
DWORD nRecords
Definition: wingdi.h:2327
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
char CHAR
Definition: xmlstorage.h:175

Referenced by CloseEnhMetaFile(), EMFDRV_AbortPath(), EMFDRV_AngleArc(), EMFDRV_ArcChordPie(), EMFDRV_BeginPath(), EMFDRV_CloseFigure(), EMFDRV_CreateBrushIndirect(), EMFDRV_CreateFontIndirect(), EMFDRV_CreatePalette(), EMFDRV_CreatePenIndirect(), EMFDRV_DeleteObject(), EMFDRV_Ellipse(), EMFDRV_EndPath(), EMFDRV_ExcludeClipRect(), EMFDRV_ExtFloodFill(), EMFDRV_ExtSelectClipRgn(), EMFDRV_ExtTextOut(), EMFDRV_FillRgn(), EMFDRV_FlattenPath(), EMFDRV_FrameRgn(), EMFDRV_GdiComment(), EMFDRV_GradientFill(), EMFDRV_IntersectClipRect(), EMFDRV_LineTo(), EMFDRV_ModifyWorldTransform(), EMFDRV_MoveTo(), EMFDRV_OffsetClipRgn(), EMFDRV_OffsetViewportOrgEx(), EMFDRV_OffsetWindowOrgEx(), EMFDRV_PaintInvertRgn(), EMFDRV_PatBlt(), EMFDRV_PolyDraw(), EMFDRV_Polylinegon(), EMFDRV_PolyPolylinegon(), EMFDRV_Rectangle(), EMFDRV_RestoreDC(), EMFDRV_RoundRect(), EMFDRV_SaveDC(), EMFDRV_ScaleViewportExtEx(), EMFDRV_ScaleWindowExtEx(), EMFDRV_SelectBrush(), EMFDRV_SelectClipPath(), EMFDRV_SelectFont(), EMFDRV_SelectPalette(), EMFDRV_SelectPen(), EMFDRV_SetArcDirection(), EMFDRV_SetBkColor(), EMFDRV_SetBkMode(), EMFDRV_SetDCBrushColor(), EMFDRV_SetDCPenColor(), EMFDRV_SetDIBitsToDevice(), EMFDRV_SetLayout(), EMFDRV_SetMapMode(), EMFDRV_SetMapperFlags(), EMFDRV_SetPixel(), EMFDRV_SetPolyFillMode(), EMFDRV_SetROP2(), EMFDRV_SetStretchBltMode(), EMFDRV_SetTextAlign(), EMFDRV_SetTextColor(), EMFDRV_SetTextJustification(), EMFDRV_SetViewportExtEx(), EMFDRV_SetViewportOrgEx(), EMFDRV_SetWindowExtEx(), EMFDRV_SetWindowOrgEx(), EMFDRV_SetWorldTransform(), EMFDRV_StretchBlt(), EMFDRV_StretchDIBits(), emfdrv_stroke_and_fill_path(), and EMFDRV_WidenPath().

◆ get_emf_physdev()