ReactOS  0.4.13-dev-249-gcba1a2f
gdi_private.h File Reference
#include <limits.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include <wine/gdi_driver.h>
#include <pshpack2.h>
#include <poppack.h>
Include dependency graph for gdi_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EMRSETTEXTJUSTIFICATION
 
struct  gdi_obj_funcs
 
struct  tagWINEDC
 
struct  emf_in_wmf_comment
 

Macros

#define META_EOF   0x0000
 
#define METAFILE_MEMORY   1
 
#define METAFILE_DISK   2
 
#define MFHEADERSIZE   (sizeof(METAHEADER))
 
#define MFVERSION   0x300
 
#define WMFC_MAGIC   0x43464d57
 
#define EMR_SETLINKEDUFI   119
 
#define GET_DC_PHYSDEV(dc, func)   get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(struct gdi_dc_funcs,func))
 
#define DIB_PAL_MONO   2
 
#define GdiWorldSpaceToDeviceSpace   0x204
 
#define GDIRealizePalette   RealizePalette
 
#define GDISelectPalette   SelectPalette
 
#define get_full_gdi_handle   GdiFixUpHandle
 
#define push_dc_driver   push_dc_driver_ros
 
#define DbgRaiseAssertionFailure()   __int2c()
 
#define ASSERT(x)   if (!(x)) DbgRaiseAssertionFailure()
 

Typedefs

typedef struct EMRSETTEXTJUSTIFICATIONPEMRSETTEXTJUSTIFICATION
 
typedef struct tagWINEDC WINEDC
 
typedef struct tagWINEDC DC
 

Functions

WINEDCget_physdev_dc (PHYSDEV dev)
 
BOOL get_brush_bitmap_info (HBRUSH handle, BITMAPINFO *info, void **bits, UINT *usage) DECLSPEC_HIDDEN
 
DCalloc_dc_ptr (WORD magic) DECLSPEC_HIDDEN
 
void free_dc_ptr (DC *dc) DECLSPEC_HIDDEN
 
DCget_dc_ptr (HDC hdc) DECLSPEC_HIDDEN
 
void release_dc_ptr (DC *dc) DECLSPEC_HIDDEN
 
int bitmap_info_size (const BITMAPINFO *info, WORD coloruse) DECLSPEC_HIDDEN
 
HENHMETAFILE EMF_Create_HENHMETAFILE (ENHMETAHEADER *emh, BOOL on_disk) DECLSPEC_HIDDEN
 
HGDIOBJ alloc_gdi_handle (void *obj, WORD type, const struct gdi_obj_funcs *funcs) DECLSPEC_HIDDEN
 
voidfree_gdi_handle (HGDIOBJ handle) DECLSPEC_HIDDEN
 
HGDIOBJ get_full_gdi_handle (HGDIOBJ handle) DECLSPEC_HIDDEN
 
voidGDI_GetObjPtr (HGDIOBJ, WORD) DECLSPEC_HIDDEN
 
void GDI_ReleaseObj (HGDIOBJ) DECLSPEC_HIDDEN
 
void GDI_hdc_using_object (HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
 
void GDI_hdc_not_using_object (HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
 
HMETAFILE MF_Create_HMETAFILE (METAHEADER *mh) DECLSPEC_HIDDEN
 
METAHEADERMF_CreateMetaHeaderDisk (METAHEADER *mr, LPCVOID filename, BOOL unicode) DECLSPEC_HIDDEN
 
HPALETTE WINAPI GDISelectPalette (HDC hdc, HPALETTE hpal, WORD wBkg) DECLSPEC_HIDDEN
 
UINT WINAPI GDIRealizePalette (HDC hdc) DECLSPEC_HIDDEN
 
static PHYSDEV pop_dc_driver (DC *dc, const struct gdi_dc_funcs *funcs)
 
static PHYSDEV find_dc_driver (DC *dc, const struct gdi_dc_funcs *funcs)
 
BOOL WINAPI SetVirtualResolution (HDC hdc, DWORD horz_res, DWORD vert_res, DWORD horz_size, DWORD vert_size)
 
static int get_dib_stride (int width, int bpp)
 
static int get_dib_image_size (const BITMAPINFO *info)
 
static int get_dib_info_size (const BITMAPINFO *info, UINT coloruse)
 
BOOL APIENTRY NtGdiGetTransform (_In_ HDC hdc, _In_ DWORD iXform, _Out_ LPXFORM pxf)
 
HGDIOBJ WINAPI GdiFixUpHandle (HGDIOBJ hGdiObj)
 
void push_dc_driver_ros (PHYSDEV *dev, PHYSDEV physdev, const struct gdi_dc_funcs *funcs)
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   x)    if (!(x)) DbgRaiseAssertionFailure()

Definition at line 194 of file gdi_private.h.

◆ DbgRaiseAssertionFailure

#define DbgRaiseAssertionFailure ( )    __int2c()

Definition at line 190 of file gdi_private.h.

◆ DIB_PAL_MONO

#define DIB_PAL_MONO   2

Definition at line 146 of file gdi_private.h.

◆ EMR_SETLINKEDUFI

#define EMR_SETLINKEDUFI   119

Definition at line 122 of file gdi_private.h.

◆ GDIRealizePalette

#define GDIRealizePalette   RealizePalette

Definition at line 175 of file gdi_private.h.

◆ GDISelectPalette

#define GDISelectPalette   SelectPalette

Definition at line 176 of file gdi_private.h.

◆ GdiWorldSpaceToDeviceSpace

#define GdiWorldSpaceToDeviceSpace   0x204

Definition at line 171 of file gdi_private.h.

◆ GET_DC_PHYSDEV

#define GET_DC_PHYSDEV (   dc,
  func 
)    get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(struct gdi_dc_funcs,func))

Definition at line 124 of file gdi_private.h.

◆ get_full_gdi_handle

#define get_full_gdi_handle   GdiFixUpHandle

Definition at line 179 of file gdi_private.h.

◆ META_EOF

#define META_EOF   0x0000

Definition at line 32 of file gdi_private.h.

◆ METAFILE_DISK

#define METAFILE_DISK   2

Definition at line 36 of file gdi_private.h.

◆ METAFILE_MEMORY

#define METAFILE_MEMORY   1

Definition at line 35 of file gdi_private.h.

◆ MFHEADERSIZE

#define MFHEADERSIZE   (sizeof(METAHEADER))

Definition at line 37 of file gdi_private.h.

◆ MFVERSION

#define MFVERSION   0x300

Definition at line 38 of file gdi_private.h.

◆ push_dc_driver

#define push_dc_driver   push_dc_driver_ros

Definition at line 182 of file gdi_private.h.

◆ WMFC_MAGIC

#define WMFC_MAGIC   0x43464d57

Definition at line 117 of file gdi_private.h.

Typedef Documentation

◆ DC

typedef struct tagWINEDC DC

◆ PEMRSETTEXTJUSTIFICATION

◆ WINEDC

Function Documentation

◆ alloc_dc_ptr()

DC* alloc_dc_ptr ( WORD  magic)

Definition at line 294 of file rosglue.c.

295 {
296  WINEDC* pWineDc;
297 
298  /* Allocate the Wine DC */
299  pWineDc = HeapAlloc(GetProcessHeap(), 0, sizeof(*pWineDc));
300  if (pWineDc == NULL)
301  {
302  return NULL;
303  }
304 
305  ZeroMemory(pWineDc, sizeof(*pWineDc));
306  pWineDc->refcount = 1;
307  pWineDc->hFont = GetStockObject(SYSTEM_FONT);
308  pWineDc->hBrush = GetStockObject(WHITE_BRUSH);
309  pWineDc->hPen = GetStockObject(BLACK_PEN);
311 
312  if (magic == OBJ_ENHMETADC)
313  {
314  /* We create a metafile DC, but we ignore the reference DC, this is
315  handled by the wine code */
316  pWineDc->hdc = NtGdiCreateMetafileDC(NULL);
317  if (pWineDc->hdc == NULL)
318  {
319  HeapFree(GetProcessHeap(), 0, pWineDc);
320  return NULL;
321  }
322 
323  /* Set the Wine DC as LDC */
324  GdiSetLDC(pWineDc->hdc, pWineDc);
325  }
326  else if (magic == OBJ_METADC)
327  {
329  if (pWineDc->hdc == NULL)
330  {
331  HeapFree(GetProcessHeap(), 0, pWineDc);
332  return NULL;
333  }
334  }
335  else
336  {
337  // nothing else supported!
338  ASSERT(FALSE);
339  }
340 
341  pWineDc->physDev = &pWineDc->NullPhysDev;
342  pWineDc->NullPhysDev.funcs = &DummyPhysDevFuncs;
343  pWineDc->NullPhysDev.next = NULL;
344 
345  pWineDc->NullPhysDev.hdc = pWineDc->hdc;
346  return pWineDc;
347 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPALETTE hPalette
Definition: gdi_private.h:65
static const struct gdi_dc_funcs DummyPhysDevFuncs
Definition: rosglue.c:50
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:802
u32_t magic(void)
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
#define ZeroMemory
Definition: winbase.h:1635
#define WHITE_BRUSH
Definition: wingdi.h:901
PHYSDEV physDev
Definition: gdi_private.h:59
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
HBRUSH hBrush
Definition: gdi_private.h:63
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DEFAULT_PALETTE
Definition: wingdi.h:912
#define OBJ_ENHMETADC
Definition: objidl.idl:1420
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct gdi_physdev NullPhysDev
Definition: gdi_private.h:58
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateMetafileDC(_In_ HDC hdc)
HPEN hPen
Definition: gdi_private.h:64
#define BLACK_PEN
Definition: wingdi.h:902
#define OBJ_METADC
Definition: objidl.idl:1412
LONG refcount
Definition: gdi_private.h:60
#define HeapFree(x, y, z)
Definition: compat.h:394
HFONT hFont
Definition: gdi_private.h:62

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().

◆ alloc_gdi_handle()

HGDIOBJ alloc_gdi_handle ( void obj,
WORD  type,
const struct gdi_obj_funcs funcs 
)

◆ bitmap_info_size()

int bitmap_info_size ( const BITMAPINFO info,
WORD  coloruse 
)

Definition at line 446 of file rosglue.c.

449 {
450  unsigned int colors, size, masks = 0;
451 
452  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
453  {
454  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
455  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
456  return sizeof(BITMAPCOREHEADER) + colors *
457  ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
458  }
459  else /* assume BITMAPINFOHEADER */
460  {
461  if (info->bmiHeader.biClrUsed) colors = min( info->bmiHeader.biClrUsed, 256 );
462  else colors = info->bmiHeader.biBitCount > 8 ? 0 : 1 << info->bmiHeader.biBitCount;
463  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
464  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
465  return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
466  }
467 }
#define max(a, b)
Definition: svc.c:63
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define BI_BITFIELDS
Definition: mmreg.h:507
GLsizeiptr size
Definition: glext.h:5919
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define min(a, b)
Definition: monoChain.cc:55
#define DIB_RGB_COLORS
Definition: wingdi.h:366
static const BYTE masks[8]
Definition: dib.c:2760

◆ EMF_Create_HENHMETAFILE()

HENHMETAFILE EMF_Create_HENHMETAFILE ( ENHMETAHEADER emh,
BOOL  on_disk 
)

Definition at line 249 of file enhmetafile.c.

250 {
251  HENHMETAFILE hmf;
252  ENHMETAFILEOBJ *metaObj;
253 
254  if (emh->iType != EMR_HEADER)
255  {
257  return 0;
258  }
259  if (emh->dSignature != ENHMETA_SIGNATURE ||
260  (emh->nBytes & 3)) /* refuse to load unaligned EMF as Windows does */
261  {
262  WARN("Invalid emf header type 0x%08x sig 0x%08x.\n",
263  emh->iType, emh->dSignature);
264  return 0;
265  }
266 
267  if (!(metaObj = HeapAlloc( GetProcessHeap(), 0, sizeof(*metaObj) ))) return 0;
268 
269  metaObj->emh = emh;
270  metaObj->on_disk = on_disk;
271 
272  if (!(hmf = alloc_gdi_handle( metaObj, OBJ_ENHMETAFILE, NULL )))
273  HeapFree( GetProcessHeap(), 0, metaObj );
274  return hmf;
275 }
ENHMETAHEADER * emh
Definition: enhmetafile.c:53
HGDIOBJ alloc_gdi_handle(void *obj, WORD type, const struct gdi_obj_funcs *funcs) DECLSPEC_HIDDEN
#define WARN(fmt,...)
Definition: debug.h:111
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
smooth NULL
Definition: ftsmooth.c:416
DWORD dSignature
Definition: wingdi.h:2302
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetLastError(x)
Definition: compat.h:409
#define EMR_HEADER
Definition: wingdi.h:75
#define ENHMETA_SIGNATURE
Definition: wingdi.h:204
#define ERROR_INVALID_DATA
Definition: winerror.h:116
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by CloseEnhMetaFile(), CopyEnhMetaFileA(), CopyEnhMetaFileW(), EMF_GetEnhMetaFile(), and SetEnhMetaFileBits().

◆ find_dc_driver()

static PHYSDEV find_dc_driver ( DC dc,
const struct gdi_dc_funcs funcs 
)
inlinestatic

Definition at line 137 of file gdi_private.h.

138 {
139  PHYSDEV dev;
140 
141  for (dev = dc->physDev; dev; dev = dev->next) if (dev->funcs == funcs) return dev;
142  return NULL;
143 }
HDC dc
Definition: cylfrac.c:34
static int dev
Definition: mkdosfs.c:536
smooth NULL
Definition: ftsmooth.c:416
static struct __wine_debug_functions funcs
Definition: debug.c:59

Referenced by CloseEnhMetaFile(), and nulldrv_BeginPath().

◆ free_dc_ptr()

◆ free_gdi_handle()

void* free_gdi_handle ( HGDIOBJ  handle)

Definition at line 247 of file rosglue.c.

248 {
249  /* Should be a client object */
250  return GdiDeleteClientObj(hobj);
251 }
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173

Referenced by DeleteMetaFile(), and EMF_Delete_HENHMETAFILE().

◆ GDI_GetObjPtr()

void* GDI_GetObjPtr ( HGDIOBJ  ,
WORD   
)

Definition at line 254 of file rosglue.c.

257 {
258  GDILOOBJTYPE eObjType;
259 
260  /* Check if the object type matches */
261  eObjType = ConvertObjectType(wType);
262  if ((eObjType == 0) || (GDI_HANDLE_GET_TYPE(hobj) != eObjType))
263  {
264  return NULL;
265  }
266 
267  /* Check if we have an ALTDC */
268  if (eObjType == GDILoObjType_LO_ALTDC_TYPE)
269  {
270  /* Object is stored as LDC */
271  return GdiGetLDC(hobj);
272  }
273 
274  /* Check for client objects */
275  if ((eObjType == GDILoObjType_LO_METAFILE_TYPE) ||
276  (eObjType == GDILoObjType_LO_METAFILE16_TYPE) ||
277  (eObjType == GDILoObjType_LO_METADC16_TYPE))
278  {
279  return GdiGetClientObjLink(hobj);
280  }
281 
282  /* This should never happen! */
283  ASSERT(FALSE);
284  return NULL;
285 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
smooth NULL
Definition: ftsmooth.c:416
static GDILOOBJTYPE ConvertObjectType(WORD wType)
Definition: rosglue.c:199
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
enum GDILoObjType GDILOOBJTYPE

Referenced by EMF_GetEnhMetaHeader(), get_metafile_bits(), and GetMetaFileBitsEx().

◆ GDI_hdc_not_using_object()

void GDI_hdc_not_using_object ( HGDIOBJ  obj,
HDC  hdc 
)

Definition at line 429 of file rosglue.c.

432 {
433  HDC hdcLink;
434 
435  /* Remove the HDC link for the object */
436  hdcLink = GdiRemoveClientObjLink(hobj);
437  ASSERT(hdcLink == hdc);
438 }
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
static HDC
Definition: imagelist.c:92
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDC hdc
Definition: main.c:9

Referenced by EMFDRV_DeleteDC(), and MFDRV_DeleteDC().

◆ GDI_hdc_using_object()

void GDI_hdc_using_object ( HGDIOBJ  obj,
HDC  hdc 
)

Definition at line 413 of file rosglue.c.

416 {
417  /* Record that we have an object in use by a METADC. We simply link the
418  object to the HDC that we use. Wine API does not give us a way to
419  respond to failure, so we silently ignore it */
420  if (!GdiCreateClientObjLink(hobj, hdc))
421  {
422  /* Ignore failure, and return */
423  DPRINT1("Failed to create link for selected METADC object.\n");
424  return;
425  }
426 }
BOOL WINAPI GdiCreateClientObjLink(_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
Definition: clientobj.c:24
HDC hdc
Definition: main.c:9
#define DPRINT1
Definition: precomp.h:8

Referenced by EMFDRV_SelectBrush(), EMFDRV_SelectFont(), EMFDRV_SelectPalette(), EMFDRV_SelectPen(), EMFDRV_SetDCBrushColor(), EMFDRV_SetDCPenColor(), MFDRV_SelectBrush(), MFDRV_SelectFont(), and MFDRV_SelectPen().

◆ GDI_ReleaseObj()

void GDI_ReleaseObj ( HGDIOBJ  )

Definition at line 288 of file rosglue.c.

289 {
290  /* We don't do any reference-counting */
291 }

Referenced by EMF_GetEnhMetaHeader(), get_metafile_bits(), and GetMetaFileBitsEx().

◆ GdiFixUpHandle()

HGDIOBJ WINAPI GdiFixUpHandle ( HGDIOBJ  hGdiObj)

Definition at line 734 of file misc.c.

735 {
737 
738  if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK )
739  {
740  return hGdiObj;
741  }
742 
743  /* FIXME is this right ?? */
744 
746 
747  /* Rebuild handle for Object */
748  return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) | (Entry->Type << GDI_ENTRY_UPPER_SHIFT));
749 }
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
struct _Entry Entry
Definition: kefuncs.h:640
uint32_t ULONG_PTR
Definition: typedefs.h:63
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33
void * HGDIOBJ
Definition: windef.h:252
Definition: gdi.h:1
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
#define GDI_HANDLE_UPPER_MASK
Definition: gdi.h:22
base of all file and directory entries
Definition: entries.h:82

◆ GDIRealizePalette()

UINT WINAPI GDIRealizePalette ( HDC  hdc)

Referenced by PlayMetaFileRecord().

◆ GDISelectPalette()

HPALETTE WINAPI GDISelectPalette ( HDC  hdc,
HPALETTE  hpal,
WORD  wBkg 
)

Referenced by PlayMetaFileRecord().

◆ get_brush_bitmap_info()

BOOL get_brush_bitmap_info ( HBRUSH  handle,
BITMAPINFO info,
void **  bits,
UINT usage 
)

◆ get_dc_ptr()

DC* get_dc_ptr ( HDC  hdc)

Definition at line 375 of file rosglue.c.

376 {
377  /* Check for EMF DC */
379  {
380  /* The Wine DC is stored as the LDC */
381  return (WINEDC*)GdiGetLDC(hdc);
382  }
383 
384  /* Check for METADC16 */
386  {
387  return GdiGetClientObjLink(hdc);
388  }
389 
390  return NULL;
391 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
HDC hdc
Definition: main.c:9

Referenced by CloseEnhMetaFile(), DRIVER_RestoreDC(), DRIVER_SelectBrush(), DRIVER_SelectFont(), DRIVER_SelectPen(), GetPhysDev(), and MFDRV_CloseMetaFile().

◆ get_dib_image_size()

static int get_dib_image_size ( const BITMAPINFO info)
inlinestatic

Definition at line 155 of file gdi_private.h.

156 {
157  return get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount )
158  * abs( info->bmiHeader.biHeight );
159 }
#define abs(i)
Definition: fconv.c:206
static int get_dib_stride(int width, int bpp)
Definition: gdi_private.h:150

◆ get_dib_info_size()

static int get_dib_info_size ( const BITMAPINFO info,
UINT  coloruse 
)
inlinestatic

Definition at line 162 of file gdi_private.h.

163 {
164  if (info->bmiHeader.biCompression == BI_BITFIELDS)
165  return sizeof(BITMAPINFOHEADER) + 3 * sizeof(DWORD);
166  if (coloruse == DIB_PAL_COLORS)
167  return sizeof(BITMAPINFOHEADER) + info->bmiHeader.biClrUsed * sizeof(WORD);
168  return FIELD_OFFSET( BITMAPINFO, bmiColors[info->bmiHeader.biClrUsed] );
169 }
#define DIB_PAL_COLORS
Definition: wingdi.h:365
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define BI_BITFIELDS
Definition: mmreg.h:507
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by EMFDRV_CreateBrushIndirect(), EMFDRV_SetDIBitsToDevice(), EMFDRV_StretchDIBits(), MFDRV_CreateBrushIndirect(), MFDRV_SetDIBitsToDevice(), MFDRV_StretchBlt(), and MFDRV_StretchDIBits().

◆ get_dib_stride()

static int get_dib_stride ( int  width,
int  bpp 
)
inlinestatic

Definition at line 150 of file gdi_private.h.

151 {
152  return ((width * bpp + 31) >> 3) & ~3;
153 }
GLint GLint GLsizei width
Definition: gl.h:1546
DWORD bpp
Definition: surface.c:181

Referenced by get_dib_image_size().

◆ get_full_gdi_handle()

HGDIOBJ get_full_gdi_handle ( HGDIOBJ  handle)

◆ get_physdev_dc()

WINEDC* get_physdev_dc ( PHYSDEV  dev)

◆ MF_Create_HMETAFILE()

HMETAFILE MF_Create_HMETAFILE ( METAHEADER mh)

Definition at line 107 of file metafile.c.

108 {
109  return alloc_gdi_handle( mh, OBJ_METAFILE, NULL );
110 }
HGDIOBJ alloc_gdi_handle(void *obj, WORD type, const struct gdi_obj_funcs *funcs) DECLSPEC_HIDDEN
smooth NULL
Definition: ftsmooth.c:416
#define OBJ_METAFILE
Definition: objidl.idl:1417

Referenced by CloseMetaFile(), CopyMetaFileW(), GetMetaFileA(), GetMetaFileW(), and SetMetaFileBitsEx().

◆ MF_CreateMetaHeaderDisk()

METAHEADER* MF_CreateMetaHeaderDisk ( METAHEADER mr,
LPCVOID  filename,
BOOL  unicode 
)

Definition at line 271 of file metafile.c.

272 {
273  METAHEADERDISK *mhd;
274 
275  mh = HeapReAlloc( GetProcessHeap(), 0, mh,
276  sizeof(METAHEADER) + sizeof(METAHEADERDISK));
277  mh->mtType = METAFILE_DISK;
278  mhd = (METAHEADERDISK *)((char *)mh + sizeof(METAHEADER));
279 
280  if( uni )
282  mhd->filename, sizeof mhd->filename, NULL, NULL);
283  else
284  lstrcpynA( mhd->filename, filename, sizeof mhd->filename );
285  return mh;
286 }
#define METAFILE_DISK
Definition: gdi32p.h:77
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
struct tagMETAHEADER METAHEADER
CHAR filename[0x100]
Definition: metafile.c:74
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
#define HeapReAlloc
Definition: compat.h:393
#define lstrcpynA
Definition: compat.h:408

Referenced by CreateMetaFileW().

◆ NtGdiGetTransform()

BOOL APIENTRY NtGdiGetTransform ( _In_ HDC  hdc,
_In_ DWORD  iXform,
_Out_ LPXFORM  pxf 
)

◆ pop_dc_driver()

static PHYSDEV pop_dc_driver ( DC dc,
const struct gdi_dc_funcs funcs 
)
inlinestatic

Definition at line 127 of file gdi_private.h.

128 {
129  PHYSDEV dev, *pdev = &dc->physDev;
130  while (*pdev && (*pdev)->funcs != funcs) pdev = &(*pdev)->next;
131  if (!*pdev) return NULL;
132  dev = *pdev;
133  *pdev = dev->next;
134  return dev;
135 }
struct gdi_physdev * next
Definition: gdi_driver.h:32
HDC dc
Definition: cylfrac.c:34
static int dev
Definition: mkdosfs.c:536
smooth NULL
Definition: ftsmooth.c:416
static struct __wine_debug_functions funcs
Definition: debug.c:59

Referenced by emfpathdrv_AbortPath(), emfpathdrv_EndPath(), pathdrv_AbortPath(), and pathdrv_EndPath().

◆ push_dc_driver_ros()

void push_dc_driver_ros ( PHYSDEV dev,
PHYSDEV  physdev,
const struct gdi_dc_funcs funcs 
)

Definition at line 400 of file rosglue.c.

404 {
405  while ((*dev)->funcs->priority > funcs->priority) dev = &(*dev)->next;
406  physdev->funcs = funcs;
407  physdev->next = *dev;
408  physdev->hdc = CONTAINING_RECORD(dev, WINEDC, physDev)->hdc;
409  *dev = physdev;
410 }
struct gdi_physdev * next
Definition: gdi_driver.h:32
static int dev
Definition: mkdosfs.c:536
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static struct __wine_debug_functions funcs
Definition: debug.c:59
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31

◆ release_dc_ptr()

◆ SetVirtualResolution()

BOOL WINAPI SetVirtualResolution ( HDC  hdc,
DWORD  horz_res,
DWORD  vert_res,
DWORD  horz_size,
DWORD  vert_size 
)

Definition at line 520 of file rosglue.c.

526 {
528  cxVirtualDevicePixel,
529  cyVirtualDevicePixel,
530  cxVirtualDeviceMm,
531  cyVirtualDeviceMm);
532 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiSetVirtualResolution(_In_ HDC hdc, _In_ INT cxVirtualDevicePixel, _In_ INT cyVirtualDevicePixel, _In_ INT cxVirtualDeviceMm, _In_ INT cyVirtualDeviceMm)
HDC hdc
Definition: main.c:9

Referenced by CreateEnhMetaFileW(), and MFDRV_AllocMetaFile().