ReactOS  0.4.14-dev-554-g2f8d847
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 LDC_LDC   0x00000001
 
#define LDC_EMFLDC   0x00000002
 
#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 212 of file gdi_private.h.

◆ DbgRaiseAssertionFailure

#define DbgRaiseAssertionFailure ( )    __int2c()

Definition at line 208 of file gdi_private.h.

◆ DIB_PAL_MONO

#define DIB_PAL_MONO   2

Definition at line 164 of file gdi_private.h.

◆ EMR_SETLINKEDUFI

#define EMR_SETLINKEDUFI   119

Definition at line 140 of file gdi_private.h.

◆ GDIRealizePalette

#define GDIRealizePalette   RealizePalette

Definition at line 193 of file gdi_private.h.

◆ GDISelectPalette

#define GDISelectPalette   SelectPalette

Definition at line 194 of file gdi_private.h.

◆ GdiWorldSpaceToDeviceSpace

#define GdiWorldSpaceToDeviceSpace   0x204

Definition at line 189 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 142 of file gdi_private.h.

◆ get_full_gdi_handle

#define get_full_gdi_handle   GdiFixUpHandle

Definition at line 197 of file gdi_private.h.

◆ LDC_EMFLDC

#define LDC_EMFLDC   0x00000002

Definition at line 57 of file gdi_private.h.

◆ LDC_LDC

#define LDC_LDC   0x00000001

Definition at line 56 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 200 of file gdi_private.h.

◆ WMFC_MAGIC

#define WMFC_MAGIC   0x43464d57

Definition at line 135 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 295 of file rosglue.c.

296 {
297  WINEDC* pWineDc;
298 
299  /* Allocate the Wine DC */
300  pWineDc = HeapAlloc(GetProcessHeap(), 0, sizeof(*pWineDc));
301  if (pWineDc == NULL)
302  {
303  return NULL;
304  }
305 
306  ZeroMemory(pWineDc, sizeof(*pWineDc));
307  pWineDc->refcount = 1;
308  pWineDc->hFont = GetStockObject(SYSTEM_FONT);
309  pWineDc->hBrush = GetStockObject(WHITE_BRUSH);
310  pWineDc->hPen = GetStockObject(BLACK_PEN);
312 
313  if (magic == OBJ_ENHMETADC)
314  {
315  /* We create a metafile DC, but we ignore the reference DC, this is
316  handled by the wine code */
317  pWineDc->hdc = NtGdiCreateMetafileDC(NULL);
318  if (pWineDc->hdc == NULL)
319  {
320  HeapFree(GetProcessHeap(), 0, pWineDc);
321  return NULL;
322  }
323 
324  pWineDc->iType = LDC_EMFLDC;
325 
326  /* Set the Wine DC as LDC */
327  GdiSetLDC(pWineDc->hdc, pWineDc);
328  }
329  else if (magic == OBJ_METADC)
330  {
332  if (pWineDc->hdc == NULL)
333  {
334  HeapFree(GetProcessHeap(), 0, pWineDc);
335  return NULL;
336  }
337  }
338  else
339  {
340  // nothing else supported!
341  ASSERT(FALSE);
342  }
343 
344  pWineDc->physDev = &pWineDc->NullPhysDev;
345  pWineDc->NullPhysDev.funcs = &DummyPhysDevFuncs;
346  pWineDc->NullPhysDev.next = NULL;
347 
348  pWineDc->NullPhysDev.hdc = pWineDc->hdc;
349  return pWineDc;
350 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPALETTE hPalette
Definition: gdi_private.h:83
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:1642
#define WHITE_BRUSH
Definition: wingdi.h:901
PHYSDEV physDev
Definition: gdi_private.h:66
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
HBRUSH hBrush
Definition: gdi_private.h:76
#define GetProcessHeap()
Definition: compat.h:403
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:79
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateMetafileDC(_In_ HDC hdc)
HPEN hPen
Definition: gdi_private.h:77
#define BLACK_PEN
Definition: wingdi.h:902
#define OBJ_METADC
Definition: objidl.idl:1412
LONG refcount
Definition: gdi_private.h:80
#define HeapFree(x, y, z)
Definition: compat.h:402
HFONT hFont
Definition: gdi_private.h:82
#define LDC_EMFLDC
Definition: gdi_private.h:57

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 449 of file rosglue.c.

452 {
453  unsigned int colors, size, masks = 0;
454 
455  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
456  {
457  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
458  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
459  return sizeof(BITMAPCOREHEADER) + colors *
460  ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
461  }
462  else /* assume BITMAPINFOHEADER */
463  {
464  if (info->bmiHeader.biClrUsed) colors = min( info->bmiHeader.biClrUsed, 256 );
465  else colors = info->bmiHeader.biBitCount > 8 ? 0 : 1 << info->bmiHeader.biBitCount;
466  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
467  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
468  return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
469  }
470 }
#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:2323
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetLastError(x)
Definition: compat.h:417
#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:402

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 155 of file gdi_private.h.

156 {
157  PHYSDEV dev;
158 
159  for (dev = dc->physDev; dev; dev = dev->next) if (dev->funcs == funcs) return dev;
160  return NULL;
161 }
static int dev
Definition: mkdosfs.c:536
smooth NULL
Definition: ftsmooth.c:416
static struct __wine_debug_functions funcs
Definition: debug.c:59
static const WCHAR dc[]

Referenced by CloseEnhMetaFile(), and nulldrv_BeginPath().

◆ free_dc_ptr()

◆ free_gdi_handle()

void* free_gdi_handle ( HGDIOBJ  handle)

Definition at line 248 of file rosglue.c.

249 {
250  /* Should be a client object */
251  return GdiDeleteClientObj(hobj);
252 }
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 255 of file rosglue.c.

258 {
259  GDILOOBJTYPE eObjType;
260 
261  /* Check if the object type matches */
262  eObjType = ConvertObjectType(wType);
263  if ((eObjType == 0) || (GDI_HANDLE_GET_TYPE(hobj) != eObjType))
264  {
265  return NULL;
266  }
267 
268  /* Check if we have an ALTDC */
269  if (eObjType == GDILoObjType_LO_ALTDC_TYPE)
270  {
271  /* Object is stored as LDC */
272  return GdiGetLDC(hobj);
273  }
274 
275  /* Check for client objects */
276  if ((eObjType == GDILoObjType_LO_METAFILE_TYPE) ||
277  (eObjType == GDILoObjType_LO_METAFILE16_TYPE) ||
278  (eObjType == GDILoObjType_LO_METADC16_TYPE))
279  {
280  return GdiGetClientObjLink(hobj);
281  }
282 
283  /* This should never happen! */
284  ASSERT(FALSE);
285  return NULL;
286 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
smooth NULL
Definition: ftsmooth.c:416
static GDILOOBJTYPE ConvertObjectType(WORD wType)
Definition: rosglue.c:200
#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 432 of file rosglue.c.

435 {
436  HDC hdcLink;
437 
438  /* Remove the HDC link for the object */
439  hdcLink = GdiRemoveClientObjLink(hobj);
440  ASSERT(hdcLink == hdc);
441 }
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 416 of file rosglue.c.

419 {
420  /* Record that we have an object in use by a METADC. We simply link the
421  object to the HDC that we use. Wine API does not give us a way to
422  respond to failure, so we silently ignore it */
423  if (!GdiCreateClientObjLink(hobj, hdc))
424  {
425  /* Ignore failure, and return */
426  DPRINT1("Failed to create link for selected METADC object.\n");
427  return;
428  }
429 }
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 289 of file rosglue.c.

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

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 378 of file rosglue.c.

379 {
380  /* Check for EMF DC */
382  {
383  /* The Wine DC is stored as the LDC */
384  return (WINEDC*)GdiGetLDC(hdc);
385  }
386 
387  /* Check for METADC16 */
389  {
390  return GdiGetClientObjLink(hdc);
391  }
392 
393  return NULL;
394 }
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 173 of file gdi_private.h.

174 {
175  return get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount )
176  * abs( info->bmiHeader.biHeight );
177 }
#define abs(i)
Definition: fconv.c:206
static int get_dib_stride(int width, int bpp)
Definition: gdi_private.h:168

◆ get_dib_info_size()

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

Definition at line 180 of file gdi_private.h.

181 {
182  if (info->bmiHeader.biCompression == BI_BITFIELDS)
183  return sizeof(BITMAPINFOHEADER) + 3 * sizeof(DWORD);
184  if (coloruse == DIB_PAL_COLORS)
185  return sizeof(BITMAPINFOHEADER) + info->bmiHeader.biClrUsed * sizeof(WORD);
186  return FIELD_OFFSET( BITMAPINFO, bmiColors[info->bmiHeader.biClrUsed] );
187 }
#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 168 of file gdi_private.h.

169 {
170  return ((width * bpp + 31) >> 3) & ~3;
171 }
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:403
#define HeapReAlloc
Definition: compat.h:401
#define lstrcpynA
Definition: compat.h:416

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 145 of file gdi_private.h.

146 {
147  PHYSDEV dev, *pdev = &dc->physDev;
148  while (*pdev && (*pdev)->funcs != funcs) pdev = &(*pdev)->next;
149  if (!*pdev) return NULL;
150  dev = *pdev;
151  *pdev = dev->next;
152  return dev;
153 }
struct gdi_physdev * next
Definition: gdi_driver.h:32
static int dev
Definition: mkdosfs.c:536
smooth NULL
Definition: ftsmooth.c:416
static struct __wine_debug_functions funcs
Definition: debug.c:59
static const WCHAR dc[]

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 403 of file rosglue.c.

407 {
408  while ((*dev)->funcs->priority > funcs->priority) dev = &(*dev)->next;
409  physdev->funcs = funcs;
410  physdev->next = *dev;
411  physdev->hdc = CONTAINING_RECORD(dev, WINEDC, physDev)->hdc;
412  *dev = physdev;
413 }
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 523 of file rosglue.c.

529 {
531  cxVirtualDevicePixel,
532  cyVirtualDevicePixel,
533  cxVirtualDeviceMm,
534  cyVirtualDeviceMm);
535 }
__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().