ReactOS  0.4.13-dev-1148-g9b75b67
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:193
#define EMR_ABORTPATH
Definition: wingdi.h:142
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
POINTL ptlCenter
Definition: wingdi.h:1704
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
FLOAT eSweepAngle
Definition: wingdi.h:1707
LONG y
Definition: windef.h:315
DWORD nRadius
Definition: wingdi.h:1705
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
#define EMR_ANGLEARC
Definition: wingdi.h:115
DWORD iType
Definition: wingdi.h:1685
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
FLOAT eStartAngle
Definition: wingdi.h:1706

◆ 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 }
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
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define EMR_ARC
Definition: wingdi.h:119
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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
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
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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 push_dc_driver
Definition: gdi_private.h:200
#define TRUE
Definition: types.h:120
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
HDC dc
Definition: cylfrac.c:34
static const struct gdi_dc_funcs emfpath_driver
Definition: dc.c:31
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
Definition: polytest.cpp:40
struct gdi_physdev pathdev
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
#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 }
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
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define EMR_CHORD
Definition: wingdi.h:120
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ EMFDRV_CloseFigure()

BOOL EMFDRV_CloseFigure ( PHYSDEV  dev)

Definition at line 446 of file dc.c.

447 {
448  EMRCLOSEFIGURE emr;
449 
450  emr.emr.iType = EMR_CLOSEFIGURE;
451  emr.emr.nSize = sizeof(emr);
452 
453  EMFDRV_WriteRecord( dev, &emr.emr );
454  return FALSE; /* always fails without a path */
455 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
#define EMR_CLOSEFIGURE
Definition: wingdi.h:135
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define BS_DIBPATTERN
Definition: wingdi.h:1091
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
ULONG lbHatch
Definition: wingdi.h:1750
UINT lbStyle
Definition: wingdi.h:1742
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
static UINT EMFDRV_AddHandle(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:35
ULONG_PTR lbHatch
Definition: wingdi.h:1744
GLuint buffer
Definition: glext.h:5915
BOOL get_brush_bitmap_info(HBRUSH handle, BITMAPINFO *info, void **bits, UINT *usage) DECLSPEC_HIDDEN
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define BS_NULL
Definition: wingdi.h:1086
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
COLORREF lbColor
Definition: wingdi.h:1749
#define EMR_CREATEDIBPATTERNBRUSHPT
Definition: wingdi.h:167
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
COLORREF lbColor
Definition: wingdi.h:1743
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EMR_CREATEBRUSHINDIRECT
Definition: wingdi.h:113
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
UINT lbStyle
Definition: wingdi.h:1748
DWORD iType
Definition: wingdi.h:1685
struct tagEMRCREATEDIBPATTERNBRUSHPT EMRCREATEDIBPATTERNBRUSHPT
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int UINT
Definition: ndis.h:50
#define DIB_PAL_MONO
Definition: gdi_private.h:164
#define BS_PATTERN
Definition: wingdi.h:1089
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:180
#define BS_HATCHED
Definition: wingdi.h:1088
#define BS_SOLID
Definition: wingdi.h:1085
#define HeapFree(x, y, z)
Definition: compat.h:394
#define EMR_CREATEMONOBRUSH
Definition: wingdi.h:166
struct tagBITMAPINFO BITMAPINFO

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 {
79  EMRDELETEOBJECT emr;
80  EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
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 }
#define TRUE
Definition: types.h:120
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint index
Definition: glext.h:6031
int ret
DWORD nSize
Definition: wingdi.h:1686
#define EMR_DELETEOBJECT
Definition: wingdi.h:114
#define index(s, c)
Definition: various.h:29
DWORD iType
Definition: wingdi.h:1685
unsigned int UINT
Definition: ndis.h:50
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
HGDIOBJ * handles

Referenced by DeleteObject().

◆ 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)
440  EMFDRV_UpdateBBox( dev, &emr.rclBox );
441  return EMFDRV_WriteRecord( dev, &emr.emr );
442 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
long bottom
Definition: polytest.cpp:53
HDC dc
Definition: cylfrac.c:34
int32_t INT
Definition: typedefs.h:56
long right
Definition: polytest.cpp:53
RECTL rclBox
Definition: wingdi.h:1851
long top
Definition: polytest.cpp:53
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
int WINAPI GetGraphicsMode(_In_ HDC)
#define EMR_ELLIPSE
Definition: wingdi.h:116
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define GM_COMPATIBLE
Definition: wingdi.h:863
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static calc_node_t temp
Definition: rpn_ieee.c:38
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define EMR_ENDPATH
Definition: wingdi.h:134
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 );
167  EMREXCLUDECLIPRECT emr;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define ERROR(name)
Definition: error_private.h:53
#define EMR_EXCLUDECLIPRECT
Definition: wingdi.h:103
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
long top
Definition: polytest.cpp:53
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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 
751  emr.emr.iType = EMR_EXTFLOODFILL;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
GLuint color
Definition: glext.h:6243
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
#define EMR_EXTFLOODFILL
Definition: wingdi.h:127
DWORD iType
Definition: wingdi.h:1685
COLORREF crColor
Definition: wingdi.h:1957
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ 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 );
210  EMREXTSELECTCLIPRGN *emr;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define ERROR(name)
Definition: error_private.h:53
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD nSize
Definition: wingdi.h:1686
static HRGN hrgn
Definition: win.c:55
GLenum mode
Definition: glext.h:6217
#define RGN_COPY
Definition: wingdi.h:356
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define EMR_EXTSELECTCLIPRGN
Definition: wingdi.h:148

◆ 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: {
1003  TEXTMETRICW tm;
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 
1024 no_bounds:
1025  ret = EMFDRV_WriteRecord( dev, &pemr->emr );
1026  HeapFree( GetProcessHeap(), 0, pemr );
1027  return ret;
1028 }
#define max(a, b)
Definition: svc.c:63
#define HORZRES
Definition: wingdi.h:715
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define FLOAT
Definition: i386-dis.c:516
GLuint GLuint GLsizei count
Definition: gl.h:1545
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2024
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC dc
Definition: cylfrac.c:34
#define TA_LEFT
Definition: wingdi.h:931
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:808
#define TA_TOP
Definition: wingdi.h:929
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TA_BASELINE
Definition: wingdi.h:927
const WCHAR * str
#define TA_BOTTOM
Definition: wingdi.h:928
LONG cx
Definition: windef.h:319
#define EMR_EXTTEXTOUTW
Definition: wingdi.h:157
#define TA_RIGHT
Definition: wingdi.h:932
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI GetViewportExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:351
__wchar_t WCHAR
Definition: xmlstorage.h:180
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
int WINAPI GetGraphicsMode(_In_ HDC)
BOOL WINAPI GetWindowExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:411
const char * wine_dbgstr_rect(const RECT *rect)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define GM_COMPATIBLE
Definition: wingdi.h:863
int ret
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: time.h:76
#define debugstr_wn
Definition: kernel32.h:33
#define HORZSIZE
Definition: wingdi.h:713
#define VERTSIZE
Definition: wingdi.h:714
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
unsigned int UINT
Definition: ndis.h:50
#define VERTRES
Definition: wingdi.h:716
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
float FLOAT
Definition: typedefs.h:67
LONG bottom
Definition: windef.h:294
#define TA_CENTER
Definition: wingdi.h:930
LONG cy
Definition: windef.h:320
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)

◆ 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)
791  EMFDRV_UpdateBBox( dev, &emr->rclBounds );
792  HeapFree( GetProcessHeap(), 0, emr );
793  return ret;
794 }
static HBRUSH hbrush
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD ihBrush
Definition: wingdi.h:1990
long bottom
Definition: polytest.cpp:53
BYTE RgnData[1]
Definition: wingdi.h:1991
long right
Definition: polytest.cpp:53
DWORD cbRgnData
Definition: wingdi.h:1989
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
GLuint index
Definition: glext.h:6031
long left
Definition: polytest.cpp:53
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EMR_FILLRGN
Definition: wingdi.h:144
int ret
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
static HRGN hrgn
Definition: win.c:55
DWORD iType
Definition: wingdi.h:1685
RECTL rclBounds
Definition: wingdi.h:1988
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
Definition: objects.c:111
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ EMFDRV_FlattenPath()

BOOL EMFDRV_FlattenPath ( PHYSDEV  dev)

Definition at line 468 of file dc.c.

469 {
470  EMRFLATTENPATH emr;
471 
472  emr.emr.iType = EMR_FLATTENPATH;
473  emr.emr.nSize = sizeof(emr);
474 
475  return EMFDRV_WriteRecord( dev, &emr.emr );
476 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
#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)
826  EMFDRV_UpdateBBox( dev, &emr->rclBounds );
827  HeapFree( GetProcessHeap(), 0, emr );
828  return ret;
829 }
GLint GLint GLsizei width
Definition: gl.h:1546
static HBRUSH hbrush
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
DWORD ihBrush
Definition: wingdi.h:2012
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
LONG cx
Definition: windef.h:319
GLuint index
Definition: glext.h:6031
#define EMR_FRAMERGN
Definition: wingdi.h:145
long left
Definition: polytest.cpp:53
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE RgnData[1]
Definition: wingdi.h:2014
int ret
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
static HRGN hrgn
Definition: win.c:55
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
DWORD iType
Definition: wingdi.h:1685
SIZEL szlStroke
Definition: wingdi.h:2013
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush) DECLSPEC_HIDDEN
Definition: objects.c:111
DWORD cbRgnData
Definition: wingdi.h:2011
RECTL rclBounds
Definition: wingdi.h:2010
LONG cy
Definition: windef.h:320
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
BYTE Data[1]
Definition: wingdi.h:2019
GLuint buffer
Definition: glext.h:5915
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
unsigned int BOOL
Definition: ntddk_ex.h:94
#define offsetof(TYPE, MEMBER)
#define EMR_GDICOMMENT
Definition: wingdi.h:143
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
DWORD nSize
Definition: wingdi.h:1686
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
DWORD iType
Definition: wingdi.h:1685
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 }
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
GLenum cap
Definition: glext.h:9639
int WINAPI GetDeviceCaps(_In_ HDC hdc, _In_ int nIndex)
Definition: dc.c:561

◆ 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 
1078  EMFDRV_UpdateBBox( dev, &emr->rclBounds );
1079  ret = EMFDRV_WriteRecord( dev, &emr->emr );
1080  HeapFree( GetProcessHeap(), 0, emr );
1081  return ret;
1082 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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
LONG y
Definition: wingdi.h:2780
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
LONG x
Definition: wingdi.h:2779
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum mode
Definition: glext.h:6217
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define ERROR(name)
Definition: error_private.h:53
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
#define EMR_INTERSECTCLIPRECT
Definition: wingdi.h:104
long top
Definition: polytest.cpp:53
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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
static HRGN hrgn
Definition: win.c:55

◆ 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 }
BOOL WINAPI GetCurrentPositionEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:241
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define pt(x, y)
Definition: drawing.c:79
#define EMR_LINETO
Definition: wingdi.h:128
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
long bottom
Definition: polytest.cpp:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC dc
Definition: cylfrac.c:34
LONG y
Definition: windef.h:315
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
POINTL ptl
Definition: wingdi.h:2029
long left
Definition: polytest.cpp:53
Definition: polytest.cpp:40
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
#define min(a, b)
Definition: monoChain.cc:55
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
#define EMR_MODIFYWORLDTRANSFORM
Definition: wingdi.h:110
DWORD nSize
Definition: wingdi.h:1686
GLenum mode
Definition: glext.h:6217
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define EMR_MOVETOEX
Definition: wingdi.h:101
LONG y
Definition: windef.h:315
POINTL ptl
Definition: wingdi.h:2029
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ 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 );
197  EMROFFSETCLIPRGN emr;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define ERROR(name)
Definition: error_private.h:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#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
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
#define EMR_SETVIEWPORTORGEX
Definition: wingdi.h:86
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
BOOL WINAPI GetViewportOrgEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:383
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ 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 );
392  EMRSETWINDOWORGEX emr;
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 }
long y
Definition: polytest.cpp:48
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
long x
Definition: polytest.cpp:48
BOOL WINAPI GetWindowOrgEx(_In_ HDC, _Out_ LPPOINT)
Definition: coord.c:439
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#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 }
static BOOL EMFDRV_PaintInvertRgn(PHYSDEV dev, HRGN hrgn, DWORD iType)
Definition: graphics.c:836
#define EMR_PAINTRGN
Definition: wingdi.h:147
static HRGN hrgn
Definition: win.c:55

◆ 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 }
DWORD iUsageSrc
Definition: wingdi.h:1735
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD cbBitsSrc
Definition: wingdi.h:1739
long bottom
Definition: polytest.cpp:53
LONG cxDest
Definition: wingdi.h:1728
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
FLOAT eDx
Definition: wingdi.h:1720
long top
Definition: polytest.cpp:53
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
XFORM xformSrc
Definition: wingdi.h:1733
FLOAT eM21
Definition: wingdi.h:1718
FLOAT eM12
Definition: wingdi.h:1717
LONG cyDest
Definition: wingdi.h:1729
long left
Definition: polytest.cpp:53
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
#define EMR_BITBLT
Definition: wingdi.h:149
COLORREF crBkColorSrc
Definition: wingdi.h:1734
LONG xSrc
Definition: wingdi.h:1731
int ret
DWORD nSize
Definition: wingdi.h:1686
FLOAT eM11
Definition: wingdi.h:1716
LONG yDest
Definition: wingdi.h:1727
DWORD dwRop
Definition: wingdi.h:1730
RECTL rclBounds
Definition: wingdi.h:1725
DWORD offBmiSrc
Definition: wingdi.h:1736
DWORD iType
Definition: wingdi.h:1685
LONG ySrc
Definition: wingdi.h:1732
GLenum GLenum dst
Definition: glext.h:6340
FLOAT eM22
Definition: wingdi.h:1719
FLOAT eDy
Definition: wingdi.h:1721
LONG xDest
Definition: wingdi.h:1726
DWORD offBitsSrc
Definition: wingdi.h:1738
DWORD cbBmiSrc
Definition: wingdi.h:1737

◆ 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 }
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
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define EMR_PIE
Definition: wingdi.h:121
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ EMFDRV_PolyBezier()

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

Definition at line 617 of file graphics.c.

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

◆ EMFDRV_PolyBezierTo()

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

Definition at line 625 of file graphics.c.

626 {
627  return EMFDRV_Polylinegon( dev, pts, count, EMR_POLYBEZIERTO );
628 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
Definition: graphics.c:552
#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 const RECTL empty_bounds
Definition: graphics.c:36
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
GLuint GLuint GLsizei count
Definition: gl.h:1545
POINTL aptl[1]
Definition: wingdi.h:2092
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
static BOOL can_use_short_points(const POINT *pts, UINT count)
Definition: graphics.c:39
#define EMR_POLYDRAW
Definition: wingdi.h:130
static void * store_points(POINTL *dest, const POINT *pts, UINT count, BOOL short_points)
Definition: graphics.c:50
unsigned int BOOL
Definition: ntddk_ex.h:94
static struct list apts
Definition: compobj.c:81
#define offsetof(TYPE, MEMBER)
RECTL rclBounds
Definition: wingdi.h:2090
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
Definition: cmds.c:130
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD nSize
Definition: wingdi.h:1686
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
DWORD cptl
Definition: wingdi.h:2091
DWORD iType
Definition: wingdi.h:1685
#define EMR_POLYDRAW16
Definition: wingdi.h:165
static void get_points_bounds(RECTL *bounds, const POINT *pts, UINT count, DC *dc)
Definition: graphics.c:75
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define EMR_POLYGON
Definition: wingdi.h:77
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
Definition: graphics.c:552

◆ 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
#define pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
Definition: graphics.c:552

◆ EMFDRV_PolylineTo()

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

Definition at line 600 of file graphics.c.

601 {
603 }
#define pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define EMR_POLYLINETO
Definition: wingdi.h:80
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
Definition: graphics.c:552

◆ 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 }
#define pt(x, y)
Definition: drawing.c:79
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 pt(x, y)
Definition: drawing.c:79
int32_t INT
Definition: typedefs.h:56
#define EMR_POLYPOLYLINE
Definition: wingdi.h:81
static BOOL EMFDRV_PolyPolylinegon(PHYSDEV dev, const POINT *pt, const INT *counts, UINT polys, DWORD iType)
Definition: graphics.c:637

◆ 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)
479  EMFDRV_UpdateBBox( dev, &emr.rclBox );
480  return EMFDRV_WriteRecord( dev, &emr.emr );
481 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
long bottom
Definition: polytest.cpp:53
HDC dc
Definition: cylfrac.c:34
int32_t INT
Definition: typedefs.h:56
long right
Definition: polytest.cpp:53
RECTL rclBox
Definition: wingdi.h:1851
long top
Definition: polytest.cpp:53
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
#define EMR_RECTANGLE
Definition: wingdi.h:117
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
int WINAPI GetGraphicsMode(_In_ HDC)
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define GM_COMPATIBLE
Definition: wingdi.h:863
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static calc_node_t temp
Definition: rpn_ieee.c:38
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ 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 );
51  EMFDRV_PDEVICE* physDev = get_emf_physdev( dev );
52  DC *dc = get_physdev_dc( dev );
53  EMRRESTOREDC emr;
54  BOOL ret;
55 
56  emr.emr.iType = EMR_RESTOREDC;
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
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
HDC dc
Definition: cylfrac.c:34
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EMR_RESTOREDC
Definition: wingdi.h:108
Definition: polytest.cpp:40
int ret
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
LONG iRelative
Definition: wingdi.h:2146

◆ 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)
519  EMFDRV_UpdateBBox( dev, &emr.rclBox );
520  return EMFDRV_WriteRecord( dev, &emr.emr );
521 }
#define EMR_ROUNDRECT
Definition: wingdi.h:118
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
long bottom
Definition: polytest.cpp:53
HDC dc
Definition: cylfrac.c:34
int32_t INT
Definition: typedefs.h:56
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
LONG cx
Definition: windef.h:319
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
Definition: polytest.cpp:40
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
int WINAPI GetGraphicsMode(_In_ HDC)
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define GM_COMPATIBLE
Definition: wingdi.h:863
DWORD nSize
Definition: wingdi.h:1686
RECTL rclBox
Definition: wingdi.h:2150
DWORD iType
Definition: wingdi.h:1685
static calc_node_t temp
Definition: rpn_ieee.c:38
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
LONG cy
Definition: windef.h:320
SIZEL szlCorner
Definition: wingdi.h:2151

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
int32_t INT
Definition: typedefs.h:56
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
int ret
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
#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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
GLsizeiptr size
Definition: glext.h:5919
DWORD nSize
Definition: wingdi.h:1686
#define EMR_SCALEVIEWPORTEXTEX
Definition: wingdi.h:105
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
GLsizeiptr size
Definition: glext.h:5919
#define EMR_SCALEWINDOWEXTEX
Definition: wingdi.h:106
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6

◆ 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:
234  emr.emr.iType = EMR_SELECTOBJECT;
235  emr.emr.nSize = sizeof(emr);
236  emr.ihObject = index;
237  return EMFDRV_WriteRecord( dev, &emr.emr ) ? hBrush : 0;
238 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define WHITE_BRUSH
Definition: wingdi.h:901
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
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
GLuint index
Definition: glext.h:6031
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush)
Definition: objects.c:111
DWORD iType
Definition: wingdi.h:1685
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415

◆ 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
481  EMRSELECTCLIPPATH emr;
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 }
#define TRUE
Definition: types.h:120
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
_In_ ULONG iMode
Definition: winddi.h:3520
#define EMR_SELECTCLIPPATH
Definition: wingdi.h:141
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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:
315  emr.emr.iType = EMR_SELECTOBJECT;
316  emr.emr.nSize = sizeof(emr);
317  emr.ihObject = index;
318  if(!EMFDRV_WriteRecord( dev, &emr.emr ))
319  return 0;
320 done:
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 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
HFONT hFont
Definition: main.c:53
#define GGO_BITMAP
Definition: wingdi.h:848
#define OEM_FIXED_FONT
Definition: wingdi.h:909
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
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
GLuint index
Definition: glext.h:6031
#define DEFAULT_PALETTE
Definition: wingdi.h:912
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
DWORD iType
Definition: wingdi.h:1685
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415
static BOOL EMFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont)
Definition: objects.c:244

◆ 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 );
440  EMRSELECTPALETTE emr;
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 
457 found:
459  emr.emr.nSize = sizeof(emr);
460  emr.ihPal = index;
461  return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPal : 0;
462 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define EMR_SELECTPALETTE
Definition: wingdi.h:122
GLuint index
Definition: glext.h:6031
#define DEFAULT_PALETTE
Definition: wingdi.h:912
static DWORD EMFDRV_CreatePalette(PHYSDEV dev, HPALETTE hPal)
Definition: objects.c:409
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
DWORD iType
Definition: wingdi.h:1685
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415

◆ 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:
399  emr.emr.iType = EMR_SELECTOBJECT;
400  emr.emr.nSize = sizeof(emr);
401  emr.ihObject = index;
402  return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPen : 0;
403 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define WHITE_PEN
Definition: wingdi.h:904
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
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
GLuint index
Definition: glext.h:6031
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
DWORD iType
Definition: wingdi.h:1685
static UINT EMFDRV_FindObject(PHYSDEV dev, HGDIOBJ obj)
Definition: objects.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415
static DWORD EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen)
Definition: objects.c:332

◆ EMFDRV_SetArcDirection()

INT EMFDRV_SetArcDirection ( PHYSDEV  dev,
INT  arcDirection 
)

Definition at line 154 of file dc.c.

155 {
156  EMRSETARCDIRECTION emr;
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
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 
107  emr.emr.iType = EMR_SETBKCOLOR;
108  emr.emr.nSize = sizeof(emr);
109  emr.crColor = color;
110  return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
111 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define CLR_INVALID
Definition: wingdi.h:882
GLuint color
Definition: glext.h:6243
COLORREF crColor
Definition: wingdi.h:2176
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
#define EMR_SETBKCOLOR
Definition: wingdi.h:99

◆ EMFDRV_SetBkMode()

INT EMFDRV_SetBkMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 91 of file dc.c.

92 {
93  EMRSETBKMODE emr;
94  emr.emr.iType = EMR_SETBKMODE;
95  emr.emr.nSize = sizeof(emr);
96  emr.iMode = mode;
97  return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
98 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
GLenum mode
Definition: glext.h:6217
#define EMR_SETBKMODE
Definition: wingdi.h:92
DWORD iType
Definition: wingdi.h:1685

◆ 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 );
484  emr.emr.iType = EMR_SELECTOBJECT;
485  emr.emr.nSize = sizeof(emr);
486  emr.ihObject = index;
487  return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
488 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define CLR_INVALID
Definition: wingdi.h:882
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC dc
Definition: cylfrac.c:34
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
GLuint color
Definition: glext.h:6243
GLuint index
Definition: glext.h:6031
Definition: polytest.cpp:40
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
DWORD EMFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush)
Definition: objects.c:111
DWORD iType
Definition: wingdi.h:1685
#define OBJ_BRUSH
Definition: objidl.idl:1410
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439

◆ 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 );
511  emr.emr.iType = EMR_SELECTOBJECT;
512  emr.emr.nSize = sizeof(emr);
513  emr.ihObject = index;
514  return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
515 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define CLR_INVALID
Definition: wingdi.h:882
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC dc
Definition: cylfrac.c:34
#define EMR_SELECTOBJECT
Definition: wingdi.h:111
#define OBJ_PEN
Definition: objidl.idl:1409
#define PS_SOLID
Definition: wingdi.h:585
GLuint color
Definition: glext.h:6243
GLuint index
Definition: glext.h:6031
Definition: polytest.cpp:40
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define index(s, c)
Definition: various.h:29
HPEN WINAPI CreatePenIndirect(_In_ const LOGPEN *)
DWORD iType
Definition: wingdi.h:1685
WINEDC * get_physdev_dc(PHYSDEV dev)
Definition: rosglue.c:190
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:415
static DWORD EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen)
Definition: objects.c:332
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439

◆ 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 {
237  EMRSETDIBITSTODEVICE* pEMR;
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 }
GLint GLint GLsizei width
Definition: gl.h:1546
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
long bottom
Definition: polytest.cpp:53
struct tagEMRSETDIBITSTODEVICE EMRSETDIBITSTODEVICE
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
eMaj lines
Definition: tritemp.h:206
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD nSize
Definition: wingdi.h:1686
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
DWORD iType
Definition: wingdi.h:1685
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:180
#define EMR_SETDIBITSTODEVICE
Definition: wingdi.h:153
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static DWORD layout
Definition: dc.c:42
#define GDI_ERROR
Definition: wingdi.h:1308

◆ 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;
239  emr.emr.iType = EMR_SETMAPMODE;
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
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
DWORD nSize
Definition: wingdi.h:1686
GLenum mode
Definition: glext.h:6217
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6

◆ EMFDRV_SetMapperFlags()

DWORD EMFDRV_SetMapperFlags ( PHYSDEV  dev,
DWORD  flags 
)

Definition at line 406 of file dc.c.

407 {
408  EMRSETMAPPERFLAGS emr;
409 
411  emr.emr.nSize = sizeof(emr);
412  emr.dwFlags = flags;
413 
414  return EMFDRV_WriteRecord( dev, &emr.emr ) ? flags : GDI_ERROR;
415 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define EMR_SETMAPPERFLAGS
Definition: wingdi.h:90
GLbitfield flags
Definition: glext.h:7161
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
#define GDI_ERROR
Definition: wingdi.h:1308

◆ 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 }
COLORREF crColor
Definition: wingdi.h:2217
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
long bottom
Definition: polytest.cpp:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
POINTL ptlPixel
Definition: wingdi.h:2216
LONG y
Definition: windef.h:315
long right
Definition: polytest.cpp:53
GLuint color
Definition: glext.h:6243
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
#define EMR_SETPIXELV
Definition: wingdi.h:89
void EMFDRV_UpdateBBox(PHYSDEV dev, RECTL *rect) DECLSPEC_HIDDEN
Definition: init.c:230
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ EMFDRV_SetPolyFillMode()

INT EMFDRV_SetPolyFillMode ( PHYSDEV  dev,
INT  mode 
)

Definition at line 136 of file dc.c.

137 {
138  EMRSETPOLYFILLMODE emr;
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
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
GLenum mode
Definition: glext.h:6217
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
#define EMR_SETROP2
Definition: wingdi.h:94
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define EMR_SETSTRETCHBLTMODE
Definition: wingdi.h:95
DWORD nSize
Definition: wingdi.h:1686
GLenum mode
Definition: glext.h:6217
DWORD iType
Definition: wingdi.h:1685

◆ EMFDRV_SetTextAlign()

UINT EMFDRV_SetTextAlign ( PHYSDEV  dev,
UINT  align 
)

Definition at line 72 of file dc.c.

73 {
74  EMRSETTEXTALIGN emr;
76  emr.emr.nSize = sizeof(emr);
77  emr.iMode = align;
78  return EMFDRV_WriteRecord( dev, &emr.emr ) ? align : GDI_ERROR;
79 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
int align(int length, int align)
Definition: dsound8.c:36
#define EMR_SETTEXTALIGN
Definition: wingdi.h:96
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
#define GDI_ERROR
Definition: wingdi.h:1308

◆ 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 
121  emr.emr.iType = EMR_SETTEXTCOLOR;
122  emr.emr.nSize = sizeof(emr);
123  emr.crColor = color;
124  return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
125 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
static EMFDRV_PDEVICE * get_emf_physdev(PHYSDEV dev)
#define CLR_INVALID
Definition: wingdi.h:882
#define EMR_SETTEXTCOLOR
Definition: wingdi.h:98
GLuint color
Definition: glext.h:6243
COLORREF crColor
Definition: wingdi.h:2176
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
LONG cx
Definition: windef.h:319
GLsizeiptr size
Definition: glext.h:5919
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
_Out_opt_ int * cx
Definition: commctrl.h:570
#define EMR_SETVIEWPORTEXTEX
Definition: wingdi.h:85
LONG cy
Definition: windef.h:320

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
#define EMR_SETVIEWPORTORGEX
Definition: wingdi.h:86
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ 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 );
264  EMRSETWINDOWEXTEX emr;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
LONG cx
Definition: windef.h:319
GLsizeiptr size
Definition: glext.h:5919
DWORD nSize
Definition: wingdi.h:1686
#define EMR_SETWINDOWEXTEX
Definition: wingdi.h:83
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG cy
Definition: windef.h:320

◆ 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 );
292  EMRSETWINDOWORGEX emr;
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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG y
Definition: windef.h:315
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
LONG x
Definition: windef.h:314
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define EMR_SETWINDOWORGEX
Definition: wingdi.h:84

◆ 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 }
BOOL EMFDRV_WriteRecord(PHYSDEV dev, EMR *emr) DECLSPEC_HIDDEN
Definition: init.c:193
#define GET_NEXT_PHYSDEV(dev, func)
Definition: gdi_driver.h:214
DWORD nSize
Definition: wingdi.h:1686
DWORD iType
Definition: wingdi.h:1685
static unsigned __int64 next
Definition: rand_nt.c:6
#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