ReactOS 0.4.15-dev-7961-gdcf9eb0
gdi32p.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagMETAFILEDC
 
struct  tagMF_ENTRY
 
struct  tagENHMETAFILE
 
struct  _UMPDEV
 
struct  _LOCALFONT
 

Macros

#define HANDLE_LIST_INC   20
 
#define METAFILE_MEMORY   1
 
#define METAFILE_DISK   2
 
#define SAPCALLBACKDELAY   244
 
#define LPK_INIT   1
 
#define LPK_ETO   2
 
#define LPK_GCP   3
 
#define LPK_GTEP   4
 
#define ROP_USES_SOURCE(Rop)   (((Rop) << 2 ^ Rop) & 0xCC0000)
 
#define RCAST(_Type, _Value)   (*((_Type*)&_Value))
 
#define PDEV_UMPD_ID   0xFEDCBA98
 
#define UMPDEV_NO_ESCAPE   0x0002
 
#define UMPDEV_SUPPORT_ESCAPE   0x0004
 
#define LOCALFONT_COUNT   10
 
#define FOtoF(pfo)   (*(pfo))
 
#define HANDLE_METADC(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_METADC16(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_EMETAFDC(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_METADC1P(_RetType, _Func, dwError, hdc, ...)
 

Typedefs

typedef INT(CALLBACKEMFPLAYPROC) (HDC hdc, INT iFunction, HANDLE hPageQuery)
 
typedef BOOL(WINAPILPKETO) (HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
 
typedef DWORD(WINAPILPKGCP) (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
 
typedef BOOL(WINAPILPKGTEP) (HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)
 
typedef struct tagMETAFILEDC METAFILEDC
 
typedef struct tagMETAFILEDCPMETAFILEDC
 
typedef struct tagMF_ENTRY MF_ENTRY
 
typedef struct tagMF_ENTRYPMF_ENTRY
 
typedef struct tagENHMETAFILE ENHMETAFILE
 
typedef struct tagENHMETAFILEPENHMETAFILE
 
typedef struct _UMPDEV UMPDEV
 
typedef struct _UMPDEVPUMPDEV
 
typedef struct _LOCALFONT LOCALFONT
 
typedef struct _LOCALFONTPLOCALFONT
 
typedef BOOL(WINAPIABORTPRINTER) (HANDLE)
 
typedef BOOL(WINAPICLOSEPRINTER) (HANDLE)
 
typedef BOOL(WINAPICLOSESPOOLFILEHANDLE) (HANDLE, HANDLE)
 
typedef HANDLE(WINAPICOMMITSPOOLDATA) (HANDLE, HANDLE, DWORD)
 
typedef LONG(WINAPIDOCUMENTPROPERTIESW) (HWND, HANDLE, LPWSTR, PDEVMODEW, PDEVMODEW, DWORD)
 
typedef BOOL(WINAPIENDDOCPRINTER) (HANDLE)
 
typedef BOOL(WINAPIENDPAGEPRINTER) (HANDLE)
 
typedef BOOL(WINAPIGETPRINTERW) (HANDLE, DWORD, LPBYTE, DWORD, LPDWORD)
 
typedef BOOL(WINAPIGETPRINTERDRIVERW) (HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD)
 
typedef HANDLE(WINAPIGETSPOOLFILEHANDLE) (HANDLE)
 
typedef BOOL(WINAPIISVALIDDEVMODEW) (PDEVMODEW, size_t)
 
typedef BOOL(WINAPIOPENPRINTERW) (LPWSTR, PHANDLE, LPPRINTER_DEFAULTSW)
 
typedef BOOL(WINAPIREADPRINTER) (HANDLE, PVOID, DWORD, PDWORD)
 
typedef BOOL(WINAPIRESETPRINTERW) (HANDLE, LPPRINTER_DEFAULTSW)
 
typedef LPWSTR(WINAPISTARTDOCDLGW) (HANDLE, DOCINFOW *)
 
typedef DWORD(WINAPISTARTDOCPRINTERW) (HANDLE, DWORD, PBYTE)
 
typedef BOOL(WINAPISTARTPAGEPRINTER) (HANDLE)
 
typedef BOOL(WINAPISEEKPRINTER) (HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL)
 
typedef BOOL(WINAPISPLREADPRINTER) (HANDLE, LPBYTE *, DWORD)
 
typedef BOOL(WINAPISPLDRIVERUNLOADCOMPLETE) (LPWSTR)
 
typedef INT(WINAPIDOCUMENTEVENT) (HANDLE, HDC, INT, ULONG, PVOID, ULONG, PVOID)
 
typedef BOOL(WINAPIQUERYCOLORPROFILE) (HANDLE, PDEVMODEW, ULONG, VOID *, ULONG, FLONG)
 
typedef DWORD(WINAPIQUERYSPOOLMODE) (HANDLE, DWORD, DWORD)
 
typedef DWORD(WINAPIQUERYREMOTEFONTS) (DWORD, DWORD, DWORD)
 

Functions

PVOID HEAP_alloc (DWORD len)
 
NTSTATUS HEAP_strdupA2W (LPWSTR *ppszW, LPCSTR lpszA)
 
VOID HEAP_free (LPVOID memory)
 
VOID FASTCALL FONT_TextMetricWToA (const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
 
VOID FASTCALL NewTextMetricW2A (NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
 
VOID FASTCALL NewTextMetricExW2A (NEWTEXTMETRICEXA *tma, NEWTEXTMETRICEXW *tmw)
 
BOOL FASTCALL DeleteRegion (HRGN)
 
BOOL WINAPI GdiValidateHandle (HGDIOBJ)
 
BOOL GdiGetHandleUserData (HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
 
PLDC FASTCALL GdiGetLDC (HDC hDC)
 
BOOL FASTCALL GdiSetLDC (HDC hdc, PVOID pvLDC)
 
HGDIOBJ WINAPI GdiFixUpHandle (HGDIOBJ hGO)
 
BOOL WINAPI CalculateColorTableSize (CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize)
 
LPBITMAPINFO WINAPI ConvertBitmapInfo (CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData)
 
DWORD WINAPI GetAndSetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
 
DWORD WINAPI GetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
 
HGDIOBJ WINAPI GetDCObject (HDC, INT)
 
VOID NTAPI LogFontA2W (LPLOGFONTW pW, CONST LOGFONTA *pA)
 
VOID NTAPI LogFontW2A (LPLOGFONTA pA, CONST LOGFONTW *pW)
 
VOID WINAPI EnumLogFontExW2A (LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW)
 
BOOL WINAPI LoadLPK (INT LpkFunctionID)
 
VOID WINAPI GdiInitializeLanguagePack (_In_ DWORD InitParam)
 
VOID WINAPI InitializeLpkHooks (_In_ FARPROC *hookfuncs)
 
BOOL WINAPI GetETM (HDC hdc, EXTTEXTMETRIC *petm)
 
UINT WINAPI UserRealizePalette (HDC hDC)
 
int WINAPI GdiAddFontResourceW (LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
 
VOID WINAPI GdiSetLastError (DWORD dwErrCode)
 
DWORD WINAPI GdiGetCodePage (HDC)
 
int WINAPI GdiGetBitmapBitsSize (BITMAPINFO *lpbmi)
 
VOID GdiSAPCallback (PLDC pldc)
 
HGDIOBJ FASTCALL hGetPEBHandle (HANDLECACHETYPE, COLORREF)
 
int FASTCALL DocumentEventEx (PVOID, HANDLE, HDC, int, ULONG, PVOID, ULONG, PVOID)
 
BOOL FASTCALL EndPagePrinterEx (PVOID, HANDLE)
 
BOOL FASTCALL LoadTheSpoolerDrv (VOID)
 
FORCEINLINE PVOID GdiAllocBatchCommand (HDC hdc, USHORT Cmd)
 
FORCEINLINE PDC_ATTR GdiGetDcAttr (HDC hdc)
 
FORCEINLINE PRGN_ATTR GdiGetRgnAttr (HRGN hrgn)
 
FORCEINLINE int _lrintf (float f)
 
HBRUSH WINAPI GdiSelectBrush (_In_ HDC hdc, _In_ HBRUSH hbr)
 
HPEN WINAPI GdiSelectPen (_In_ HDC hdc, _In_ HPEN hpen)
 
HFONT WINAPI GdiSelectFont (_In_ HDC hdc, _In_ HFONT hfont)
 
HGDIOBJ WINAPI GdiCreateClientObj (_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
 
PVOID WINAPI GdiDeleteClientObj (_In_ HGDIOBJ hobj)
 
BOOL WINAPI GdiCreateClientObjLink (_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
 
PVOID WINAPI GdiGetClientObjLink (_In_ HGDIOBJ hobj)
 
PVOID WINAPI GdiRemoveClientObjLink (_In_ HGDIOBJ hobj)
 
VOID WINAPI METADC_RosGlueDeleteObject (HGDIOBJ hobj)
 
BOOL WINAPI METADC_RosGlueDeleteDC (_In_ HDC hdc)
 
BOOL METADC_DeleteDC (HDC hdc)
 
BOOL WINAPI METADC_ExtTextOutW (HDC hdc, INT x, INT y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT cchString, const INT *lpDx)
 
BOOL WINAPI METADC_SetD (_In_ HDC hdc, _In_ DWORD dwIn, _In_ USHORT usMF16Id)
 
BOOL WINAPI EMFDC_SetD (_In_ PLDC pldc, _In_ DWORD dwIn, _In_ ULONG ulMFId)
 
HDC WINAPI GdiConvertAndCheckDC (HDC hdc)
 
HENHMETAFILE WINAPI SetEnhMetaFileBitsAlt (PDWORD pdw, LPWSTR FilePart, HANDLE hFile, LARGE_INTEGER li)
 
BOOL METADC_Arc (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL METADC_BitBlt (HDC hdc_dst, INT x_dst, INT y_dst, INT width, INT height, HDC hdc_src, INT x_src, INT y_src, DWORD rop)
 
BOOL METADC_Chord (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL METADC_Ellipse (HDC hdc, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL METADC_ExcludeClipRect (HDC hdc, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL METADC_ExtEscape (HDC hdc, INT escape, INT input_size, LPCSTR input, INT output_size, LPVOID output) DECLSPEC_HIDDEN
 
BOOL METADC_ExtFloodFill (HDC hdc, INT x, INT y, COLORREF color, UINT fill_type) DECLSPEC_HIDDEN
 
BOOL METADC_ExtSelectClipRgn (HDC hdc, HRGN hrgn, INT mode) DECLSPEC_HIDDEN
 
BOOL METADC_ExtTextOut (HDC hdc, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx) DECLSPEC_HIDDEN
 
BOOL METADC_FillRgn (HDC hdc, HRGN hrgn, HBRUSH hbrush) DECLSPEC_HIDDEN
 
BOOL METADC_FrameRgn (HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y) DECLSPEC_HIDDEN
 
INT METADC_GetDeviceCaps (HDC hdc, INT cap)
 
BOOL METADC_IntersectClipRect (HDC hdc, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL METADC_InvertRgn (HDC hdc, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL METADC_LineTo (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_MoveTo (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_OffsetClipRgn (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_OffsetViewportOrgEx (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_OffsetWindowOrgEx (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_PaintRgn (HDC hdc, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL METADC_PatBlt (HDC hdc, INT left, INT top, INT width, INT height, DWORD rop)
 
BOOL METADC_Pie (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend) DECLSPEC_HIDDEN
 
BOOL METADC_PolyPolygon (HDC hdc, const POINT *points, const INT *counts, UINT polygons) DECLSPEC_HIDDEN
 
BOOL METADC_Polygon (HDC hdc, const POINT *points, INT count) DECLSPEC_HIDDEN
 
BOOL METADC_Polyline (HDC hdc, const POINT *points, INT count) DECLSPEC_HIDDEN
 
BOOL METADC_RealizePalette (HDC hdc) DECLSPEC_HIDDEN
 
BOOL METADC_Rectangle (HDC hdc, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL METADC_RestoreDC (HDC hdc, INT level) DECLSPEC_HIDDEN
 
BOOL METADC_RoundRect (HDC hdc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height) DECLSPEC_HIDDEN
 
BOOL METADC_SaveDC (HDC hdc) DECLSPEC_HIDDEN
 
BOOL METADC_ScaleViewportExtEx (HDC hdc, INT x_num, INT x_denom, INT y_num, INT y_denom) DECLSPEC_HIDDEN
 
BOOL METADC_ScaleWindowExtEx (HDC hdc, INT x_num, INT x_denom, INT y_num, INT y_denom) DECLSPEC_HIDDEN
 
HGDIOBJ METADC_SelectObject (HDC hdc, HGDIOBJ obj) DECLSPEC_HIDDEN
 
BOOL METADC_SelectPalette (HDC hdc, HPALETTE palette) DECLSPEC_HIDDEN
 
BOOL METADC_SetBkColor (HDC hdc, COLORREF color) DECLSPEC_HIDDEN
 
BOOL METADC_SetBkMode (HDC hdc, INT mode) DECLSPEC_HIDDEN
 
INT METADC_SetDIBitsToDevice (HDC hdc, INT x_dest, INT y_dest, DWORD width, DWORD height, INT x_src, INT y_src, UINT startscan, UINT lines, const void *bits, const BITMAPINFO *info, UINT coloruse) DECLSPEC_HIDDEN
 
BOOL METADC_SetLayout (HDC hdc, DWORD layout) DECLSPEC_HIDDEN
 
BOOL METADC_SetTextCharacterExtra (HDC hdc, INT extra) DECLSPEC_HIDDEN
 
BOOL METADC_SetMapMode (HDC hdc, INT mode) DECLSPEC_HIDDEN
 
BOOL METADC_SetMapperFlags (HDC hdc, DWORD flags) DECLSPEC_HIDDEN
 
BOOL METADC_SetPixel (HDC hdc, INT x, INT y, COLORREF color) DECLSPEC_HIDDEN
 
BOOL METADC_SetPolyFillMode (HDC hdc, INT mode) DECLSPEC_HIDDEN
 
BOOL METADC_SetRelAbs (HDC hdc, INT mode) DECLSPEC_HIDDEN
 
BOOL METADC_SetROP2 (HDC hdc, INT rop) DECLSPEC_HIDDEN
 
BOOL METADC_SetStretchBltMode (HDC hdc, INT mode) DECLSPEC_HIDDEN
 
BOOL METADC_SetTextAlign (HDC hdc, UINT align) DECLSPEC_HIDDEN
 
BOOL METADC_SetTextColor (HDC hdc, COLORREF color) DECLSPEC_HIDDEN
 
BOOL METADC_SetTextJustification (HDC hdc, INT extra, INT breaks) DECLSPEC_HIDDEN
 
BOOL METADC_SetViewportExtEx (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_SetViewportOrgEx (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_SetWindowExtEx (HDC hdc, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_SetWindowOrgEx (HDC, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL METADC_StretchBlt (HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop)
 
BOOL METADC_StretchDIBits (HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, INT x_src, INT y_src, INT width_src, INT height_src, const void *bits, const BITMAPINFO *info, UINT coloruse, DWORD rop) DECLSPEC_HIDDEN
 
BOOL EMFDC_AbortPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_AlphaBlend (LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, BLENDFUNCTION blend_function)
 
BOOL EMFDC_AngleArc (LDC *dc_attr, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep) DECLSPEC_HIDDEN
 
BOOL EMFDC_ArcChordPie (LDC *dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend, DWORD type) DECLSPEC_HIDDEN
 
BOOL EMFDC_BeginPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_BitBlt (LDC *dc_attr, INT x_dst, INT y_dst, INT width, INT height, HDC hdc_src, INT x_src, INT y_src, DWORD rop)
 
BOOL EMFDC_CloseFigure (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_DeleteDC (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_Ellipse (LDC *dc_attr, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDC_EndPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_ExcludeClipRect (LDC *dc_attr, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDC_ExtFloodFill (LDC *dc_attr, INT x, INT y, COLORREF color, UINT fill_type) DECLSPEC_HIDDEN
 
BOOL EMFDC_ExtSelectClipRgn (LDC *dc_attr, HRGN hrgn, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_ExtTextOut (LDC *dc_attr, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx) DECLSPEC_HIDDEN
 
BOOL EMFDC_FillPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_FillRgn (LDC *dc_attr, HRGN hrgn, HBRUSH hbrush) DECLSPEC_HIDDEN
 
BOOL EMFDC_FlattenPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_FrameRgn (LDC *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width, INT height) DECLSPEC_HIDDEN
 
BOOL EMFDC_GradientFill (LDC *dc_attr, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_IntersectClipRect (LDC *dc_attr, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDC_InvertRgn (LDC *dc_attr, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL EMFDC_LineTo (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_ModifyWorldTransform (LDC *dc_attr, const XFORM *xform, DWORD mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_MoveTo (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_OffsetClipRgn (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_PaintRgn (LDC *dc_attr, HRGN hrgn) DECLSPEC_HIDDEN
 
BOOL EMFDC_PatBlt (LDC *dc_attr, INT left, INT top, INT width, INT height, DWORD rop)
 
BOOL EMFDC_PolyBezier (LDC *dc_attr, const POINT *points, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDC_PolyBezierTo (LDC *dc_attr, const POINT *points, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDC_PolyDraw (LDC *dc_attr, const POINT *points, const BYTE *types, DWORD count) DECLSPEC_HIDDEN
 
BOOL EMFDC_PolyPolyline (LDC *dc_attr, const POINT *points, const DWORD *counts, DWORD polys) DECLSPEC_HIDDEN
 
BOOL EMFDC_PolyPolygon (LDC *dc_attr, const POINT *points, const INT *counts, UINT polys) DECLSPEC_HIDDEN
 
BOOL EMFDC_Polygon (LDC *dc_attr, const POINT *points, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDC_Polyline (LDC *dc_attr, const POINT *points, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDC_PolylineTo (LDC *dc_attr, const POINT *points, INT count) DECLSPEC_HIDDEN
 
BOOL EMFDC_Rectangle (LDC *dc_attr, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN
 
BOOL EMFDC_RestoreDC (LDC *dc_attr, INT level) DECLSPEC_HIDDEN
 
BOOL EMFDC_RoundRect (LDC *dc_attr, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height) DECLSPEC_HIDDEN
 
BOOL EMFDC_SaveDC (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_ScaleViewportExtEx (LDC *dc_attr, INT x_num, INT x_denom, INT y_num, INT y_denom) DECLSPEC_HIDDEN
 
BOOL EMFDC_ScaleWindowExtEx (LDC *dc_attr, INT x_num, INT x_denom, INT y_num, INT y_denom) DECLSPEC_HIDDEN
 
BOOL EMFDC_SelectClipPath (LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_SelectObject (LDC *dc_attr, HGDIOBJ obj) DECLSPEC_HIDDEN
 
BOOL EMFDC_SelectPalette (LDC *dc_attr, HPALETTE palette) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetArcDirection (LDC *dc_attr, INT dir) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetBkColor (LDC *dc_attr, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetBkMode (LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetDCBrushColor (LDC *dc_attr, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetDCPenColor (LDC *dc_attr, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetDIBitsToDevice (LDC *dc_attr, INT x_dest, INT y_dest, DWORD width, DWORD height, INT x_src, INT y_src, UINT startscan, UINT lines, const void *bits, const BITMAPINFO *info, UINT coloruse) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetLayout (LDC *dc_attr, DWORD layout) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetMapMode (LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetMapperFlags (LDC *dc_attr, DWORD flags) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetPixel (LDC *dc_attr, INT x, INT y, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetPolyFillMode (LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetROP2 (LDC *dc_attr, INT rop) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetStretchBltMode (LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetTextAlign (LDC *dc_attr, UINT align) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetTextColor (LDC *dc_attr, COLORREF color) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetTextJustification (LDC *dc_attr, INT extra, INT breaks) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetViewportExtEx (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetViewportOrgEx (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetWindowExtEx (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetWindowOrgEx (LDC *dc_attr, INT x, INT y) DECLSPEC_HIDDEN
 
BOOL EMFDC_SetWorldTransform (LDC *dc_attr, const XFORM *xform) DECLSPEC_HIDDEN
 
BOOL EMFDC_StretchBlt (LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop)
 
BOOL EMFDC_StretchDIBits (LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, INT x_src, INT y_src, INT width_src, INT height_src, const void *bits, const BITMAPINFO *info, UINT coloruse, DWORD rop) DECLSPEC_HIDDEN
 
BOOL EMFDC_StrokeAndFillPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_StrokePath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_WidenPath (LDC *dc_attr) DECLSPEC_HIDDEN
 
BOOL EMFDC_MaskBlt (LDC *dc_attr, INT xDest, INT yDest, INT cx, INT cy, HDC hdcSrc, INT xSrc, INT ySrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop)
 
BOOL EMFDC_PlgBlt (LDC *dc_attr, const POINT *ppt, HDC hdcSrc, INT xSrc, INT ySrc, INT cx, INT cy, HBITMAP hbmMask, INT xMask, INT yMask)
 
BOOL EMFDC_TransparentBlt (LDC *dc_attr, INT xDst, INT yDst, INT cxDst, INT cyDst, HDC hdcSrc, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, UINT crTransparent)
 
BOOL EMFDC_SetBrushOrg (LDC *dc_attr, INT x, INT y)
 
BOOL EMFDC_SetMetaRgn (LDC *dc_attr)
 
BOOL EMFDC_WriteNamedEscape (LDC *dc_attr, PWCHAR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData)
 
BOOL EMFDC_WriteEscape (LDC *dc_attr, INT nEscape, INT cbInput, LPSTR lpszInData, DWORD emrType)
 
FORCEINLINE BOOL EMFDC_Arc (PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
FORCEINLINE BOOL EMFDC_ArcTo (PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
FORCEINLINE BOOL EMFDC_Chord (PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
FORCEINLINE BOOL EMFDC_Pie (PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
BOOL WINAPI EMFDC_GdiComment (HDC hdc, UINT bytes, const BYTE *buffer)
 

Variables

PGDI_TABLE_ENTRY GdiHandleTable
 
PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable
 
HANDLE hProcessHeap
 
HANDLE CurrentProcessId
 
DWORD GDI_BatchLimit
 
PDEVCAPS GdiDevCaps
 
BOOL gbLpk
 
HANDLE ghSpooler
 
RTL_CRITICAL_SECTION semLocal
 
HINSTANCE hLpk
 
LPKETO LpkExtTextOut
 
LPKGCP LpkGetCharacterPlacement
 
LPKGTEP LpkGetTextExtentExPoint
 
CLOSEPRINTER fpClosePrinter
 
OPENPRINTERW fpOpenPrinterW
 
ULONG gcClientObj
 

Macro Definition Documentation

◆ FOtoF

#define FOtoF (   pfo)    (*(pfo))

Definition at line 492 of file gdi32p.h.

◆ HANDLE_EMETAFDC

#define HANDLE_EMETAFDC (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
PLDC pLDC = NULL; \
_RetType _Ret = dwError; \
{ \
return (_RetType)_Ret; \
} \
pLDC = GdiGetLDC(hdc); \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(EMFDC_##_Func(pLDC, __VA_ARGS__)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
}
#define NULL
Definition: types.h:112
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define LDC_EMFLDC
Definition: gdi_private.h:105
@ GDILoObjType_LO_METADC16_TYPE
Definition: gdi_private.h:49
@ GDILoObjType_LO_DC_TYPE
Definition: gdi_private.h:34
HDC hdc
Definition: main.c:9
Definition: ntgdihdl.h:263
INT iType
Definition: ntgdihdl.h:266

Definition at line 644 of file gdi32p.h.

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

Definition at line 74 of file gdi32p.h.

◆ HANDLE_METADC

#define HANDLE_METADC (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
{ \
return (_RetType)METADC_##_Func(hdc, __VA_ARGS__); \
} \
else \
{ \
PLDC pLDC = GdiGetLDC(hdc); \
_RetType _Ret = dwError; \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(EMFDC_##_Func(pLDC, __VA_ARGS__)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
} \
}

Definition at line 589 of file gdi32p.h.

◆ HANDLE_METADC0P

#define HANDLE_METADC0P (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
PLDC pLDC = NULL; \
_RetType _Ret = dwError; \
{ \
return (_RetType)_Ret; \
} \
pLDC = GdiGetLDC(hdc); \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(EMFDC_##_Func(pLDC)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
}

Definition at line 622 of file gdi32p.h.

◆ HANDLE_METADC16

#define HANDLE_METADC16 (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
{ \
return METADC_##_Func(hdc, __VA_ARGS__); \
} \
}

Definition at line 613 of file gdi32p.h.

◆ HANDLE_METADC1P

#define HANDLE_METADC1P (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
{ \
return (_RetType)METADC_##_Func(hdc); \
} \
else \
{ \
PLDC pLDC = GdiGetLDC(hdc); \
_RetType _Ret = dwError; \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(EMFDC_##_Func(pLDC)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
} \
}

Definition at line 666 of file gdi32p.h.

◆ LOCALFONT_COUNT

#define LOCALFONT_COUNT   10

Definition at line 171 of file gdi32p.h.

◆ LPK_ETO

#define LPK_ETO   2

◆ LPK_GCP

#define LPK_GCP   3

◆ LPK_GTEP

#define LPK_GTEP   4

◆ LPK_INIT

#define LPK_INIT   1

◆ METAFILE_DISK

#define METAFILE_DISK   2

Definition at line 77 of file gdi32p.h.

◆ METAFILE_MEMORY

#define METAFILE_MEMORY   1

Definition at line 76 of file gdi32p.h.

◆ PDEV_UMPD_ID

#define PDEV_UMPD_ID   0xFEDCBA98

Definition at line 149 of file gdi32p.h.

◆ RCAST

#define RCAST (   _Type,
  _Value 
)    (*((_Type*)&_Value))

Definition at line 89 of file gdi32p.h.

◆ ROP_USES_SOURCE

#define ROP_USES_SOURCE (   Rop)    (((Rop) << 2 ^ Rop) & 0xCC0000)

Definition at line 88 of file gdi32p.h.

◆ SAPCALLBACKDELAY

#define SAPCALLBACKDELAY   244

Definition at line 79 of file gdi32p.h.

◆ UMPDEV_NO_ESCAPE

#define UMPDEV_NO_ESCAPE   0x0002

Definition at line 151 of file gdi32p.h.

◆ UMPDEV_SUPPORT_ESCAPE

#define UMPDEV_SUPPORT_ESCAPE   0x0004

Definition at line 152 of file gdi32p.h.

Typedef Documentation

◆ ABORTPRINTER

typedef BOOL(WINAPI * ABORTPRINTER) (HANDLE)

Definition at line 178 of file gdi32p.h.

◆ CLOSEPRINTER

typedef BOOL(WINAPI * CLOSEPRINTER) (HANDLE)

Definition at line 179 of file gdi32p.h.

◆ CLOSESPOOLFILEHANDLE

typedef BOOL(WINAPI * CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE)

Definition at line 180 of file gdi32p.h.

◆ COMMITSPOOLDATA

typedef HANDLE(WINAPI * COMMITSPOOLDATA) (HANDLE, HANDLE, DWORD)

Definition at line 181 of file gdi32p.h.

◆ DOCUMENTEVENT

typedef INT(WINAPI * DOCUMENTEVENT) (HANDLE, HDC, INT, ULONG, PVOID, ULONG, PVOID)

Definition at line 202 of file gdi32p.h.

◆ DOCUMENTPROPERTIESW

typedef LONG(WINAPI * DOCUMENTPROPERTIESW) (HWND, HANDLE, LPWSTR, PDEVMODEW, PDEVMODEW, DWORD)

Definition at line 182 of file gdi32p.h.

◆ EMFPLAYPROC

typedef INT(CALLBACK * EMFPLAYPROC) (HDC hdc, INT iFunction, HANDLE hPageQuery)

Definition at line 23 of file gdi32p.h.

◆ ENDDOCPRINTER

typedef BOOL(WINAPI * ENDDOCPRINTER) (HANDLE)

Definition at line 183 of file gdi32p.h.

◆ ENDPAGEPRINTER

typedef BOOL(WINAPI * ENDPAGEPRINTER) (HANDLE)

Definition at line 184 of file gdi32p.h.

◆ ENHMETAFILE

◆ GETPRINTERDRIVERW

typedef BOOL(WINAPI * GETPRINTERDRIVERW) (HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD)

Definition at line 186 of file gdi32p.h.

◆ GETPRINTERW

typedef BOOL(WINAPI * GETPRINTERW) (HANDLE, DWORD, LPBYTE, DWORD, LPDWORD)

Definition at line 185 of file gdi32p.h.

◆ GETSPOOLFILEHANDLE

typedef HANDLE(WINAPI * GETSPOOLFILEHANDLE) (HANDLE)

Definition at line 187 of file gdi32p.h.

◆ ISVALIDDEVMODEW

typedef BOOL(WINAPI * ISVALIDDEVMODEW) (PDEVMODEW, size_t)

Definition at line 188 of file gdi32p.h.

◆ LOCALFONT

◆ LPKETO

typedef BOOL(WINAPI * LPKETO) (HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)

◆ LPKGCP

typedef DWORD(WINAPI * LPKGCP) (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)

◆ LPKGTEP

typedef BOOL(WINAPI * LPKGTEP) (HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)

◆ METAFILEDC

◆ MF_ENTRY

◆ OPENPRINTERW

typedef BOOL(WINAPI * OPENPRINTERW) (LPWSTR, PHANDLE, LPPRINTER_DEFAULTSW)

Definition at line 189 of file gdi32p.h.

◆ PENHMETAFILE

◆ PLOCALFONT

◆ PMETAFILEDC

◆ PMF_ENTRY

◆ PUMPDEV

typedef struct _UMPDEV * PUMPDEV

◆ QUERYCOLORPROFILE

typedef BOOL(WINAPI * QUERYCOLORPROFILE) (HANDLE, PDEVMODEW, ULONG, VOID *, ULONG, FLONG)

Definition at line 204 of file gdi32p.h.

◆ QUERYREMOTEFONTS

typedef DWORD(WINAPI * QUERYREMOTEFONTS) (DWORD, DWORD, DWORD)

Definition at line 207 of file gdi32p.h.

◆ QUERYSPOOLMODE

typedef DWORD(WINAPI * QUERYSPOOLMODE) (HANDLE, DWORD, DWORD)

Definition at line 206 of file gdi32p.h.

◆ READPRINTER

typedef BOOL(WINAPI * READPRINTER) (HANDLE, PVOID, DWORD, PDWORD)

Definition at line 190 of file gdi32p.h.

◆ RESETPRINTERW

typedef BOOL(WINAPI * RESETPRINTERW) (HANDLE, LPPRINTER_DEFAULTSW)

Definition at line 191 of file gdi32p.h.

◆ SEEKPRINTER

typedef BOOL(WINAPI * SEEKPRINTER) (HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL)

Definition at line 196 of file gdi32p.h.

◆ SPLDRIVERUNLOADCOMPLETE

typedef BOOL(WINAPI * SPLDRIVERUNLOADCOMPLETE) (LPWSTR)

Definition at line 199 of file gdi32p.h.

◆ SPLREADPRINTER

typedef BOOL(WINAPI * SPLREADPRINTER) (HANDLE, LPBYTE *, DWORD)

Definition at line 197 of file gdi32p.h.

◆ STARTDOCDLGW

typedef LPWSTR(WINAPI * STARTDOCDLGW) (HANDLE, DOCINFOW *)

Definition at line 192 of file gdi32p.h.

◆ STARTDOCPRINTERW

typedef DWORD(WINAPI * STARTDOCPRINTERW) (HANDLE, DWORD, PBYTE)

Definition at line 193 of file gdi32p.h.

◆ STARTPAGEPRINTER

typedef BOOL(WINAPI * STARTPAGEPRINTER) (HANDLE)

Definition at line 194 of file gdi32p.h.

◆ UMPDEV

Function Documentation

◆ _lrintf()

FORCEINLINE int _lrintf ( float  f)

Definition at line 498 of file gdi32p.h.

499{
500#if defined(_M_IX86) && defined(__GNUC__)
501 int result;
502 __asm__ __volatile__ ("fistpl %0" : "=m" (result) : "t" (f) : "st");
503 return result;
504#elif defined(_M_IX86) && defined(_MSC_VER)
505 int result;
506 __asm
507 {
508 fld f;
509 fistp result;
510 }
511#else
512 /* slow, but portable */
513 return (int)(f >= 0 ? f+0.5 : f-0.5);
514#endif
515}
GLfloat f
Definition: glext.h:7540
GLuint64EXT * result
Definition: glext.h:11304
#define f
Definition: ke_i.h:83
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by GdiTransformPoints2().

◆ CalculateColorTableSize()

BOOL WINAPI CalculateColorTableSize ( CONST BITMAPINFOHEADER BitmapInfoHeader,
UINT ColorSpec,
UINT ColorTableSize 
)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 32 of file utils.c.

36{
37 WORD BitCount;
38 DWORD ClrUsed;
39 DWORD Compression;
40
41 /*
42 * At first get some basic parameters from the passed BitmapInfoHeader
43 * structure. It can have one of the following formats:
44 * - BITMAPCOREHEADER (the oldest one with totally different layout
45 * from the others)
46 * - BITMAPINFOHEADER (the standard and most common header)
47 * - BITMAPV4HEADER (extension of BITMAPINFOHEADER)
48 * - BITMAPV5HEADER (extension of BITMAPV4HEADER)
49 */
50
51 if (BitmapInfoHeader->biSize == sizeof(BITMAPCOREHEADER))
52 {
53 BitCount = ((LPBITMAPCOREHEADER)BitmapInfoHeader)->bcBitCount;
54 ClrUsed = 0;
55 Compression = BI_RGB;
56 }
57 else
58 {
59 BitCount = BitmapInfoHeader->biBitCount;
60 ClrUsed = BitmapInfoHeader->biClrUsed;
61 Compression = BitmapInfoHeader->biCompression;
62 }
63
64 switch (Compression)
65 {
66 case BI_BITFIELDS:
67 if (*ColorSpec == DIB_PAL_COLORS)
68 *ColorSpec = DIB_RGB_COLORS;
69
70 if (BitCount != 16 && BitCount != 32)
71 return FALSE;
72
73 /*
74 * For BITMAPV4HEADER/BITMAPV5HEADER the masks are included in
75 * the structure itself (bV4RedMask, bV4GreenMask, and bV4BlueMask).
76 * For BITMAPINFOHEADER the color masks are stored in the palette.
77 */
78
79 if (BitmapInfoHeader->biSize > sizeof(BITMAPINFOHEADER))
80 *ColorTableSize = 0;
81 else
82 *ColorTableSize = 3;
83
84 return TRUE;
85
86 case BI_RGB:
87 switch (BitCount)
88 {
89 case 1:
90 *ColorTableSize = ClrUsed ? min(ClrUsed, 2) : 2;
91 return TRUE;
92
93 case 4:
94 *ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
95 return TRUE;
96
97 case 8:
98 *ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
99 return TRUE;
100
101 default:
102 if (*ColorSpec == DIB_PAL_COLORS)
103 *ColorSpec = DIB_RGB_COLORS;
104 if (BitCount != 16 && BitCount != 24 && BitCount != 32)
105 return FALSE;
106 *ColorTableSize = ClrUsed;
107 return TRUE;
108 }
109
110 case BI_RLE4:
111 if (BitCount == 4)
112 {
113 *ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
114 return TRUE;
115 }
116 return FALSE;
117
118 case BI_RLE8:
119 if (BitCount == 8)
120 {
121 *ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
122 return TRUE;
123 }
124 return FALSE;
125
126 case BI_JPEG:
127 case BI_PNG:
128 *ColorTableSize = ClrUsed;
129 return TRUE;
130
131 default:
132 return FALSE;
133 }
134}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define BI_RLE4
Definition: precomp.h:57
#define BI_RGB
Definition: precomp.h:56
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define BI_BITFIELDS
Definition: mmreg.h:507
#define min(a, b)
Definition: monoChain.cc:55
#define DIB_RGB_COLORS
Definition: wingdi.h:367
struct tagBITMAPCOREHEADER * LPBITMAPCOREHEADER
#define DIB_PAL_COLORS
Definition: wingdi.h:366
#define BI_JPEG
Definition: wingdi.h:38
#define BI_PNG
Definition: wingdi.h:39
#define BI_RLE8
Definition: wingdi.h:35

Referenced by ConvertBitmapInfo().

◆ ConvertBitmapInfo()

LPBITMAPINFO WINAPI ConvertBitmapInfo ( CONST BITMAPINFO BitmapInfo,
UINT  ColorSpec,
UINT BitmapInfoSize,
BOOL  FollowedByData 
)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 178 of file utils.c.

183{
184 LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
185 LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
186 DWORD Size = 0;
187 ULONG DataSize = 0;
188 UINT PaletteEntryCount = 0;
189
190 /*
191 * At first check if the passed BitmapInfo structure has valid size. It
192 * can have one of these headers: BITMAPCOREHEADER, BITMAPINFOHEADER,
193 * BITMAPV4HEADER or BITMAPV5HEADER (see CalculateColorTableSize for
194 * description).
195 */
196
197 if ( !BitmapInfo ||
198 (BitmapInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER) &&
199 (BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER) ||
200 BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
201 {
202 return NULL;
203 }
204
205 /*
206 * Now calculate the color table size. Also if the bitmap info contains
207 * invalid color information it's rejected here.
208 */
209
210 if (!CalculateColorTableSize(&BitmapInfo->bmiHeader, &ColorSpec,
211 &PaletteEntryCount))
212 {
213 return NULL;
214 }
215
216 /*
217 * Calculate the size of image data if applicable. We must be careful
218 * to do proper aligning on line ends.
219 */
220
221 if (FollowedByData)
222 {
224 }
225
226 /*
227 * If BitmapInfo was originally BITMAPCOREINFO then we need to convert
228 * it to the standard BITMAPINFO layout.
229 */
230
231 if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
232 {
233 Size = sizeof(BITMAPINFOHEADER);
234 if (ColorSpec == DIB_RGB_COLORS)
235 Size += PaletteEntryCount * sizeof(RGBQUAD);
236 else
237 Size += PaletteEntryCount * sizeof(USHORT);
238 Size += DataSize;
239
240 NewBitmapInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
241 if (NewBitmapInfo == NULL)
242 {
243 return NULL;
244 }
245
246 NewBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
247 NewBitmapInfo->bmiHeader.biWidth = CoreBitmapInfo->bmciHeader.bcWidth;
248 NewBitmapInfo->bmiHeader.biHeight = CoreBitmapInfo->bmciHeader.bcHeight;
249 NewBitmapInfo->bmiHeader.biPlanes = CoreBitmapInfo->bmciHeader.bcPlanes;
250 NewBitmapInfo->bmiHeader.biBitCount = CoreBitmapInfo->bmciHeader.bcBitCount;
251 NewBitmapInfo->bmiHeader.biCompression = BI_RGB;
252 NewBitmapInfo->bmiHeader.biSizeImage = 0;
253 NewBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
254 NewBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
255 NewBitmapInfo->bmiHeader.biClrUsed = 0;
256 NewBitmapInfo->bmiHeader.biClrImportant = 0;
257
258 if (PaletteEntryCount != 0)
259 {
260 if (ColorSpec == DIB_RGB_COLORS)
261 {
262 ULONG Index;
263
264 for (Index = 0; Index < PaletteEntryCount; Index++)
265 {
266 NewBitmapInfo->bmiColors[Index].rgbRed =
267 CoreBitmapInfo->bmciColors[Index].rgbtRed;
268 NewBitmapInfo->bmiColors[Index].rgbGreen =
269 CoreBitmapInfo->bmciColors[Index].rgbtGreen;
270 NewBitmapInfo->bmiColors[Index].rgbBlue =
271 CoreBitmapInfo->bmciColors[Index].rgbtBlue;
272 NewBitmapInfo->bmiColors[Index].rgbReserved = 0;
273 }
274 }
275 else
276 {
277 RtlCopyMemory(NewBitmapInfo->bmiColors,
278 CoreBitmapInfo->bmciColors,
279 PaletteEntryCount * sizeof(USHORT));
280 }
281 }
282
283 if (FollowedByData)
284 {
285 ULONG_PTR NewDataPtr, OldDataPtr;
286
287 if (ColorSpec == DIB_RGB_COLORS)
288 {
289 NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors +
290 PaletteEntryCount);
291 OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors +
292 PaletteEntryCount);
293 }
294 else
295 {
296 NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors) +
297 PaletteEntryCount * sizeof(USHORT);
298 OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors) +
299 PaletteEntryCount * sizeof(USHORT);
300 }
301
302 RtlCopyMemory((PVOID)NewDataPtr, (PVOID)OldDataPtr, DataSize);
303 }
304 }
305 else
306 {
307 /* Verify some data validity */
308 switch (BitmapInfo->bmiHeader.biCompression)
309 {
310 case BI_RLE8:
311 if (BitmapInfo->bmiHeader.biBitCount != 8)
312 return NULL;
313 if (BitmapInfo->bmiHeader.biHeight < 0)
314 return NULL;
315 break;
316 case BI_RLE4:
317 if (BitmapInfo->bmiHeader.biBitCount != 4)
318 return NULL;
319 if (BitmapInfo->bmiHeader.biHeight < 0)
320 return NULL;
321 break;
322 default:
323 break;
324 }
325
326 /* Non "standard" formats must have a valid size set */
327 if ((BitmapInfo->bmiHeader.biCompression != BI_RGB) &&
328 (BitmapInfo->bmiHeader.biCompression != BI_BITFIELDS))
329 {
330 if (BitmapInfo->bmiHeader.biSizeImage == 0)
331 return NULL;
332 }
333 }
334
335 Size = NewBitmapInfo->bmiHeader.biSize;
336 if (ColorSpec == DIB_RGB_COLORS)
337 Size += PaletteEntryCount * sizeof(RGBQUAD);
338 else
339 Size += PaletteEntryCount * sizeof(USHORT);
340 Size += DataSize;
341 *BitmapInfoSize = Size;
342
343 return NewBitmapInfo;
344}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
ULONG RGBQUAD
Definition: precomp.h:59
#define ULONG_PTR
Definition: config.h:101
int WINAPI GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
Definition: bitmap.c:209
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
unsigned int UINT
Definition: ndis.h:50
unsigned short USHORT
Definition: pedump.c:61
BITMAPCOREHEADER bmciHeader
Definition: wingdi.h:1453
RGBTRIPLE bmciColors[1]
Definition: wingdi.h:1454
ULONG biClrImportant
Definition: precomp.h:52
USHORT biBitCount
Definition: precomp.h:46
LONG biYPelsPerMeter
Definition: precomp.h:50
ULONG biCompression
Definition: precomp.h:47
LONG biXPelsPerMeter
Definition: precomp.h:49
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
RGBQUAD bmiColors[1]
Definition: wingdi.h:1477
UCHAR rgbReserved
Definition: bootanim.c:106
UCHAR rgbBlue
Definition: bootanim.c:103
UCHAR rgbRed
Definition: bootanim.c:105
UCHAR rgbGreen
Definition: bootanim.c:104
BYTE rgbtGreen
Definition: wingdi.h:1439
BYTE rgbtBlue
Definition: wingdi.h:1438
BYTE rgbtRed
Definition: wingdi.h:1440
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
BOOL WINAPI CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize)
Definition: utils.c:32
struct _BITMAPCOREINFO * LPBITMAPCOREINFO
struct tagBITMAPINFO * LPBITMAPINFO

Referenced by CreateDIBitmap(), CreateDIBPatternBrush(), CreateDIBPatternBrushPt(), CreateDIBSection(), ExtCreatePen(), SetDIBitsToDevice(), and StretchDIBits().

◆ DeleteRegion()

BOOL FASTCALL DeleteRegion ( HRGN  )

◆ DocumentEventEx()

int FASTCALL DocumentEventEx ( PVOID  pvUMPDev,
HANDLE  hPrinter,
HDC  hdc,
int  iEsc,
ULONG  cbIn,
PVOID  pvIn,
ULONG  cbOut,
PVOID  pvOut 
)

Definition at line 152 of file printdrv.c.

162{
163 return fpDocumentEvent(hPrinter,hdc,iEsc,cbIn,pvIn,cbOut,pvOut);
164}
static DOCUMENTEVENT fpDocumentEvent
Definition: printdrv.c:47
_In_ ULONG iEsc
Definition: winddi.h:3529

Referenced by AbortDoc(), EndDoc(), IntEndPage(), StartDocW(), and StartPage().

◆ EMFDC_AbortPath()

BOOL EMFDC_AbortPath ( LDC dc_attr)

◆ EMFDC_AlphaBlend()

BOOL EMFDC_AlphaBlend ( LDC dc_attr,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
HDC  hdc_src,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
BLENDFUNCTION  blend_function 
)

◆ EMFDC_AngleArc()

BOOL EMFDC_AngleArc ( LDC dc_attr,
INT  x,
INT  y,
DWORD  radius,
FLOAT  start,
FLOAT  sweep 
)

◆ EMFDC_Arc()

FORCEINLINE BOOL EMFDC_Arc ( PLDC  dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 885 of file gdi32p.h.

886{
887 return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_ARC );
888}
BOOL EMFDC_ArcChordPie(LDC *dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend, DWORD type) DECLSPEC_HIDDEN
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
#define EMR_ARC
Definition: wingdi.h:119

◆ EMFDC_ArcChordPie()

BOOL EMFDC_ArcChordPie ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend,
DWORD  type 
)

◆ EMFDC_ArcTo()

FORCEINLINE BOOL EMFDC_ArcTo ( PLDC  dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 890 of file gdi32p.h.

891{
892return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_ARCTO );
893}
#define EMR_ARCTO
Definition: wingdi.h:129

◆ EMFDC_BeginPath()

BOOL EMFDC_BeginPath ( LDC dc_attr)

◆ EMFDC_BitBlt()

BOOL EMFDC_BitBlt ( LDC dc_attr,
INT  x_dst,
INT  y_dst,
INT  width,
INT  height,
HDC  hdc_src,
INT  x_src,
INT  y_src,
DWORD  rop 
)

◆ EMFDC_Chord()

FORCEINLINE BOOL EMFDC_Chord ( PLDC  dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 894 of file gdi32p.h.

895{
896return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_CHORD );
897}
#define EMR_CHORD
Definition: wingdi.h:120

◆ EMFDC_CloseFigure()

BOOL EMFDC_CloseFigure ( LDC dc_attr)

◆ EMFDC_DeleteDC()

BOOL EMFDC_DeleteDC ( LDC dc_attr)

Referenced by METADC_RosGlueDeleteDC().

◆ EMFDC_Ellipse()

BOOL EMFDC_Ellipse ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

◆ EMFDC_EndPath()

BOOL EMFDC_EndPath ( LDC dc_attr)

◆ EMFDC_ExcludeClipRect()

BOOL EMFDC_ExcludeClipRect ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

◆ EMFDC_ExtFloodFill()

BOOL EMFDC_ExtFloodFill ( LDC dc_attr,
INT  x,
INT  y,
COLORREF  color,
UINT  fill_type 
)

◆ EMFDC_ExtSelectClipRgn()

BOOL EMFDC_ExtSelectClipRgn ( LDC dc_attr,
HRGN  hrgn,
INT  mode 
)

◆ EMFDC_ExtTextOut()

BOOL EMFDC_ExtTextOut ( LDC dc_attr,
INT  x,
INT  y,
UINT  flags,
const RECT rect,
const WCHAR str,
UINT  count,
const INT dx 
)

◆ EMFDC_FillPath()

BOOL EMFDC_FillPath ( LDC dc_attr)

◆ EMFDC_FillRgn()

BOOL EMFDC_FillRgn ( LDC dc_attr,
HRGN  hrgn,
HBRUSH  hbrush 
)

◆ EMFDC_FlattenPath()

BOOL EMFDC_FlattenPath ( LDC dc_attr)

◆ EMFDC_FrameRgn()

BOOL EMFDC_FrameRgn ( LDC dc_attr,
HRGN  hrgn,
HBRUSH  hbrush,
INT  width,
INT  height 
)

◆ EMFDC_GdiComment()

BOOL WINAPI EMFDC_GdiComment ( HDC  hdc,
UINT  bytes,
const BYTE buffer 
)

Definition at line 2326 of file emfdc.c.

2327{
2328 WINEDC *dc_attr;
2329 EMRGDICOMMENT *emr;
2330 UINT total, rounded_size;
2331 BOOL ret;
2332
2333 if (!(dc_attr = get_dc_ptr( hdc )) || !dc_attr->emf) return FALSE;
2334
2335 rounded_size = (bytes+3) & ~3;
2336 total = offsetof(EMRGDICOMMENT,Data) + rounded_size;
2337
2338 emr = HeapAlloc(GetProcessHeap(), 0, total);
2339 emr->emr.iType = EMR_GDICOMMENT;
2340 emr->emr.nSize = total;
2341 emr->cbData = bytes;
2342 memset(&emr->Data[bytes], 0, rounded_size - bytes);
2343 memcpy(&emr->Data[0], buffer, bytes);
2344
2345 ret = emfdc_record( dc_attr->emf, &emr->emr );
2346
2347 HeapFree(GetProcessHeap(), 0, emr);
2348
2349 return ret;
2350}
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static BOOL emfdc_record(struct emf *emf, EMR *emr)
Definition: emfdc.c:59
unsigned int BOOL
Definition: ntddk_ex.h:94
size_t total
DC * get_dc_ptr(HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:147
GLuint buffer
Definition: glext.h:5915
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define offsetof(TYPE, MEMBER)
#define memset(x, y, z)
Definition: compat.h:39
BYTE Data[1]
Definition: wingdi.h:2024
DWORD iType
Definition: wingdi.h:1690
DWORD nSize
Definition: wingdi.h:1691
int ret
#define EMR_GDICOMMENT
Definition: wingdi.h:143

Referenced by GdiComment().

◆ EMFDC_GradientFill()

BOOL EMFDC_GradientFill ( LDC dc_attr,
TRIVERTEX vert_array,
ULONG  nvert,
void grad_array,
ULONG  ngrad,
ULONG  mode 
)

◆ EMFDC_IntersectClipRect()

BOOL EMFDC_IntersectClipRect ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

◆ EMFDC_InvertRgn()

BOOL EMFDC_InvertRgn ( LDC dc_attr,
HRGN  hrgn 
)

◆ EMFDC_LineTo()

BOOL EMFDC_LineTo ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_MaskBlt()

BOOL EMFDC_MaskBlt ( LDC dc_attr,
INT  xDest,
INT  yDest,
INT  cx,
INT  cy,
HDC  hdcSrc,
INT  xSrc,
INT  ySrc,
HBITMAP  hbmMask,
INT  xMask,
INT  yMask,
DWORD  dwRop 
)

◆ EMFDC_ModifyWorldTransform()

BOOL EMFDC_ModifyWorldTransform ( LDC dc_attr,
const XFORM xform,
DWORD  mode 
)

◆ EMFDC_MoveTo()

BOOL EMFDC_MoveTo ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_OffsetClipRgn()

BOOL EMFDC_OffsetClipRgn ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_PaintRgn()

BOOL EMFDC_PaintRgn ( LDC dc_attr,
HRGN  hrgn 
)

◆ EMFDC_PatBlt()

BOOL EMFDC_PatBlt ( LDC dc_attr,
INT  left,
INT  top,
INT  width,
INT  height,
DWORD  rop 
)

◆ EMFDC_Pie()

FORCEINLINE BOOL EMFDC_Pie ( PLDC  dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 899 of file gdi32p.h.

900{
901return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_PIE );
902}
#define EMR_PIE
Definition: wingdi.h:121

◆ EMFDC_PlgBlt()

BOOL EMFDC_PlgBlt ( LDC dc_attr,
const POINT ppt,
HDC  hdcSrc,
INT  xSrc,
INT  ySrc,
INT  cx,
INT  cy,
HBITMAP  hbmMask,
INT  xMask,
INT  yMask 
)

◆ EMFDC_PolyBezier()

BOOL EMFDC_PolyBezier ( LDC dc_attr,
const POINT points,
DWORD  count 
)

◆ EMFDC_PolyBezierTo()

BOOL EMFDC_PolyBezierTo ( LDC dc_attr,
const POINT points,
DWORD  count 
)

◆ EMFDC_PolyDraw()

BOOL EMFDC_PolyDraw ( LDC dc_attr,
const POINT points,
const BYTE types,
DWORD  count 
)

◆ EMFDC_Polygon()

BOOL EMFDC_Polygon ( LDC dc_attr,
const POINT points,
INT  count 
)

◆ EMFDC_Polyline()

BOOL EMFDC_Polyline ( LDC dc_attr,
const POINT points,
INT  count 
)

◆ EMFDC_PolylineTo()

BOOL EMFDC_PolylineTo ( LDC dc_attr,
const POINT points,
INT  count 
)

◆ EMFDC_PolyPolygon()

BOOL EMFDC_PolyPolygon ( LDC dc_attr,
const POINT points,
const INT counts,
UINT  polys 
)

◆ EMFDC_PolyPolyline()

BOOL EMFDC_PolyPolyline ( LDC dc_attr,
const POINT points,
const DWORD counts,
DWORD  polys 
)

◆ EMFDC_Rectangle()

BOOL EMFDC_Rectangle ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

◆ EMFDC_RestoreDC()

BOOL EMFDC_RestoreDC ( LDC dc_attr,
INT  level 
)

◆ EMFDC_RoundRect()

BOOL EMFDC_RoundRect ( LDC dc_attr,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  ell_width,
INT  ell_height 
)

◆ EMFDC_SaveDC()

BOOL EMFDC_SaveDC ( LDC dc_attr)

◆ EMFDC_ScaleViewportExtEx()

BOOL EMFDC_ScaleViewportExtEx ( LDC dc_attr,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

◆ EMFDC_ScaleWindowExtEx()

BOOL EMFDC_ScaleWindowExtEx ( LDC dc_attr,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

◆ EMFDC_SelectClipPath()

BOOL EMFDC_SelectClipPath ( LDC dc_attr,
INT  mode 
)

◆ EMFDC_SelectObject()

BOOL EMFDC_SelectObject ( LDC dc_attr,
HGDIOBJ  obj 
)

◆ EMFDC_SelectPalette()

BOOL EMFDC_SelectPalette ( LDC dc_attr,
HPALETTE  palette 
)

Referenced by SelectPalette().

◆ EMFDC_SetArcDirection()

BOOL EMFDC_SetArcDirection ( LDC dc_attr,
INT  dir 
)

Referenced by EMFDC_SetD().

◆ EMFDC_SetBkColor()

BOOL EMFDC_SetBkColor ( LDC dc_attr,
COLORREF  color 
)

◆ EMFDC_SetBkMode()

BOOL EMFDC_SetBkMode ( LDC dc_attr,
INT  mode 
)

◆ EMFDC_SetBrushOrg()

BOOL EMFDC_SetBrushOrg ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_SetD()

BOOL WINAPI EMFDC_SetD ( _In_ PLDC  pldc,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId 
)

Definition at line 331 of file rosglue.c.

335{
336 switch(ulMFId)
337 {
338 case EMR_SETMAPMODE:
339 return EMFDC_SetMapMode( pldc, dwIn);
341 return EMFDC_SetArcDirection( pldc, dwIn);
342 default:
343 return FALSE;
344 }
345}
BOOL EMFDC_SetMapMode(LDC *dc_attr, INT mode) DECLSPEC_HIDDEN
BOOL EMFDC_SetArcDirection(LDC *dc_attr, INT dir) DECLSPEC_HIDDEN
_In_ UINT _In_ DWORD dwIn
Definition: ntgdi.h:249
#define EMR_SETARCDIRECTION
Definition: wingdi.h:131
#define EMR_SETMAPMODE
Definition: wingdi.h:91

Referenced by GetAndSetDCDWord().

◆ EMFDC_SetDCBrushColor()

BOOL EMFDC_SetDCBrushColor ( LDC dc_attr,
COLORREF  color 
)

◆ EMFDC_SetDCPenColor()

BOOL EMFDC_SetDCPenColor ( LDC dc_attr,
COLORREF  color 
)

◆ EMFDC_SetDIBitsToDevice()

BOOL EMFDC_SetDIBitsToDevice ( LDC dc_attr,
INT  x_dest,
INT  y_dest,
DWORD  width,
DWORD  height,
INT  x_src,
INT  y_src,
UINT  startscan,
UINT  lines,
const void bits,
const BITMAPINFO info,
UINT  coloruse 
)

◆ EMFDC_SetLayout()

BOOL EMFDC_SetLayout ( LDC dc_attr,
DWORD  layout 
)

◆ EMFDC_SetMapMode()

BOOL EMFDC_SetMapMode ( LDC dc_attr,
INT  mode 
)

Referenced by EMFDC_SetD().

◆ EMFDC_SetMapperFlags()

BOOL EMFDC_SetMapperFlags ( LDC dc_attr,
DWORD  flags 
)

◆ EMFDC_SetMetaRgn()

BOOL EMFDC_SetMetaRgn ( LDC dc_attr)

Referenced by SetMetaRgn().

◆ EMFDC_SetPixel()

BOOL EMFDC_SetPixel ( LDC dc_attr,
INT  x,
INT  y,
COLORREF  color 
)

◆ EMFDC_SetPolyFillMode()

BOOL EMFDC_SetPolyFillMode ( LDC dc_attr,
INT  mode 
)

◆ EMFDC_SetROP2()

BOOL EMFDC_SetROP2 ( LDC dc_attr,
INT  rop 
)

◆ EMFDC_SetStretchBltMode()

BOOL EMFDC_SetStretchBltMode ( LDC dc_attr,
INT  mode 
)

◆ EMFDC_SetTextAlign()

BOOL EMFDC_SetTextAlign ( LDC dc_attr,
UINT  align 
)

◆ EMFDC_SetTextColor()

BOOL EMFDC_SetTextColor ( LDC dc_attr,
COLORREF  color 
)

◆ EMFDC_SetTextJustification()

BOOL EMFDC_SetTextJustification ( LDC dc_attr,
INT  extra,
INT  breaks 
)

◆ EMFDC_SetViewportExtEx()

BOOL EMFDC_SetViewportExtEx ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_SetViewportOrgEx()

BOOL EMFDC_SetViewportOrgEx ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_SetWindowExtEx()

BOOL EMFDC_SetWindowExtEx ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_SetWindowOrgEx()

BOOL EMFDC_SetWindowOrgEx ( LDC dc_attr,
INT  x,
INT  y 
)

◆ EMFDC_SetWorldTransform()

BOOL EMFDC_SetWorldTransform ( LDC dc_attr,
const XFORM xform 
)

◆ EMFDC_StretchBlt()

BOOL EMFDC_StretchBlt ( LDC dc_attr,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
HDC  hdc_src,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
DWORD  rop 
)

◆ EMFDC_StretchDIBits()

BOOL EMFDC_StretchDIBits ( LDC dc_attr,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
const void bits,
const BITMAPINFO info,
UINT  coloruse,
DWORD  rop 
)

◆ EMFDC_StrokeAndFillPath()

BOOL EMFDC_StrokeAndFillPath ( LDC dc_attr)

◆ EMFDC_StrokePath()

BOOL EMFDC_StrokePath ( LDC dc_attr)

◆ EMFDC_TransparentBlt()

BOOL EMFDC_TransparentBlt ( LDC dc_attr,
INT  xDst,
INT  yDst,
INT  cxDst,
INT  cyDst,
HDC  hdcSrc,
INT  xSrc,
INT  ySrc,
INT  cxSrc,
INT  cySrc,
UINT  crTransparent 
)

◆ EMFDC_WidenPath()

BOOL EMFDC_WidenPath ( LDC dc_attr)

◆ EMFDC_WriteEscape()

BOOL EMFDC_WriteEscape ( LDC dc_attr,
INT  nEscape,
INT  cbInput,
LPSTR  lpszInData,
DWORD  emrType 
)

◆ EMFDC_WriteNamedEscape()

BOOL EMFDC_WriteNamedEscape ( LDC dc_attr,
PWCHAR  pDriver,
INT  nEscape,
INT  cbInput,
LPCSTR  lpszInData 
)

◆ EndPagePrinterEx()

BOOL FASTCALL EndPagePrinterEx ( PVOID  pvUMPDev,
HANDLE  hPrinter 
)

Definition at line 178 of file printdrv.c.

182{
183 return fpEndPagePrinter(hPrinter);
184}
static ENDPAGEPRINTER fpEndPagePrinter
Definition: printdrv.c:50

Referenced by IntEndPage().

◆ EnumLogFontExW2A()

VOID WINAPI EnumLogFontExW2A ( LPENUMLOGFONTEXA  fontA,
CONST ENUMLOGFONTEXW fontW 
)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 402 of file utils.c.

403{
405
406 WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfFullName, -1,
407 (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
408 fontA->elfFullName[LF_FULLFACESIZE-1] = '\0';
409 WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfStyle, -1,
410 (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
411 fontA->elfStyle[LF_FACESIZE-1] = '\0';
412 WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfScript, -1,
413 (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
414 fontA->elfScript[LF_FACESIZE-1] = '\0';
415}
#define LF_FACESIZE
Definition: dimm.idl:39
#define WideCharToMultiByte
Definition: compat.h:111
static const WCHAR fontW[]
Definition: editor.c:78
#define CONST
Definition: pedump.c:81
VOID WINAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
Definition: utils.c:375
#define LF_FULLFACESIZE
Definition: wingdi.h:41
#define CP_THREAD_ACP
Definition: winnls.h:233
char * LPSTR
Definition: xmlstorage.h:182

Referenced by CreateFontIndirectExA(), and GetFontObjectA().

◆ FONT_TextMetricWToA()

VOID FASTCALL FONT_TextMetricWToA ( const TEXTMETRICW ptmW,
LPTEXTMETRICA  ptmA 
)

Definition at line 79 of file font.c.

80{
81 ptmA->tmHeight = ptmW->tmHeight;
82 ptmA->tmAscent = ptmW->tmAscent;
83 ptmA->tmDescent = ptmW->tmDescent;
86 ptmA->tmAveCharWidth = ptmW->tmAveCharWidth;
87 ptmA->tmMaxCharWidth = ptmW->tmMaxCharWidth;
88 ptmA->tmWeight = ptmW->tmWeight;
89 ptmA->tmOverhang = ptmW->tmOverhang;
92 ptmA->tmFirstChar = min(ptmW->tmFirstChar, 255);
93 if (ptmW->tmCharSet == SYMBOL_CHARSET)
94 {
95 ptmA->tmFirstChar = 0x1e;
96 ptmA->tmLastChar = 0xff; /* win9x behaviour - we need the OS2 table data to calculate correctly */
97 }
98 else
99 {
100 ptmA->tmFirstChar = ptmW->tmDefaultChar - 1;
101 ptmA->tmLastChar = min(ptmW->tmLastChar, 0xff);
102 }
103 ptmA->tmDefaultChar = (CHAR)ptmW->tmDefaultChar;
104 ptmA->tmBreakChar = (CHAR)ptmW->tmBreakChar;
105 ptmA->tmItalic = ptmW->tmItalic;
106 ptmA->tmUnderlined = ptmW->tmUnderlined;
107 ptmA->tmStruckOut = ptmW->tmStruckOut;
109 ptmA->tmCharSet = ptmW->tmCharSet;
110}
#define CHAR(Char)
BYTE tmStruckOut
Definition: wingdi.h:2378
BYTE tmPitchAndFamily
Definition: wingdi.h:2379
BYTE tmCharSet
Definition: wingdi.h:2380
LONG tmDescent
Definition: wingdi.h:2363
LONG tmDigitizedAspectX
Definition: wingdi.h:2370
BYTE tmFirstChar
Definition: wingdi.h:2372
LONG tmExternalLeading
Definition: wingdi.h:2365
LONG tmWeight
Definition: wingdi.h:2368
BYTE tmBreakChar
Definition: wingdi.h:2375
LONG tmInternalLeading
Definition: wingdi.h:2364
BYTE tmLastChar
Definition: wingdi.h:2373
BYTE tmUnderlined
Definition: wingdi.h:2377
LONG tmMaxCharWidth
Definition: wingdi.h:2367
LONG tmAveCharWidth
Definition: wingdi.h:2366
BYTE tmDefaultChar
Definition: wingdi.h:2374
LONG tmAscent
Definition: wingdi.h:2362
LONG tmOverhang
Definition: wingdi.h:2369
LONG tmHeight
Definition: wingdi.h:2361
BYTE tmItalic
Definition: wingdi.h:2376
LONG tmDigitizedAspectY
Definition: wingdi.h:2371
WCHAR tmFirstChar
Definition: wingdi.h:2394
LONG tmDigitizedAspectX
Definition: wingdi.h:2392
LONG tmDigitizedAspectY
Definition: wingdi.h:2393
LONG tmOverhang
Definition: wingdi.h:2391
LONG tmAveCharWidth
Definition: wingdi.h:2388
LONG tmAscent
Definition: wingdi.h:2384
LONG tmMaxCharWidth
Definition: wingdi.h:2389
BYTE tmItalic
Definition: wingdi.h:2398
BYTE tmStruckOut
Definition: wingdi.h:2400
LONG tmInternalLeading
Definition: wingdi.h:2386
BYTE tmUnderlined
Definition: wingdi.h:2399
LONG tmExternalLeading
Definition: wingdi.h:2387
BYTE tmPitchAndFamily
Definition: wingdi.h:2401
LONG tmWeight
Definition: wingdi.h:2390
WCHAR tmBreakChar
Definition: wingdi.h:2397
WCHAR tmDefaultChar
Definition: wingdi.h:2396
BYTE tmCharSet
Definition: wingdi.h:2402
WCHAR tmLastChar
Definition: wingdi.h:2395
LONG tmHeight
Definition: wingdi.h:2383
LONG tmDescent
Definition: wingdi.h:2385
#define SYMBOL_CHARSET
Definition: wingdi.h:385
char CHAR
Definition: xmlstorage.h:175

Referenced by GetOutlineTextMetricsA(), GetTextMetricsA(), and NewTextMetricW2A().

◆ GdiAddFontResourceW()

int WINAPI GdiAddFontResourceW ( LPCWSTR  lpszFilename,
FLONG  fl,
DESIGNVECTOR pdv 
)

Definition at line 2404 of file font.c.

2408{
2409 INT Ret;
2410 WCHAR lpszBuffer[MAX_PATH];
2411 WCHAR lpszAbsPath[MAX_PATH];
2412 UNICODE_STRING NtAbsPath;
2413
2414 /* FIXME: We don't support multiple files passed in lpszFilename
2415 * as L"abcxxxxx.pfm|abcxxxxx.pfb"
2416 */
2417
2418 /* Does the file exist in CurrentDirectory or in the Absolute Path passed? */
2419 GetCurrentDirectoryW(MAX_PATH, lpszBuffer);
2420
2421 if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2422 {
2423 /* Nope. Then let's check Fonts folder */
2424 GetWindowsDirectoryW(lpszBuffer, MAX_PATH);
2425 StringCbCatW(lpszBuffer, sizeof(lpszBuffer), L"\\Fonts");
2426
2427 if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2428 {
2429 DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S\n", lpszBuffer, lpszFilename);
2430 return 0;
2431 }
2432 }
2433
2434 /* We found the font file so: */
2435 if (!RtlDosPathNameToNtPathName_U(lpszAbsPath, &NtAbsPath, NULL, NULL))
2436 {
2437 DPRINT1("Can't convert Path! Path: %ls\n", lpszAbsPath);
2438 return 0;
2439 }
2440
2441 /* The Nt call expects a null-terminator included in cwc param. */
2442 ASSERT(NtAbsPath.Buffer[NtAbsPath.Length / sizeof(WCHAR)] == UNICODE_NULL);
2443 Ret = NtGdiAddFontResourceW(NtAbsPath.Buffer, NtAbsPath.Length / sizeof(WCHAR) + 1, 1, fl, 0, pdv);
2444
2445 RtlFreeUnicodeString(&NtAbsPath);
2446
2447 return Ret;
2448}
INT APIENTRY NtGdiAddFontResourceW(_In_reads_(cwc) WCHAR *pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ FLONG f, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
#define DPRINT1
Definition: precomp.h:8
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
int32_t INT
Definition: typedefs.h:58
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by AddFontResourceA(), AddFontResourceExA(), AddFontResourceExW(), and AddFontResourceW().

◆ GdiAllocBatchCommand()

FORCEINLINE PVOID GdiAllocBatchCommand ( HDC  hdc,
USHORT  Cmd 
)

Definition at line 381 of file gdi32p.h.

384{
385 PTEB pTeb;
387 PGDIBATCHHDR pHdr;
388
389 /* Get a pointer to the TEB */
390 pTeb = NtCurrentTeb();
391
392 /* Check if we have a valid environment */
393 if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
394
395 /* Get the size of the entry */
396 if (Cmd == GdiBCPatBlt) cjSize = sizeof(GDIBSPATBLT);
397 else if (Cmd == GdiBCPolyPatBlt) cjSize = sizeof(GDIBSPPATBLT);
398 else if (Cmd == GdiBCTextOut) cjSize = sizeof(GDIBSTEXTOUT);
399 else if (Cmd == GdiBCExtTextOut) cjSize = sizeof(GDIBSEXTTEXTOUT);
400 else if (Cmd == GdiBCSetBrushOrg) cjSize = sizeof(GDIBSSETBRHORG);
401 else if (Cmd == GdiBCExtSelClipRgn) cjSize = sizeof(GDIBSEXTSELCLPRGN);
402 else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT);
403 else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT);
404 else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT);
405 else cjSize = 0;
406
407 /* Unsupported operation */
408 if (cjSize == 0) return NULL;
409
410 /* Do we use a DC? */
411 if (hdc)
412 {
413 /* If the batch DC is NULL, we set this one as the new one */
414 if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
415
416 /* If not, check if the batch DC equal to our DC */
417 else if (pTeb->GdiTebBatch.HDC != hdc) return NULL;
418 }
419
420 /* Check if the buffer is full */
421 if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
423 {
424 /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
425 the current batch */
426 NtGdiFlush();
427
428 // If Flushed, lose the hDC for this batch job! See CORE-15839.
429 if (hdc)
430 {
431 if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
432 }
433 }
434
435 /* Get the head of the entry */
436 pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
437
438 /* Update Offset and batch count */
439 pTeb->GdiTebBatch.Offset += cjSize;
440 pTeb->GdiBatchCount++;
441
442 /* Fill in the core fields */
443 pHdr->Cmd = Cmd;
444 pHdr->Size = cjSize;
445
446 return pHdr;
447}
DWORD GDI_BatchLimit
Definition: misc.c:36
#define NtCurrentTeb
__kernel_entry W32KAPI NTSTATUS APIENTRY NtGdiFlush(VOID)
Definition: gdibatch.c:471
struct _GDIBSTEXTOUT GDIBSTEXTOUT
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:200
struct _GDIBSEXTTEXTOUT GDIBSEXTTEXTOUT
struct _GDIBSOBJECT GDIBSOBJECT
struct _GDIBSEXTSELCLPRGN GDIBSEXTSELCLPRGN
struct _GDIBSPPATBLT GDIBSPPATBLT
struct _GDIBSSETBRHORG GDIBSSETBRHORG
struct _GDIBSPATBLT GDIBSPATBLT
@ GdiBCSelObj
Definition: ntgdityp.h:92
@ GdiBCPatBlt
Definition: ntgdityp.h:86
@ GdiBCDelRgn
Definition: ntgdityp.h:94
@ GdiBCDelObj
Definition: ntgdityp.h:93
@ GdiBCSetBrushOrg
Definition: ntgdityp.h:90
@ GdiBCPolyPatBlt
Definition: ntgdityp.h:87
@ GdiBCExtSelClipRgn
Definition: ntgdityp.h:91
@ GdiBCTextOut
Definition: ntgdityp.h:88
@ GdiBCExtTextOut
Definition: ntgdityp.h:89
@ Cmd
Definition: sacdrv.h:278
SHORT Size
Definition: ntgdityp.h:458
SHORT Cmd
Definition: ntgdityp.h:459
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:833
HANDLE HDC
Definition: compat.h:832
ULONG Offset
Definition: compat.h:831
Definition: compat.h:836
PVOID Win32ThreadInfo
Definition: compat.h:846
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:857
ULONG GdiBatchCount
Definition: compat.h:887
void * PVOID
Definition: typedefs.h:50
unsigned char * PUCHAR
Definition: typedefs.h:53
_In_ ULONG cjSize
Definition: winddi.h:3634

Referenced by DeleteRegion(), ExtSelectClipRgn(), ExtTextOutW(), GdiDeleteBrushOrPen(), GdiSelectFont(), PatBlt(), PolyPatBlt(), and SetBrushOrgEx().

◆ GdiConvertAndCheckDC()

HDC WINAPI GdiConvertAndCheckDC ( HDC  hdc)

Definition at line 403 of file dc.c.

404{
405 PLDC pldc;
408 return hdc;
409 pldc = GdiGetLDC(hdc);
410 if (pldc)
411 {
412 if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
413 if (pldc->Flags & LDC_KILL_DOCUMENT) return NULL;
414 if (pldc->Flags & LDC_STARTPAGE) StartPage(hdc);
415 return hdc;
416 }
418 return NULL;
419}
#define SetLastError(x)
Definition: compat.h:752
VOID GdiSAPCallback(PLDC pldc)
Definition: misc.c:819
#define LDC_KILL_DOCUMENT
Definition: ntgdihdl.h:158
#define LDC_SAPCALLBACK
Definition: ntgdihdl.h:150
#define LDC_STARTPAGE
Definition: ntgdihdl.h:153
ULONG Flags
Definition: ntgdihdl.h:265
int WINAPI StartPage(_In_ HDC)

Referenced by AngleArc(), Arc(), ArcTo(), BitBlt(), Chord(), Ellipse(), ExtFloodFill(), ExtTextOutW(), FillRgn(), FrameRgn(), GdiAlphaBlend(), GdiGradientFill(), GdiTransparentBlt(), InvertRgn(), LineTo(), MaskBlt(), PatBlt(), Pie(), PlgBlt(), PolyBezier(), PolyBezierTo(), PolyDraw(), Polygon(), Polyline(), PolylineTo(), PolyPolygon(), PolyPolyline(), Rectangle(), RoundRect(), SetPixel(), StretchBlt(), and StretchDIBits().

◆ GdiCreateClientObj()

HGDIOBJ WINAPI GdiCreateClientObj ( _In_ PVOID  pvObject,
_In_ GDILOOBJTYPE  eObjType 
)

Definition at line 148 of file clientobj.c.

151{
152 HGDIOBJ hobj;
153
154 /* Call win32k to create a client object handle */
155 hobj = NtGdiCreateClientObj(eObjType);
156 if (hobj == NULL)
157 {
158 return NULL;
159 }
160
161 /* Create the client object link */
162 if (!GdiCreateClientObjLink(hobj, pvObject))
163 {
165 return NULL;
166 }
167
168 return hobj;
169}
BOOL WINAPI GdiCreateClientObjLink(_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
Definition: clientobj.c:24
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiCreateClientObj(_In_ ULONG ulType)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteClientObj(_In_ HANDLE h)

Referenced by alloc_gdi_handle(), and CreateMetaFileW().

◆ GdiCreateClientObjLink()

BOOL WINAPI GdiCreateClientObjLink ( _In_ HGDIOBJ  hobj,
_In_ PVOID  pvObject 
)

Definition at line 24 of file clientobj.c.

27{
28 PCLIENTOBJLINK pcol;
29 ULONG iHashIndex;
30
31 /* Allocate a link structure */
32 pcol = HeapAlloc(GetProcessHeap(), 0, sizeof(*pcol));
33 if (pcol == NULL)
34 {
35 return FALSE;
36 }
37
38 /* Setup the link structure */
39 pcol->hobj = hobj;
40 pcol->pvObj = pvObject;
41
42 /* Calculate the hash index */
43 iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
44
45 /* Enter the critical section */
47
48 /* Insert the link structure */
49 pcol->pcolNext = gapcolHashTable[iHashIndex];
50 gapcolHashTable[iHashIndex] = pcol;
52
53 /* Leave the critical section */
55
56 return TRUE;
57}
ULONG gcClientObj
Definition: clientobj.c:11
PCLIENTOBJLINK gapcolHashTable[127]
Definition: clientobj.c:20
CRITICAL_SECTION gcsClientObjLinks
Definition: clientobj.c:10
#define _countof(array)
Definition: sndvol32.h:68
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by GDI_hdc_using_object(), and GdiCreateClientObj().

◆ GdiDeleteClientObj()

PVOID WINAPI GdiDeleteClientObj ( _In_ HGDIOBJ  hobj)

Definition at line 173 of file clientobj.c.

175{
176 PVOID pvObject;
177
178 /* Remove the client object link */
179 pvObject = GdiRemoveClientObjLink(hobj);
180 if (pvObject == NULL)
181 {
182 return NULL;
183 }
184
185 /* Call win32k to delete the handle */
186 if (!NtGdiDeleteClientObj(hobj))
187 {
188 ASSERT(FALSE);
189 }
190
191 return pvObject;
192}
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98

Referenced by CloseMetaFile(), CreateMetaFileW(), free_gdi_handle(), and METADC_DeleteDC().

◆ GdiFixUpHandle()

HGDIOBJ WINAPI GdiFixUpHandle ( HGDIOBJ  hGO)

Definition at line 734 of file misc.c.

735{
737
738 if (GDI_HANDLE_GET_UPPER(hGdiObj))
739 {
740 return hGdiObj;
741 }
742
743 /* FIXME is this right ?? */
744
746
747 /* Rebuild handle for Object */
748 return (HGDIOBJ)(((ULONG_PTR)(hGdiObj)) | (Entry->Type << GDI_ENTRY_UPPER_SHIFT));
749}
#define GDI_HANDLE_GET_UPPER(h)
Definition: gdi.h:43
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
base of all file and directory entries
Definition: entries.h:83
Definition: gdi.h:2
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33

Referenced by GetObjectW(), and SelectObject().

◆ GdiGetBitmapBitsSize()

int WINAPI GdiGetBitmapBitsSize ( BITMAPINFO lpbmi)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 209 of file bitmap.c.

211{
212 UINT Ret;
213
214 if (!lpbmi)
215 return 0;
216
217 if (lpbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
218 {
220 Ret =
222 Core->bcBitCount) * Core->bcHeight;
223 }
224 else /* assume BITMAPINFOHEADER */
225 {
226 if (!(lpbmi->bmiHeader.biCompression) || (lpbmi->bmiHeader.biCompression == BI_BITFIELDS))
227 {
229 lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes,
230 lpbmi->bmiHeader.biBitCount) * abs(lpbmi->bmiHeader.biHeight);
231 }
232 else
233 {
234 Ret = lpbmi->bmiHeader.biSizeImage;
235 }
236 }
237 return Ret;
238}
#define abs(i)
Definition: fconv.c:206
#define WIDTH_BYTES_ALIGN32(cx, bpp)
Definition: bitmap.c:55
struct tagBITMAPCOREHEADER * PBITMAPCOREHEADER

Referenced by ConvertBitmapInfo(), CreateDIBitmap(), and StretchDIBits().

◆ GdiGetClientObjLink()

PVOID WINAPI GdiGetClientObjLink ( _In_ HGDIOBJ  hobj)

Definition at line 61 of file clientobj.c.

63{
64 ULONG iHashIndex;
65 PCLIENTOBJLINK pcol;
66 PVOID pvObject = NULL;
67
68 /* Calculate the hash index */
69 iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
70
71 /* Enter the critical section */
73
74 /* Loop the link entries in this hash bucket */
75 pcol = gapcolHashTable[iHashIndex];
76 while (pcol != NULL)
77 {
78 /* Check if this is the object we want */
79 if (pcol->hobj == hobj)
80 {
81 /* Get the object pointer and bail out */
82 pvObject = pcol->pvObj;
83 break;
84 }
85
86 /* Go to the next entry */
87 pcol = pcol->pcolNext;
88 }
89
90 /* Leave the critical section */
92
93 return pvObject;
94}

Referenced by GDI_GetObjPtr(), get_dc_ptr(), and get_metadc_ptr().

◆ GdiGetCodePage()

DWORD WINAPI GdiGetCodePage ( HDC  )

◆ GdiGetDcAttr()

FORCEINLINE PDC_ATTR GdiGetDcAttr ( HDC  hdc)

Definition at line 451 of file gdi32p.h.

452{
453 GDILOOBJTYPE eDcObjType;
454 PDC_ATTR pdcattr;
455
456 /* Check DC object type */
457 eDcObjType = GDI_HANDLE_GET_TYPE(hdc);
458 if ((eDcObjType != GDILoObjType_LO_DC_TYPE) &&
459 (eDcObjType != GDILoObjType_LO_ALTDC_TYPE))
460 {
461 return NULL;
462 }
463
464 /* Get the DC attribute */
465 if (!GdiGetHandleUserData((HGDIOBJ)hdc, eDcObjType, (PVOID*)&pdcattr))
466 {
467 return NULL;
468 }
469
470 return pdcattr;
471}
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
Definition: misc.c:761
@ GDILoObjType_LO_ALTDC_TYPE
Definition: gdi_private.h:43
enum GDILoObjType GDILOOBJTYPE

Referenced by DPtoLP(), Escape(), ExtSelectClipRgn(), ExtTextOutW(), GdiGetCodePage(), GdiGetLDC(), GdiIsPlayMetafileDC(), GdiSelectBrush(), GdiSelectFont(), GdiSelectPen(), GdiSetLDC(), GetBkColor(), GetBkMode(), GetClipRgn(), GetCurrentObject(), GetCurrentPositionEx(), GetDCBrushColor(), GetDCPenColor(), GetDeviceCaps(), GetGraphicsMode(), GetHFONT(), GetLayout(), GetMapMode(), GetPolyFillMode(), GetROP2(), GetStretchBltMode(), GetTextAlign(), GetTextCharacterExtra(), GetTextColor(), GetViewportExtEx(), GetViewportOrgEx(), GetWindowExtEx(), GetWindowOrgEx(), GetWorldTransform(), LPtoDP(), ModifyWorldTransform(), MoveToEx(), OffsetViewportOrgEx(), OffsetWindowOrgEx(), PatBlt(), PolyPatBlt(), ScaleViewportExtEx(), ScaleWindowExtEx(), SetBkColor(), SetBkMode(), SetDCBrushColor(), SetDCPenColor(), SetGraphicsMode(), SetLayout(), SetLayoutWidth(), SetMapMode(), SetMapperFlags(), SetPolyFillMode(), SetROP2(), SetStretchBltMode(), SetTextAlign(), SetTextCharacterExtra(), SetTextColor(), SetTextJustification(), SetViewportExtEx(), SetViewportOrgEx(), SetWindowExtEx(), and SetWindowOrgEx().

◆ GdiGetHandleUserData()

BOOL GdiGetHandleUserData ( HGDIOBJ  hGdiObj,
DWORD  ObjectType,
PVOID UserData 
)

Definition at line 761 of file misc.c.

762{
764
765 /* Check if twe have the correct type */
766 if (GDI_HANDLE_GET_TYPE(hGdiObj) != ObjectType ||
769 {
770 return FALSE;
771 }
772
773 /* Check if we are the owner */
774 if ((HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1) != CurrentProcessId)
775 {
776 return FALSE;
777 }
778
779 *UserData = Entry->UserData;
780 return TRUE;
781}
#define GDI_HANDLE_TYPE_MASK
Definition: gdi.h:17
ObjectType
Definition: metafile.c:81
#define GDI_ENTRY_BASETYPE_MASK
Definition: ntgdihdl.h:34
HANDLE CurrentProcessId
Definition: misc.c:35

Referenced by GdiGetDcAttr(), GdiGetRgnAttr(), and hGetPEBHandle().

◆ GdiGetLDC()

PLDC FASTCALL GdiGetLDC ( HDC  hDC)

Definition at line 785 of file misc.c.

786{
787 PDC_ATTR pdcattr;
788
789 /* Get the DC attribute */
790 pdcattr = GdiGetDcAttr(hdc);
791 if (pdcattr == NULL)
792 {
793 return NULL;
794 }
795
796 /* Return the LDC pointer */
797 return pdcattr->pvLDC;
798}
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
PVOID pvLDC
Definition: ntgdihdl.h:293

Referenced by AbortDoc(), CancelDC(), DrawEscape(), EndDoc(), GDI_GetObjPtr(), GdiConvertAndCheckDC(), GdiIsMetaFileDC(), GdiIsMetaPrintDC(), get_dc_ptr(), GetAndSetDCDWord(), GetDeviceCaps(), IntEndPage(), METADC_RosGlueDeleteDC(), METADC_RosGlueDeleteObject(), SelectPalette(), SetAbortProc(), SetBrushOrgEx(), SetColorSpace(), SetDIBitsToDevice(), SetMetaRgn(), StartDocW(), and StartPage().

◆ GdiGetRgnAttr()

FORCEINLINE PRGN_ATTR GdiGetRgnAttr ( HRGN  hrgn)

Definition at line 475 of file gdi32p.h.

476{
477 PRGN_ATTR prgnattr;
478
479 /* Get the region attribute */
481 {
482 return NULL;
483 }
484
485 return prgnattr;
486}
static HRGN hrgn
@ GDILoObjType_LO_REGION_TYPE
Definition: gdi_private.h:38

Referenced by CombineRgn(), CreateRectRgn(), DeleteRegion(), ExtSelectClipRgn(), GetRgnBox(), OffsetRgn(), PtInRegion(), RectInRegion(), and SetRectRgn().

◆ GdiInitializeLanguagePack()

VOID WINAPI GdiInitializeLanguagePack ( _In_ DWORD  InitParam)

Referenced by GdiProcessSetup().

◆ GdiRemoveClientObjLink()

PVOID WINAPI GdiRemoveClientObjLink ( _In_ HGDIOBJ  hobj)

Definition at line 98 of file clientobj.c.

100{
101 PCLIENTOBJLINK pcol, *ppcol;
102 ULONG iHashIndex;
103 PVOID pvObject = NULL;
104
105 /* Calculate the hash index */
106 iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
107
108 /* Enter the critical section */
110
111 /* Loop the link entries in this hash bucket */
112 ppcol = &gapcolHashTable[iHashIndex];
113 while (*ppcol != NULL)
114 {
115 /* Get the current client object link */
116 pcol = *ppcol;
117
118 /* Check if this is the one we want */
119 if (pcol->hobj == hobj)
120 {
121 /* Update the link pointer, removing this link */
122 *ppcol = pcol->pcolNext;
123 gcClientObj--;
124
125 /* Get the object pointer */
126 pvObject = pcol->pvObj;
127
128 /* Free the link structure */
129 HeapFree(GetProcessHeap(), 0, pcol);
130
131 /* We're done */
132 break;
133 }
134
135 /* Go to the next link pointer */
136 ppcol = &(pcol->pcolNext);
137 }
138
139 /* Leave the critical section */
141
142 /* Return the object pointer, or NULL if we did not find it */
143 return pvObject;
144}

Referenced by GDI_hdc_not_using_object(), GdiDeleteClientObj(), and METADC_RosGlueDeleteObject().

◆ GdiSAPCallback()

VOID GdiSAPCallback ( PLDC  pldc)

Definition at line 819 of file misc.c.

820{
821 DWORD Time, NewTime = GetTickCount();
822
823 Time = NewTime - pldc->CallBackTick;
824
825 if ( Time < SAPCALLBACKDELAY) return;
826
827 pldc->CallBackTick = NewTime;
828
829 if ( !pldc->pAbortProc(pldc->hDC, 0) )
830 {
831 CancelDC(pldc->hDC);
832 AbortDoc(pldc->hDC);
833 }
834}
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define SAPCALLBACKDELAY
Definition: gdi32p.h:79
static PLARGE_INTEGER Time
Definition: time.c:105
DWORD CallBackTick
Definition: ntgdihdl.h:270
ABORTPROC pAbortProc
Definition: ntgdihdl.h:269
HDC hDC
Definition: ntgdihdl.h:264
BOOL WINAPI CancelDC(_In_ HDC hdc)
INT WINAPI AbortDoc(_In_ HDC hdc)

Referenced by GdiConvertAndCheckDC(), IntEndPage(), SetDIBitsToDevice(), and StartDocW().

◆ GdiSelectBrush()

HBRUSH WINAPI GdiSelectBrush ( _In_ HDC  hdc,
_In_ HBRUSH  hbr 
)

Definition at line 1428 of file dc.c.

1431{
1432 PDC_ATTR pdcattr;
1433 HBRUSH hbrOld;
1434
1435 HANDLE_METADC(HBRUSH, SelectObject, NULL, hdc, hbr);
1436
1437 /* Get the DC attribute */
1438 pdcattr = GdiGetDcAttr(hdc);
1439 if (pdcattr == NULL)
1440 {
1442 return NULL;
1443 }
1444
1445 /* Get the current brush. If it matches the new brush, we're done */
1446 hbrOld = pdcattr->hbrush;
1447 if (hbrOld == hbr)
1448 return hbrOld;
1449
1450 /* Set the new brush and update dirty flags */
1451 pdcattr->hbrush = hbr;
1452 pdcattr->ulDirty_ |= DC_BRUSH_DIRTY;
1453 return hbrOld;
1454}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:589
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:135
HANDLE hbrush
Definition: ntgdihdl.h:295
ULONG ulDirty_
Definition: ntgdihdl.h:294
HGDIOBJ WINAPI SelectObject(_In_ HDC hdc, _In_ HGDIOBJ hobj)
Definition: dc.c:1539

Referenced by SelectObject().

◆ GdiSelectFont()

HFONT WINAPI GdiSelectFont ( _In_ HDC  hdc,
_In_ HFONT  hfont 
)

Definition at line 1488 of file dc.c.

1491{
1492 PDC_ATTR pdcattr;
1493 HFONT hfontOld;
1494
1496
1497 /* Get the DC attribute */
1498 pdcattr = GdiGetDcAttr(hdc);
1499 if (pdcattr == NULL)
1500 {
1502 return NULL;
1503 }
1504
1505 /* Get the current font. If it matches the new font, we're done */
1506 hfontOld = pdcattr->hlfntNew;
1507 if (hfontOld == hfont)
1508 return hfontOld;
1509
1510 /* Set the new font and update dirty flags */
1511 pdcattr->hlfntNew = hfont;
1512 pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
1513 pdcattr->ulDirty_ |= DIRTY_CHARSET;
1514
1515 /* If the DC does not have a DIB section selected, try a batch command */
1516 if (!(pdcattr->ulDirty_ & DC_DIBSECTION))
1517 {
1518 PGDIBSOBJECT pgO;
1519
1521 if (pgO)
1522 {
1523 pgO->hgdiobj = hfont;
1524 return hfontOld;
1525 }
1526 }
1527
1528 /* We could not use the batch command, call win32k */
1529 return NtGdiSelectFont(hdc, hfont);
1530}
static HFONT hfont
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:381
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
#define DC_DIBSECTION
Definition: ntgdihdl.h:137
#define DIRTY_CHARSET
Definition: ntgdihdl.h:127
HANDLE hlfntNew
Definition: ntgdihdl.h:330
HGDIOBJ hgdiobj
Definition: ntgdityp.h:560

Referenced by SelectObject().

◆ GdiSelectPen()

HPEN WINAPI GdiSelectPen ( _In_ HDC  hdc,
_In_ HPEN  hpen 
)

Definition at line 1458 of file dc.c.

1461{
1462 PDC_ATTR pdcattr;
1463 HPEN hpenOld;
1464
1466
1467 /* Get the DC attribute */
1468 pdcattr = GdiGetDcAttr(hdc);
1469 if (pdcattr == NULL)
1470 {
1472 return NULL;
1473 }
1474
1475 /* Get the current pen. If it matches the new pen, we're done */
1476 hpenOld = pdcattr->hpen;
1477 if (hpenOld == hpen)
1478 return hpenOld;
1479
1480 /* Set the new pen and update dirty flags */
1481 pdcattr->ulDirty_ |= DC_PEN_DIRTY;
1482 pdcattr->hpen = hpen;
1483 return hpenOld;
1484}
static HPEN hpen
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:136
HANDLE hpen
Definition: ntgdihdl.h:296

Referenced by SelectObject().

◆ GdiSetLastError()

VOID WINAPI GdiSetLastError ( DWORD  dwErrCode)

Definition at line 873 of file misc.c.

874{
875 NtCurrentTeb()->LastErrorValue = (ULONG) dwErrCode;
876}

Referenced by CreateDIBitmap(), Escape(), GetDIBits(), GetTextFaceA(), GetTextFaceAliasW(), GetTextFaceW(), and TranslateCharsetInfo().

◆ GdiSetLDC()

BOOL FASTCALL GdiSetLDC ( HDC  hdc,
PVOID  pvLDC 
)

Definition at line 802 of file misc.c.

803{
804 PDC_ATTR pdcattr;
805
806 /* Get the DC attribute */
807 pdcattr = GdiGetDcAttr(hdc);
808 if (pdcattr == NULL)
809 {
810 return FALSE;
811 }
812
813 /* Set the LDC pointer */
814 pdcattr->pvLDC = pvLDC;
815 return TRUE;
816}

Referenced by alloc_dc_ptr(), and METADC_RosGlueDeleteDC().

◆ GdiValidateHandle()

BOOL WINAPI GdiValidateHandle ( HGDIOBJ  hobj)

Definition at line 712 of file misc.c.

713{
715 if ( (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
717 GDI_HANDLE_GET_TYPE(hobj) )
718 {
719 HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
720 if(pid == NULL || pid == CurrentProcessId)
721 {
722 return TRUE;
723 }
724 }
725 return FALSE;
726
727}
PVOID HANDLE
Definition: typedefs.h:73
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

Referenced by DeleteObject(), GetDIBits(), GetObjectType(), GetObjectW(), GetPixel(), GetStockObject(), MirrorRgnDC(), PolyPatBlt(), and SelectObject().

◆ GetAndSetDCDWord()

DWORD WINAPI GetAndSetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId,
_In_ USHORT  usMF16Id,
_In_ DWORD  dwError 
)

Definition at line 746 of file dc.c.

753{
754 DWORD dwResult;
755 PLDC pldc;
756
758 ulMFId != EMR_MAX + 1 )
759 {
761 {
762 return METADC_SetD( hdc, dwIn, usMF16Id );
763 }
764 pldc = GdiGetLDC(hdc);
765 if ( pldc->iType == LDC_EMFLDC)
766 {
767 if (!EMFDC_SetD( pldc, dwIn, ulMFId ))
768 return 0;
769 }
770 }
771
772 /* Call win32k to do the real work */
773 if (!NtGdiGetAndSetDCDword(hdc, u, dwIn, &dwResult))
774 {
775 return dwError;
776 }
777
778 return dwResult;
779}
BOOL WINAPI EMFDC_SetD(_In_ PLDC pldc, _In_ DWORD dwIn, _In_ ULONG ulMFId)
Definition: rosglue.c:331
BOOL WINAPI METADC_SetD(_In_ HDC hdc, _In_ DWORD dwIn, _In_ USHORT usMF16Id)
Definition: rosglue.c:312
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 * u
Definition: glfuncs.h:240

Referenced by SetArcDirection(), SetMapMode(), and SetRelAbs().

◆ GetDCDWord()

DWORD WINAPI GetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwError 
)

Definition at line 787 of file dc.c.

791{
792 DWORD dwResult;
793
794 if (!NtGdiGetDCDword(hdc, u, &dwResult))
795 {
796 return dwError;
797 }
798
799 return dwResult;
800}
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetDCDword(_In_ HDC hdc, _In_ UINT u, _Out_ DWORD *Result)

Referenced by EMFDC_RestoreDC(), GetFontLanguageInfo(), and GetObjectType().

◆ GetDCObject()

HGDIOBJ WINAPI GetDCObject ( HDC  ,
INT   
)

◆ GetETM()

BOOL WINAPI GetETM ( HDC  hdc,
EXTTEXTMETRIC petm 
)

Referenced by Escape().

◆ HEAP_alloc()

PVOID HEAP_alloc ( DWORD  len)

Definition at line 35 of file heap.c.

36{
37 /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
39 return RtlAllocateHeap ( hProcessHeap, 0, len );
40}
#define assert(x)
Definition: debug.h:53
GLenum GLsizei len
Definition: glext.h:6722
HANDLE hProcessHeap
Definition: heap.c:31

Referenced by HEAP_strdupA2W().

◆ HEAP_free()

VOID HEAP_free ( LPVOID  memory)

Definition at line 63 of file heap.c.

64{
65 /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
67
69}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
static char memory[1024 *256]
Definition: process.c:116

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateDCA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), RemoveFontResourceExA(), and ResetDCA().

◆ HEAP_strdupA2W()

NTSTATUS HEAP_strdupA2W ( LPWSTR ppszW,
LPCSTR  lpszA 
)

Definition at line 43 of file heap.c.

44{
45 ULONG len;
47
48 *ppszW = NULL;
49 if ( !lpszA )
50 return STATUS_SUCCESS;
51 len = lstrlenA(lpszA);
52
53 *ppszW = HEAP_alloc ( (len+1) * sizeof(WCHAR) );
54 if ( !*ppszW )
55 return STATUS_NO_MEMORY;
56 Status = RtlMultiByteToUnicodeN ( *ppszW, len*sizeof(WCHAR), NULL, (PCHAR)lpszA, len );
57 (*ppszW)[len] = L'\0';
58 return Status;
59}
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:62
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_SUCCESS
Definition: shellext.h:65
char * PCHAR
Definition: typedefs.h:51
PVOID HEAP_alloc(DWORD len)
Definition: heap.c:35

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), and RemoveFontResourceExA().

◆ hGetPEBHandle()

HGDIOBJ FASTCALL hGetPEBHandle ( HANDLECACHETYPE  Type,
COLORREF  cr 
)

Definition at line 880 of file misc.c.

881{
882 int Number, Offset, MaxNum, GdiType;
883 HANDLE Lock;
885
887 NtCurrentTeb(),
888 NULL );
889
890 if (Lock) return Handle;
891
893
894 if (Type == hctBrushHandle)
895 {
896 Offset = 0;
897 MaxNum = CACHE_BRUSH_ENTRIES;
899 }
900 else if (Type == hctPenHandle)
901 {
903 MaxNum = CACHE_PEN_ENTRIES;
904 GdiType = GDILoObjType_LO_PEN_TYPE;
905 }
906 else if (Type == hctRegionHandle)
907 {
909 MaxNum = CACHE_REGION_ENTRIES;
911 }
912 else // Font is not supported here.
913 {
914 return Handle;
915 }
916
917 if ( Number && Number <= MaxNum )
918 {
919 PBRUSH_ATTR pBrush_Attr;
920 HGDIOBJ *hPtr;
921 hPtr = GdiHandleCache->Handle + Offset;
922 Handle = hPtr[Number - 1];
923
924 if (GdiGetHandleUserData( Handle, GdiType, (PVOID) &pBrush_Attr))
925 {
926 if (pBrush_Attr->AttrFlags & ATTR_CACHED)
927 {
928 DPRINT("Get Handle! Type %d Count %lu PEB 0x%p\n", Type, GdiHandleCache->ulNumHandles[Type], NtCurrentTeb()->ProcessEnvironmentBlock);
929 pBrush_Attr->AttrFlags &= ~ATTR_CACHED;
930 hPtr[Number - 1] = NULL;
932 if ( Type == hctBrushHandle ) // Handle only brush.
933 {
934 if ( pBrush_Attr->lbColor != cr )
935 {
936 pBrush_Attr->lbColor = cr ;
937 pBrush_Attr->AttrFlags |= ATTR_NEW_COLOR;
938 }
939 }
940 }
941 }
942 else
943 {
944 Handle = NULL;
945 }
946 }
948 return Handle;
949}
Type
Definition: Type.h:7
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
ULONG Handle
Definition: gdb_input.c:15
@ GDILoObjType_LO_BRUSH_TYPE
Definition: gdi_private.h:33
@ GDILoObjType_LO_PEN_TYPE
Definition: gdi_private.h:44
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define ATTR_CACHED
Definition: ntgdihdl.h:191
#define ATTR_NEW_COLOR
Definition: ntgdihdl.h:193
@ hctBrushHandle
Definition: ntgdityp.h:345
@ hctRegionHandle
Definition: ntgdityp.h:347
@ hctPenHandle
Definition: ntgdityp.h:346
#define CACHE_BRUSH_ENTRIES
Definition: ntgdityp.h:338
#define CACHE_REGION_ENTRIES
Definition: ntgdityp.h:340
#define CACHE_PEN_ENTRIES
Definition: ntgdityp.h:339
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:207
#define DPRINT
Definition: sndvol32.h:71
HANDLE Handle[CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES+CACHE_REGION_ENTRIES+CACHE_LFONT_ENTRIES]
Definition: ntgdityp.h:355
ULONG ulNumHandles[GDI_CACHED_HANDLE_TYPES]
Definition: ntgdityp.h:354
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
Definition: misc.c:761
PGDIHANDLECACHE GdiHandleCache
Definition: dllmain.c:11

Referenced by CreatePen(), and CreateRectRgn().

◆ InitializeLpkHooks()

VOID WINAPI InitializeLpkHooks ( _In_ FARPROC hookfuncs)

◆ LoadLPK()

BOOL WINAPI LoadLPK ( INT  LpkFunctionID)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 423 of file utils.c.

424{
425 if(!hLpk) // Check if the DLL is already loaded
426 hLpk = LoadLibraryW(L"lpk.dll");
427
428 if (hLpk)
429 {
430 switch (LpkFunctionID)
431 {
432 case LPK_INIT:
433 return TRUE;
434
435 case LPK_ETO:
436 if (!LpkExtTextOut) // Check if the function is already loaded
437 LpkExtTextOut = (LPKETO) GetProcAddress(hLpk, "LpkExtTextOut");
438
439 if (!LpkExtTextOut)
440 {
442 return FALSE;
443 }
444
445 return TRUE;
446
447 case LPK_GCP:
448 if (!LpkGetCharacterPlacement) // Check if the function is already loaded
449 LpkGetCharacterPlacement = (LPKGCP) GetProcAddress(hLpk, "LpkGetCharacterPlacement");
450
452 {
454 return FALSE;
455 }
456
457 return TRUE;
458
459 case LPK_GTEP:
460 if (!LpkGetTextExtentExPoint) // Check if the function is already loaded
461 LpkGetTextExtentExPoint = (LPKGTEP) GetProcAddress(hLpk, "LpkGetTextExtentExPoint");
462
464 {
466 return FALSE;
467 }
468
469 return TRUE;
470
471 default:
473 return FALSE;
474 }
475 }
476
477 else
478 return FALSE;
479}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
BOOL(WINAPI * LPKETO)(HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
Definition: gdi32p.h:31
#define LPK_ETO
Definition: gdi32p.h:82
#define LPK_INIT
Definition: gdi32p.h:81
#define LPK_GCP
Definition: gdi32p.h:83
BOOL(WINAPI * LPKGTEP)(HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)
Definition: gdi32p.h:55
#define LPK_GTEP
Definition: gdi32p.h:84
DWORD(WINAPI * LPKGCP)(HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
Definition: gdi32p.h:44
HINSTANCE hLpk
Definition: utils.c:4
LPKGCP LpkGetCharacterPlacement
Definition: utils.c:6
LPKETO LpkExtTextOut
Definition: utils.c:5
LPKGTEP LpkGetTextExtentExPoint
Definition: utils.c:7

Referenced by ExtTextOutW(), GdiInitializeLanguagePack(), GetCharacterPlacementW(), and GetTextExtentExPointW().

◆ LoadTheSpoolerDrv()

BOOL FASTCALL LoadTheSpoolerDrv ( VOID  )

Definition at line 188 of file printdrv.c.

189{
190 HMODULE hModWinSpoolDrv;
191
192 if ( !ghSpooler )
193 {
195
196 hModWinSpoolDrv = LoadLibraryW(L"WINSPOOL.DRV");
197
198 if (hModWinSpoolDrv)
199 {
200 fpAbortPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "AbortPrinter");
201 fpClosePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ClosePrinter");
202 fpCloseSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "CloseSpoolFileHandle");
203 fpCommitSpoolData = (PVOID)GetProcAddress(hModWinSpoolDrv, "CommitSpoolData");
204 // fpConnectToLd64In32Server = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)224);
205 fpDocumentEvent = (PVOID)GetProcAddress(hModWinSpoolDrv,"DocumentEvent");
206 fpDocumentPropertiesW = (PVOID)GetProcAddress(hModWinSpoolDrv, "DocumentPropertiesW");
207 fpEndDocPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndDocPrinter");
208 fpEndPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndPagePrinter");
209 fpGetPrinterW = (PVOID)GetProcAddress( hModWinSpoolDrv,"GetPrinterW");
210 fpGetPrinterDriverW = (PVOID)GetProcAddress(hModWinSpoolDrv,"GetPrinterDriverW");
211 fpGetSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "GetSpoolFileHandle");
212 fpIsValidDevmodeW = (PVOID)GetProcAddress(hModWinSpoolDrv, "IsValidDevmodeW");
213 fpOpenPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "OpenPrinterW");
214 fpQueryColorProfile = (PVOID)GetProcAddress(hModWinSpoolDrv,"QueryColorProfile");
215 fpQueryRemoteFonts = (PVOID)GetProcAddress(hModWinSpoolDrv, "QueryRemoteFonts");
216 fpQuerySpoolMode = (PVOID)GetProcAddress(hModWinSpoolDrv, "QuerySpoolMode");
217 fpReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ReadPrinter");
218 fpResetPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "ResetPrinterW");
219 fpSeekPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "SeekPrinter");
220 fpSplDriverUnloadComplete = (PVOID)GetProcAddress(hModWinSpoolDrv, "SplDriverUnloadComplete");
221 fpSplReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)205);
222 fpStartDocDlgW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocDlgW");
223 fpStartDocPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocPrinterW");
224 fpStartPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartPagePrinter");
225
226 if ( !fpAbortPrinter ||
234 !fpGetPrinterW ||
242 !fpReadPrinter ||
244 !fpSeekPrinter ||
250 {
251 FreeLibrary(hModWinSpoolDrv);
252 hModWinSpoolDrv = NULL;
253 }
254 ghSpooler = hModWinSpoolDrv;
255 }
257 }
258 else
259 return TRUE;
260
262
263 return (ghSpooler != NULL);
264}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
RTL_CRITICAL_SECTION semLocal
Definition: dllmain.c:13
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
OPENPRINTERW fpOpenPrinterW
Definition: printdrv.c:55
static ABORTPRINTER fpAbortPrinter
Definition: printdrv.c:42
static CLOSESPOOLFILEHANDLE fpCloseSpoolFileHandle
Definition: printdrv.c:44
static ENDDOCPRINTER fpEndDocPrinter
Definition: printdrv.c:49
static QUERYSPOOLMODE fpQuerySpoolMode
Definition: printdrv.c:56
static RESETPRINTERW fpResetPrinterW
Definition: printdrv.c:60
static COMMITSPOOLDATA fpCommitSpoolData
Definition: printdrv.c:45
static SPLREADPRINTER fpSplReadPrinter
Definition: printdrv.c:63
CLOSEPRINTER fpClosePrinter
Definition: printdrv.c:43
static QUERYCOLORPROFILE fpQueryColorProfile
Definition: printdrv.c:58
static ISVALIDDEVMODEW fpIsValidDevmodeW
Definition: printdrv.c:54
static GETSPOOLFILEHANDLE fpGetSpoolFileHandle
Definition: printdrv.c:51
static DOCUMENTPROPERTIESW fpDocumentPropertiesW
Definition: printdrv.c:48
static SEEKPRINTER fpSeekPrinter
Definition: printdrv.c:61
static SPLDRIVERUNLOADCOMPLETE fpSplDriverUnloadComplete
Definition: printdrv.c:62
static QUERYREMOTEFONTS fpQueryRemoteFonts
Definition: printdrv.c:57
static STARTPAGEPRINTER fpStartPagePrinter
Definition: printdrv.c:66
static GETPRINTERDRIVERW fpGetPrinterDriverW
Definition: printdrv.c:53
HANDLE ghSpooler
Definition: printdrv.c:40
static STARTDOCDLGW fpStartDocDlgW
Definition: printdrv.c:64
static READPRINTER fpReadPrinter
Definition: printdrv.c:59
static STARTDOCPRINTERW fpStartDocPrinterW
Definition: printdrv.c:65
static GETPRINTERW fpGetPrinterW
Definition: printdrv.c:52
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by IntCreateDICW().

◆ LogFontA2W()

VOID NTAPI LogFontA2W ( LPLOGFONTW  pW,
CONST LOGFONTA pA 
)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 348 of file utils.c.

349{
350#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
351#define COPYN(f) pW->f = pA->f
352
353 COPYN(lfHeight);
354 COPYN(lfWidth);
355 COPYN(lfEscapement);
356 COPYN(lfOrientation);
357 COPYN(lfWeight);
358 COPYN(lfItalic);
359 COPYN(lfUnderline);
360 COPYN(lfStrikeOut);
361 COPYN(lfCharSet);
362 COPYN(lfOutPrecision);
363 COPYN(lfClipPrecision);
364 COPYN(lfQuality);
365 COPYN(lfPitchAndFamily);
366 COPYS(lfFaceName,LF_FACESIZE);
367 pW->lfFaceName[LF_FACESIZE - 1] = '\0';
368
369#undef COPYN
370#undef COPYS
371}
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1910
#define COPYN(f)
#define COPYS(f, len)

Referenced by CreateFontIndirectA(), EnumFontFamiliesExA(), and RealSystemParametersInfoA().

◆ LogFontW2A()

VOID NTAPI LogFontW2A ( LPLOGFONTA  pA,
CONST LOGFONTW pW 
)
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 375 of file utils.c.

376{
377#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
378#define COPYN(f) pA->f = pW->f
379
380 COPYN(lfHeight);
381 COPYN(lfWidth);
382 COPYN(lfEscapement);
383 COPYN(lfOrientation);
384 COPYN(lfWeight);
385 COPYN(lfItalic);
386 COPYN(lfUnderline);
387 COPYN(lfStrikeOut);
388 COPYN(lfCharSet);
389 COPYN(lfOutPrecision);
390 COPYN(lfClipPrecision);
391 COPYN(lfQuality);
392 COPYN(lfPitchAndFamily);
393 COPYS(lfFaceName,LF_FACESIZE);
394 pA->lfFaceName[LF_FACESIZE - 1] = '\0';
395
396#undef COPYN
397#undef COPYS
398}
CHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1894

Referenced by EnumLogFontExW2A(), IntEnumFontFamilies(), and RealSystemParametersInfoA().

◆ METADC_Arc()

BOOL METADC_Arc ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 341 of file metadc.c.

343{
345 xstart, ystart, xend, yend );
346}
static BOOL metadc_param8(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
Definition: metadc.c:180
#define META_ARC
Definition: wingdi.h:233

◆ METADC_BitBlt()

BOOL METADC_BitBlt ( HDC  hdc_dst,
INT  x_dst,
INT  y_dst,
INT  width,
INT  height,
HDC  hdc_src,
INT  x_src,
INT  y_src,
DWORD  rop 
)

Definition at line 800 of file metadc.c.

802{
803 return metadc_stretchblt( hdc, x_dst, y_dst, width, height,
804 hdc_src, x_src, y_src, width, height, rop, META_DIBBITBLT );
805}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
static BOOL metadc_stretchblt(HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop, WORD type)
Definition: metadc.c:743
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
#define META_DIBBITBLT
Definition: wingdi.h:267

◆ METADC_Chord()

BOOL METADC_Chord ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 355 of file metadc.c.

357{
359 xstart, ystart, xend, yend );
360}
#define META_CHORD
Definition: wingdi.h:257

◆ METADC_DeleteDC()

BOOL METADC_DeleteDC ( HDC  hdc)

Definition at line 1318 of file metadc.c.

1319{
1320 struct metadc *metadc;
1321
1322 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
1323 if (!GdiDeleteClientObj( hdc )) return FALSE;
1325 return TRUE;
1326}
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
static void metadc_free(struct metadc *metadc)
Definition: metadc.c:1305
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
Definition: metadc.c:46

Referenced by METADC_RosGlueDeleteDC().

◆ METADC_Ellipse()

BOOL METADC_Ellipse ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 362 of file metadc.c.

363{
365}
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
#define META_ELLIPSE
Definition: wingdi.h:234

◆ METADC_ExcludeClipRect()

BOOL METADC_ExcludeClipRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 256 of file metadc.c.

257{
259}
#define META_EXCLUDECLIPRECT
Definition: wingdi.h:231

◆ METADC_ExtEscape()

BOOL METADC_ExtEscape ( HDC  hdc,
INT  escape,
INT  input_size,
LPCSTR  input,
INT  output_size,
LPVOID  output 
)

Definition at line 1269 of file metadc.c.

1270{
1271 METARECORD *mr;
1272 DWORD len;
1273 BOOL ret;
1274
1275 if (output_size) return FALSE; /* escapes that require output cannot work in metafiles */
1276
1277 len = sizeof(*mr) + sizeof(WORD) + ((input_size + 1) & ~1);
1278 if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ))) return FALSE;
1279 mr->rdSize = len / sizeof(WORD);
1280 mr->rdFunction = META_ESCAPE;
1281 mr->rdParm[0] = escape;
1282 mr->rdParm[1] = input_size;
1283 memcpy( &mr->rdParm[2], input, input_size );
1284 ret = metadc_record( hdc, mr, len );
1285 HeapFree(GetProcessHeap(), 0, mr);
1286 return ret;
1287}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLenum GLenum input
Definition: glext.h:9031
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
static WCHAR escape[]
Definition: url.c:36
DWORD rdSize
Definition: wingdi.h:2345
WORD rdParm[1]
Definition: wingdi.h:2347
WORD rdFunction
Definition: wingdi.h:2346
#define META_ESCAPE
Definition: wingdi.h:248

Referenced by Escape().

◆ METADC_ExtFloodFill()

BOOL METADC_ExtFloodFill ( HDC  hdc,
INT  x,
INT  y,
COLORREF  color,
UINT  fill_type 
)

Definition at line 492 of file metadc.c.

493{
494 return metadc_param5( hdc, META_EXTFLOODFILL, x, y, HIWORD(color), LOWORD(color), fill_type );
495}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint color
Definition: glext.h:6243
static BOOL metadc_param5(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5)
Definition: metadc.c:144
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
#define META_EXTFLOODFILL
Definition: wingdi.h:271

◆ METADC_ExtSelectClipRgn()

BOOL METADC_ExtSelectClipRgn ( HDC  hdc,
HRGN  hrgn,
INT  mode 
)

Definition at line 988 of file metadc.c.

989{
990 struct metadc *metadc;
991 INT16 rgn;
992 INT ret;
993
994 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
995 if (mode != RGN_COPY) return ERROR;
996 if (!hrgn) return NULLREGION;
998 if(rgn == -1) return ERROR;
1002 return ret;
1003}
signed short INT16
#define ERROR(name)
Definition: error_private.h:53
GLenum mode
Definition: glext.h:6217
static BOOL metadc_remove_handle(struct metadc *metadc, UINT index)
Definition: metadc.c:519
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define NULLREGION
Definition: wingdi.h:361
#define RGN_COPY
Definition: wingdi.h:357
#define META_DELETEOBJECT
Definition: wingdi.h:272
#define META_SELECTOBJECT
Definition: wingdi.h:255

◆ METADC_ExtTextOut()

BOOL METADC_ExtTextOut ( HDC  hdc,
INT  x,
INT  y,
UINT  flags,
const RECT rect,
const WCHAR str,
UINT  count,
const INT dx 
)

Definition at line 904 of file metadc.c.

906{
907 RECT16 rect16;
908 LPINT16 lpdx16 = NULL;
909 BOOL ret;
910 unsigned int i, j;
911 char *ascii;
912 DWORD len;
913 CHARSETINFO csi;
914 int charset = GetTextCharset( hdc );
915 UINT cp = CP_ACP;
916
918 cp = csi.ciACP;
919 else
920 {
921 switch(charset)
922 {
923 case OEM_CHARSET:
924 cp = GetOEMCP();
925 break;
926 case DEFAULT_CHARSET:
927 cp = GetACP();
928 break;
929
930 case VISCII_CHARSET:
931 case TCVN_CHARSET:
932 case KOI8_CHARSET:
933 case ISO3_CHARSET:
934 case ISO4_CHARSET:
935 case ISO10_CHARSET:
936 case CELTIC_CHARSET:
937 /* FIXME: These have no place here, but because x11drv
938 enumerates fonts with these (made up) charsets some apps
939 might use them and then the FIXME below would become
940 annoying. Now we could pick the intended codepage for
941 each of these, but since it's broken anyway we'll just
942 use CP_ACP and hope it'll go away...
943 */
944 cp = CP_ACP;
945 break;
946
947 default:
948 FIXME("Can't find codepage for charset %d\n", charset);
949 break;
950 }
951 }
952
953
954 TRACE( "cp = %d\n", cp );
956 ascii = HeapAlloc( GetProcessHeap(), 0, len );
957 WideCharToMultiByte( cp, 0, str, count, ascii, len, NULL, NULL );
958 TRACE( "mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len) );
959
960
961 if (lprect)
962 {
963 rect16.left = lprect->left;
964 rect16.top = lprect->top;
965 rect16.right = lprect->right;
966 rect16.bottom = lprect->bottom;
967 }
968
969 if (dx)
970 {
971 lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * len );
972 for (i = j = 0; i < len; )
973 if (IsDBCSLeadByteEx( cp, ascii[i] ))
974 {
975 lpdx16[i++] = dx[j++];
976 lpdx16[i++] = 0;
977 }
978 else
979 lpdx16[i++] = dx[j++];
980 }
981
982 ret = metadc_text( hdc, x, y, flags, lprect ? &rect16 : NULL, ascii, len, lpdx16 );
983 HeapFree( GetProcessHeap(), 0, ascii );
984 HeapFree( GetProcessHeap(), 0, lpdx16 );
985 return ret;
986}
#define ULongToPtr(ul)
Definition: basetsd.h:92
#define FIXME(fmt,...)
Definition: debug.h:111
CFF_Charset charset
Definition: cffcmap.c:138
#define CP_ACP
Definition: compat.h:109
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
BOOL WINAPI IsDBCSLeadByteEx(UINT CodePage, BYTE TestByte)
Definition: nls.c:2337
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define debugstr_wn
Definition: kernel32.h:33
GLint dx
Definition: linetemp.h:97
POINT cp
Definition: magnifier.c:59
static BOOL metadc_text(HDC hdc, short x, short y, UINT16 flags, const RECT16 *rect, const char *str, short count, const INT16 *dx)
Definition: metadc.c:875
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
INT16 left
Definition: windef16.h:143
INT16 bottom
Definition: windef16.h:146
INT16 top
Definition: windef16.h:144
INT16 right
Definition: windef16.h:145
INT16 * LPINT16
Definition: windef16.h:43
#define TCVN_CHARSET
Definition: wingdi.h:408
#define ISO3_CHARSET
Definition: wingdi.h:410
#define CELTIC_CHARSET
Definition: wingdi.h:413
#define KOI8_CHARSET
Definition: wingdi.h:409
#define VISCII_CHARSET
Definition: wingdi.h:407
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define ISO10_CHARSET
Definition: wingdi.h:412
int WINAPI GetTextCharset(_In_ HDC)
Definition: text.c:187
#define TCI_SRCCHARSET
Definition: wingdi.h:961
#define OEM_CHARSET
Definition: wingdi.h:400
#define ISO4_CHARSET
Definition: wingdi.h:411
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
UINT WINAPI GetACP(void)
Definition: nls.c:2307
UINT WINAPI GetOEMCP(void)
Definition: nls.c:2322

◆ METADC_ExtTextOutW()

BOOL WINAPI METADC_ExtTextOutW ( HDC  hdc,
INT  x,
INT  y,
UINT  fuOptions,
const RECT lprc,
LPCWSTR  lpString,
UINT  cchString,
const INT lpDx 
)

◆ METADC_FillRgn()

BOOL METADC_FillRgn ( HDC  hdc,
HRGN  hrgn,
HBRUSH  hbrush 
)

Definition at line 710 of file metadc.c.

711{
712 struct metadc *metadc;
713 INT16 rgn, brush;
714
715 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
716
718 if (rgn == -1) return FALSE;
720 if (!brush) return FALSE;
721 return metadc_param2( hdc, META_FILLREGION, rgn, brush );
722}
static HBRUSH hbrush
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
static INT16 metadc_create_brush(struct metadc *metadc, HBRUSH brush)
Definition: metadc.c:532
HBRUSH brush
Definition: metadc.c:53
#define META_FILLREGION
Definition: wingdi.h:250

◆ METADC_FrameRgn()

BOOL METADC_FrameRgn ( HDC  hdc,
HRGN  hrgn,
HBRUSH  hbrush,
INT  x,
INT  y 
)

Definition at line 724 of file metadc.c.

725{
726 struct metadc *metadc;
727 INT16 rgn, brush;
728
729 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
731 if (rgn == -1) return FALSE;
733 if (!brush) return FALSE;
734 return metadc_param4( hdc, META_FRAMEREGION, rgn, brush, x, y );
735}
#define META_FRAMEREGION
Definition: wingdi.h:251

◆ METADC_GetDeviceCaps()

INT METADC_GetDeviceCaps ( HDC  hdc,
INT  cap 
)

Definition at line 1289 of file metadc.c.

1290{
1291 if (!get_metadc_ptr( hdc )) return 0;
1292
1293 switch(cap)
1294 {
1295 case TECHNOLOGY:
1296 return DT_METAFILE;
1297 case TEXTCAPS:
1298 return 0;
1299 default:
1300 TRACE(" unsupported capability %d, will return 0\n", cap );
1301 }
1302 return 0;
1303}
GLenum cap
Definition: glext.h:9639
#define TEXTCAPS
Definition: wingdi.h:806
#define DT_METAFILE
Definition: wingdi.h:712
#define TECHNOLOGY
Definition: wingdi.h:706

◆ METADC_IntersectClipRect()

BOOL METADC_IntersectClipRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 251 of file metadc.c.

252{
254}
#define META_INTERSECTCLIPRECT
Definition: wingdi.h:232

◆ METADC_InvertRgn()

BOOL METADC_InvertRgn ( HDC  hdc,
HRGN  hrgn 
)

Definition at line 700 of file metadc.c.

701{
702 struct metadc *metadc;
703 INT16 index;
704 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
706 if (index == -1) return FALSE;
708}
#define index(s, c)
Definition: various.h:29
GLuint index
Definition: glext.h:6031
#define META_INVERTREGION
Definition: wingdi.h:252

◆ METADC_LineTo()

BOOL METADC_LineTo ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 336 of file metadc.c.

337{
338 return metadc_param2( hdc, META_LINETO, x, y );
339}
#define META_LINETO
Definition: wingdi.h:229

◆ METADC_MoveTo()

BOOL METADC_MoveTo ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 331 of file metadc.c.

332{
333 return metadc_param2( hdc, META_MOVETO, x, y );
334}
#define META_MOVETO
Definition: wingdi.h:230

◆ METADC_OffsetClipRgn()

BOOL METADC_OffsetClipRgn ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 261 of file metadc.c.

262{
264}
#define META_OFFSETCLIPRGN
Definition: wingdi.h:242

◆ METADC_OffsetViewportOrgEx()

BOOL METADC_OffsetViewportOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 296 of file metadc.c.

297{
299}
#define META_OFFSETVIEWPORTORG
Definition: wingdi.h:227

◆ METADC_OffsetWindowOrgEx()

BOOL METADC_OffsetWindowOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 301 of file metadc.c.

302{
304}
#define META_OFFSETWINDOWORG
Definition: wingdi.h:225

◆ METADC_PaintRgn()

BOOL METADC_PaintRgn ( HDC  hdc,
HRGN  hrgn 
)

Definition at line 690 of file metadc.c.

691{
692 struct metadc *metadc;
693 INT16 index;
694 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
696 if(index == -1) return FALSE;
698}
#define META_PAINTREGION
Definition: wingdi.h:253

◆ METADC_PatBlt()

BOOL METADC_PatBlt ( HDC  hdc,
INT  left,
INT  top,
INT  width,
INT  height,
DWORD  rop 
)

Definition at line 737 of file metadc.c.

738{
740 HIWORD(rop), LOWORD(rop) );
741}
static BOOL metadc_param6(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6)
Definition: metadc.c:161
#define META_PATBLT
Definition: wingdi.h:239

◆ METADC_Pie()

BOOL METADC_Pie ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 348 of file metadc.c.

350{
352 xstart, ystart, xend, yend );
353}
#define META_PIE
Definition: wingdi.h:236

◆ METADC_Polygon()

BOOL METADC_Polygon ( HDC  hdc,
const POINT points,
INT  count 
)

Definition at line 422 of file metadc.c.

423{
424 int i;
425 POINTS *pts;
426 BOOL ret;
427
428 pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * count );
429 if(!pts) return FALSE;
430 for (i = count; i--;)
431 {
432 pts[i].x = pt[i].x;
433 pts[i].y = pt[i].y;
434 }
436
437 HeapFree( GetProcessHeap(), 0, pts );
438 return ret;
439}
#define pt(x, y)
Definition: drawing.c:79
static BOOL metadc_poly(HDC hdc, short func, POINTS *pt, short count)
Definition: metadc.c:384
SHORT y
Definition: windef.h:343
SHORT x
Definition: windef.h:342
#define META_POLYGON
Definition: wingdi.h:246

◆ METADC_Polyline()

BOOL METADC_Polyline ( HDC  hdc,
const POINT points,
INT  count 
)

Definition at line 403 of file metadc.c.

404{
405 int i;
406 POINTS *pts;
407 BOOL ret;
408
409 pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * count );
410 if(!pts) return FALSE;
411 for (i=count;i--;)
412 {
413 pts[i].x = pt[i].x;
414 pts[i].y = pt[i].y;
415 }
417
418 HeapFree( GetProcessHeap(), 0, pts );
419 return ret;
420}
#define META_POLYLINE
Definition: wingdi.h:247

◆ METADC_PolyPolygon()

BOOL METADC_PolyPolygon ( HDC  hdc,
const POINT points,
const INT counts,
UINT  polygons 
)

Definition at line 441 of file metadc.c.

442{
443 BOOL ret;
444 DWORD len;
445 METARECORD *mr;
446 unsigned int i,j;
447 POINTS *pts;
448 INT16 totalpoint16 = 0;
449 INT16 * pointcounts;
450
451 for (i = 0; i < polygons; i++)
452 totalpoint16 += counts[i];
453
454 /* allocate space for all points */
455 pts=HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * totalpoint16 );
456 pointcounts = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * totalpoint16 );
457
458 /* copy point counts */
459 for (i = 0; i < polygons; i++)
460 pointcounts[i] = counts[i];
461
462 /* convert all points */
463 for (j = totalpoint16; j--;)
464 {
465 pts[j].x = pt[j].x;
466 pts[j].y = pt[j].y;
467 }
468
469 len = sizeof(METARECORD) + sizeof(WORD) + polygons * sizeof(INT16) +
470 totalpoint16 * sizeof(*pts);
471
472 if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len )))
473 {
474 HeapFree( GetProcessHeap(), 0, pts );
475 HeapFree( GetProcessHeap(), 0, pointcounts );
476 return FALSE;
477 }
478
479 mr->rdSize = len / sizeof(WORD);
481 *mr->rdParm = polygons;
482 memcpy( mr->rdParm + 1, pointcounts, polygons * sizeof(INT16) );
483 memcpy( mr->rdParm + 1+polygons, pts , totalpoint16 * sizeof(*pts) );
484 ret = metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
485
486 HeapFree( GetProcessHeap(), 0, pts );
487 HeapFree( GetProcessHeap(), 0, pointcounts );
488 HeapFree( GetProcessHeap(), 0, mr);
489 return ret;
490}
#define META_POLYPOLYGON
Definition: wingdi.h:265
struct tagMETARECORD METARECORD

◆ METADC_RealizePalette()

BOOL METADC_RealizePalette ( HDC  hdc)

Definition at line 1247 of file metadc.c.

1248{
1250}
static BOOL metadc_param0(HDC hdc, short func)
Definition: metadc.c:96
#define META_REALIZEPALETTE
Definition: wingdi.h:262

Referenced by RealizePalette().

◆ METADC_Rectangle()

BOOL METADC_Rectangle ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 367 of file metadc.c.

368{
370}
#define META_RECTANGLE
Definition: wingdi.h:237

◆ METADC_RestoreDC()

BOOL METADC_RestoreDC ( HDC  hdc,
INT  level 
)

Definition at line 206 of file metadc.c.

207{
209}
GLint level
Definition: gl.h:1546
#define META_RESTOREDC
Definition: wingdi.h:249

◆ METADC_RosGlueDeleteDC()

BOOL WINAPI METADC_RosGlueDeleteDC ( _In_ HDC  hdc)

Definition at line 392 of file rosglue.c.

394{
395 LDC* pWineDc = NULL;
396
398 {
399 return METADC_DeleteDC(hdc);
400 }
401
403 {
404 pWineDc = GdiGetLDC(hdc);
405
406 if ( pWineDc )
407 {
408 // Handle Printer LDC
409 if (pWineDc->iType != LDC_EMFLDC)
410 {
411 //return IntDeleteDC(hdc);
412 }
413
414 EMFDC_DeleteDC( pWineDc );
415
416 /* Get rid of the LDC */
417 ASSERT(GdiGetLDC(pWineDc->hDC) == pWineDc);
418 GdiSetLDC(pWineDc->hDC, NULL);
419
420 /* Free the Wine DC */
421 HeapFree(GetProcessHeap(), 0, pWineDc);
422 }
423 }
424
426}
BOOL EMFDC_DeleteDC(LDC *dc_attr) DECLSPEC_HIDDEN
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC)
Definition: misc.c:802
BOOL METADC_DeleteDC(HDC hdc)
Definition: metadc.c:1318
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)

Referenced by DeleteDC().

◆ METADC_RosGlueDeleteObject()

VOID WINAPI METADC_RosGlueDeleteObject ( HGDIOBJ  hobj)

Definition at line 352 of file rosglue.c.

353{
354 GDILOOBJTYPE eObjectType;
355 HDC hdc;
356
357 /* Check for one of the types we actually handle here */
358 eObjectType = GDI_HANDLE_GET_TYPE(hobj);
359 if ((eObjectType != GDILoObjType_LO_BRUSH_TYPE) &&
360 (eObjectType != GDILoObjType_LO_PEN_TYPE) &&
361 (eObjectType != GDILoObjType_LO_EXTPEN_TYPE) &&
362 (eObjectType != GDILoObjType_LO_PALETTE_TYPE) &&
363 (eObjectType != GDILoObjType_LO_FONT_TYPE))
364 {
365 return;
366 }
367
368 /* Check if we have a client object link and remove it if it was found.
369 The link is the HDC that the object was selected into. */
371 if (hdc == NULL)
372 {
373 DPRINT1("the link was not found\n");
374 /* The link was not found, so we are not handling this object here */
375 return;
376 }
377
379
381 {
382 LDC* pWineDc = GdiGetLDC(hdc);
383 if ( pWineDc )
384 {
385 emfdc_delete_object( hdc, hobj );
386 }
387 }
388}
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
void METADC_DeleteObject(HDC hdc, HGDIOBJ obj)
Definition: metadc.c:1015
void emfdc_delete_object(HDC hdc, HGDIOBJ obj)
Definition: emfdc.c:232
@ GDILoObjType_LO_FONT_TYPE
Definition: gdi_private.h:37
@ GDILoObjType_LO_PALETTE_TYPE
Definition: gdi_private.h:36
@ GDILoObjType_LO_EXTPEN_TYPE
Definition: gdi_private.h:45
static HDC
Definition: imagelist.c:92

Referenced by DeleteObject().

◆ METADC_RoundRect()

BOOL METADC_RoundRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  ell_width,
INT  ell_height 
)

Definition at line 372 of file metadc.c.

374{
376 ell_width, ell_height );
377}
#define META_ROUNDRECT
Definition: wingdi.h:238

◆ METADC_SaveDC()

BOOL METADC_SaveDC ( HDC  hdc)

Definition at line 201 of file metadc.c.

202{
203 return metadc_param0( hdc, META_SAVEDC );
204}
#define META_SAVEDC
Definition: wingdi.h:240

◆ METADC_ScaleViewportExtEx()

BOOL METADC_ScaleViewportExtEx ( HDC  hdc,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

Definition at line 306 of file metadc.c.

307{
308 return metadc_param4( hdc, META_SCALEVIEWPORTEXT, x_num, x_denom, y_num, y_denom );
309}
#define META_SCALEVIEWPORTEXT
Definition: wingdi.h:228

◆ METADC_ScaleWindowExtEx()

BOOL METADC_ScaleWindowExtEx ( HDC  hdc,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

Definition at line 311 of file metadc.c.

312{
313 return metadc_param4( hdc, META_SCALEWINDOWEXT, x_num, x_denom, y_num, y_denom );
314}
#define META_SCALEWINDOWEXT
Definition: wingdi.h:226

◆ METADC_SelectObject()

HGDIOBJ METADC_SelectObject ( HDC  hdc,
HGDIOBJ  obj 
)

Definition at line 1252 of file metadc.c.

1253{
1254 switch (GDI_HANDLE_GET_TYPE( obj ))
1255 {
1257 return METADC_SelectBrush( hdc, obj );
1259 return METADC_SelectFont( hdc, obj );
1262 return METADC_SelectPen( hdc, obj );
1263 default:
1265 return 0;
1266 }
1267}
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
static HPEN METADC_SelectPen(HDC hdc, HPEN hpen)
Definition: metadc.c:1138
static HBRUSH METADC_SelectBrush(HDC hdc, HBRUSH hbrush)
Definition: metadc.c:1048
static HFONT METADC_SelectFont(HDC hdc, HFONT hfont)
Definition: metadc.c:1102

◆ METADC_SelectPalette()

BOOL METADC_SelectPalette ( HDC  hdc,
HPALETTE  palette 
)

Definition at line 1220 of file metadc.c.

1221{
1222 struct metadc *metadc;
1223 PLOGPALETTE log_palette;
1224 WORD count = 0;
1225 BOOL ret;
1226 int size;
1227
1228 if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
1229 GetObjectA( palette, sizeof(WORD), &count );
1230 if (!count) return 0;
1231
1232 size = sizeof(LOGPALETTE) + (count - 1) * sizeof(PALETTEENTRY);
1233 log_palette = HeapAlloc( GetProcessHeap(), 0, size );
1234 if (!log_palette) return 0;
1235
1236 log_palette->palVersion = 0x300;
1237 log_palette->palNumEntries = count;
1238
1239 GetPaletteEntries( palette, 0, count, log_palette->palPalEntry );
1240
1241 ret = metadc_create_palette( metadc, palette, log_palette, size );
1242
1243 HeapFree( GetProcessHeap(), 0, log_palette );
1244 return ret;
1245}
GLsizeiptr size
Definition: glext.h:5919
static BOOL metadc_create_palette(struct metadc *metadc, HPALETTE palette, LOGPALETTE *log_palette, int sizeofPalette)
Definition: metadc.c:1189
static HPALETTE palette
Definition: clipboard.c:1345
WORD palNumEntries
Definition: wingdi.h:1834
WORD palVersion
Definition: wingdi.h:1833
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
struct tagPALETTEENTRY PALETTEENTRY
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
struct tagLOGPALETTE LOGPALETTE

Referenced by SelectPalette().

◆ METADC_SetBkColor()

BOOL METADC_SetBkColor ( HDC  hdc,
COLORREF  color 
)

Definition at line 221 of file metadc.c.

222{
224}
#define META_SETBKCOLOR
Definition: wingdi.h:210

◆ METADC_SetBkMode()

BOOL METADC_SetBkMode ( HDC  hdc,
INT  mode 
)

Definition at line 216 of file metadc.c.

217{
219}
#define META_SETBKMODE
Definition: wingdi.h:211

◆ METADC_SetD()

BOOL WINAPI METADC_SetD ( _In_ HDC  hdc,
_In_ DWORD  dwIn,
_In_ USHORT  usMF16Id 
)

Definition at line 312 of file rosglue.c.

317{
318 switch(usMF16Id)
319 {
320 case META_SETMAPMODE:
321 return METADC_SetMapMode(hdc, dwIn);
322 case META_SETRELABS:
323 return METADC_SetRelAbs(hdc, dwIn);
324 default:
325 return FALSE;
326 }
327}
BOOL METADC_SetMapMode(HDC hdc, INT mode) DECLSPEC_HIDDEN
Definition: metadc.c:271
BOOL METADC_SetRelAbs(HDC hdc, INT mode) DECLSPEC_HIDDEN
Definition: metadc.c:236
#define META_SETMAPMODE
Definition: wingdi.h:212
#define META_SETRELABS
Definition: wingdi.h:214

Referenced by GetAndSetDCDWord().

◆ METADC_SetDIBitsToDevice()

INT METADC_SetDIBitsToDevice ( HDC  hdc,
INT  x_dest,
INT  y_dest,
DWORD  width,
DWORD  height,
INT  x_src,
INT  y_src,
UINT  startscan,
UINT  lines,
const void bits,
const BITMAPINFO info,
UINT  coloruse 
)

Definition at line 846 of file metadc.c.

850{
851 DWORD infosize = get_dib_info_size(info, coloruse);
852 DWORD len = sizeof(METARECORD) + 8 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
853 METARECORD *mr;
854
855 if (!(mr = HeapAlloc( GetProcessHeap(), 0, len ))) return 0;
856
857 mr->rdSize = len / sizeof(WORD);
859 mr->rdParm[0] = coloruse;
860 mr->rdParm[1] = lines;
861 mr->rdParm[2] = startscan;
862 mr->rdParm[3] = y_src;
863 mr->rdParm[4] = x_src;
864 mr->rdParm[5] = height;
865 mr->rdParm[6] = width;
866 mr->rdParm[7] = y_dst;
867 mr->rdParm[8] = x_dst;
868 memcpy( mr->rdParm + 9, info, infosize );
869 memcpy( mr->rdParm + 9 + infosize / sizeof(WORD), bits, info->bmiHeader.biSizeImage );
870 metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
871 HeapFree( GetProcessHeap(), 0, mr );
872 return lines;
873}
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:212
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
eMaj lines
Definition: tritemp.h:206
#define META_SETDIBTODEV
Definition: wingdi.h:260

◆ METADC_SetLayout()

BOOL METADC_SetLayout ( HDC  hdc,
DWORD  layout 
)

Definition at line 266 of file metadc.c.

267{
269}
static DWORD layout
Definition: bitmap.c:46
#define META_SETLAYOUT
Definition: wingdi.h:218

◆ METADC_SetMapMode()

BOOL METADC_SetMapMode ( HDC  hdc,
INT  mode 
)

Definition at line 271 of file metadc.c.

272{
274}

Referenced by METADC_SetD(), and SetMapMode().

◆ METADC_SetMapperFlags()

BOOL METADC_SetMapperFlags ( HDC  hdc,
DWORD  flags 
)

Definition at line 326 of file metadc.c.

327{
329}
#define META_SETMAPPERFLAGS
Definition: wingdi.h:258

◆ METADC_SetPixel()

BOOL METADC_SetPixel ( HDC  hdc,
INT  x,
INT  y,
COLORREF  color 
)

Definition at line 379 of file metadc.c.

380{
382}
#define META_SETPIXEL
Definition: wingdi.h:241

◆ METADC_SetPolyFillMode()

BOOL METADC_SetPolyFillMode ( HDC  hdc,
INT  mode 
)

Definition at line 241 of file metadc.c.

242{
244}
#define META_SETPOLYFILLMODE
Definition: wingdi.h:215

◆ METADC_SetRelAbs()

BOOL METADC_SetRelAbs ( HDC  hdc,
INT  mode 
)

Definition at line 236 of file metadc.c.

237{
239}

Referenced by METADC_SetD().

◆ METADC_SetROP2()

BOOL METADC_SetROP2 ( HDC  hdc,
INT  rop 
)

Definition at line 231 of file metadc.c.

232{
234}
#define META_SETROP2
Definition: wingdi.h:213

◆ METADC_SetStretchBltMode()

BOOL METADC_SetStretchBltMode ( HDC  hdc,
INT  mode 
)

Definition at line 246 of file metadc.c.

247{
249}
#define META_SETSTRETCHBLTMODE
Definition: wingdi.h:216

◆ METADC_SetTextAlign()

BOOL METADC_SetTextAlign ( HDC  hdc,
UINT  align 
)

Definition at line 211 of file metadc.c.

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

◆ METADC_SetTextCharacterExtra()

BOOL METADC_SetTextCharacterExtra ( HDC  hdc,
INT  extra 
)

Definition at line 321 of file metadc.c.

322{
324}
@ extra
Definition: id3.c:95
#define META_SETTEXTCHAREXTRA
Definition: wingdi.h:217

◆ METADC_SetTextColor()

BOOL METADC_SetTextColor ( HDC  hdc,
COLORREF  color 
)

Definition at line 226 of file metadc.c.

227{
229}
#define META_SETTEXTCOLOR
Definition: wingdi.h:219

◆ METADC_SetTextJustification()

BOOL METADC_SetTextJustification ( HDC  hdc,
INT  extra,
INT  breaks 
)

Definition at line 316 of file metadc.c.

317{
319}
#define META_SETTEXTJUSTIFICATION
Definition: wingdi.h:220

◆ METADC_SetViewportExtEx()

BOOL METADC_SetViewportExtEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 276 of file metadc.c.

277{
279}
#define META_SETVIEWPORTEXT
Definition: wingdi.h:224

◆ METADC_SetViewportOrgEx()

BOOL METADC_SetViewportOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 281 of file metadc.c.

282{
284}
#define META_SETVIEWPORTORG
Definition: wingdi.h:223

◆ METADC_SetWindowExtEx()

BOOL METADC_SetWindowExtEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 286 of file metadc.c.

287{
289}
#define META_SETWINDOWEXT
Definition: wingdi.h:222

◆ METADC_SetWindowOrgEx()

BOOL METADC_SetWindowOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 291 of file metadc.c.

292{
294}
#define META_SETWINDOWORG
Definition: wingdi.h:221

◆ METADC_StretchBlt()

BOOL METADC_StretchBlt ( HDC  hdc_dst,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
HDC  hdc_src,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
DWORD  rop 
)

Definition at line 807 of file metadc.c.

810{
811 return metadc_stretchblt( hdc_dst, x_dst, y_dst, width_dst, height_dst,
812 hdc_src, x_src, y_src, width_src, height_src, rop, META_DIBSTRETCHBLT );
813}
#define META_DIBSTRETCHBLT
Definition: wingdi.h:268

◆ METADC_StretchDIBits()

BOOL METADC_StretchDIBits ( HDC  hdc,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
const void bits,
const BITMAPINFO info,
UINT  coloruse,
DWORD  rop 
)

Definition at line 815 of file metadc.c.

819{
820 DWORD infosize = get_dib_info_size( info, usage );
821 DWORD len = sizeof(METARECORD) + 10 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
822 METARECORD *mr;
823
824 if (!(mr = HeapAlloc( GetProcessHeap(), 0, len ))) return 0;
825
826 mr->rdSize = len / sizeof(WORD);
828 mr->rdParm[0] = LOWORD(rop);
829 mr->rdParm[1] = HIWORD(rop);
830 mr->rdParm[2] = usage;
831 mr->rdParm[3] = height_src;
832 mr->rdParm[4] = width_src;
833 mr->rdParm[5] = y_src;
834 mr->rdParm[6] = x_src;
835 mr->rdParm[7] = height_dst;
836 mr->rdParm[8] = width_dst;
837 mr->rdParm[9] = y_dst;
838 mr->rdParm[10] = x_dst;
839 memcpy( mr->rdParm + 11, info, infosize );
840 memcpy( mr->rdParm + 11 + infosize / 2, bits, info->bmiHeader.biSizeImage );
841 metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
842 HeapFree( GetProcessHeap(), 0, mr );
843 return height_src;
844}
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define META_STRETCHDIB
Definition: wingdi.h:270

◆ NewTextMetricExW2A()

VOID FASTCALL NewTextMetricExW2A ( NEWTEXTMETRICEXA tma,
NEWTEXTMETRICEXW tmw 
)

Definition at line 201 of file font.c.

202{
203 NewTextMetricW2A(&tma->ntmTm, &tmw->ntmTm);
204 tma->ntmFontSig = tmw->ntmFontSig;
205}
NEWTEXTMETRICA ntmTm
Definition: wingdi.h:2671
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2672
NEWTEXTMETRICW ntmTm
Definition: wingdi.h:2675
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2676
VOID FASTCALL NewTextMetricW2A(NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
Definition: font.c:191

Referenced by IntEnumFontFamilies().

◆ NewTextMetricW2A()

VOID FASTCALL NewTextMetricW2A ( NEWTEXTMETRICA tma,
NEWTEXTMETRICW tmw 
)

Definition at line 191 of file font.c.

192{
194 tma->ntmFlags = tmw->ntmFlags;
195 tma->ntmSizeEM = tmw->ntmSizeEM;
196 tma->ntmCellHeight = tmw->ntmCellHeight;
197 tma->ntmAvgWidth = tmw->ntmAvgWidth;
198}
UINT ntmCellHeight
Definition: wingdi.h:2640
VOID FASTCALL FONT_TextMetricWToA(const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
Definition: font.c:79

Referenced by NewTextMetricExW2A().

◆ SetEnhMetaFileBitsAlt()

HENHMETAFILE WINAPI SetEnhMetaFileBitsAlt ( PDWORD  pdw,
LPWSTR  FilePart,
HANDLE  hFile,
LARGE_INTEGER  li 
)

◆ UserRealizePalette()

UINT WINAPI UserRealizePalette ( HDC  hDC)

Definition at line 2339 of file painting.c.

2340{
2341 HWND hWnd, hWndDesktop;
2342 DWORD Ret;
2343
2345 if (Ret) // There was a change.
2346 {
2348 if (hWnd) // Send broadcast if dc is associated with a window.
2349 { // FYI: Thread locked in CallOneParam.
2350 hWndDesktop = IntGetDesktopWindow();
2351 if ( hWndDesktop != hWnd )
2352 {
2353 PWND pWnd = UserGetWindowObject(hWndDesktop);
2354 ERR("RealizePalette Desktop.\n");
2355 hdc = UserGetWindowDC(pWnd);
2357 UserReleaseDC(pWnd,hdc,FALSE);
2358 }
2360 }
2361 }
2362 return Ret;
2363}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: debug.h:110
UINT FASTCALL IntGdiRealizePalette(HDC)
Definition: palette.c:731
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:894
Definition: ntuser.h:694
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
HDC FASTCALL UserGetWindowDC(PWND Wnd)
Definition: windc.c:947
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1374
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1835
BOOL FASTCALL UserSendNotifyMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2040
UINT_PTR WPARAM
Definition: windef.h:207
#define HWND_BROADCAST
Definition: winuser.h:1204
#define WM_PALETTECHANGED
Definition: winuser.h:1877

Referenced by NtUserCallOneParam(), and RealizePalette().

Variable Documentation

◆ CurrentProcessId

HANDLE CurrentProcessId
extern

Definition at line 35 of file misc.c.

Referenced by GdiGetHandleUserData(), GdiProcessSetup(), and GdiValidateHandle().

◆ fpClosePrinter

CLOSEPRINTER fpClosePrinter
extern

Definition at line 43 of file printdrv.c.

Referenced by LoadTheSpoolerDrv().

◆ fpOpenPrinterW

OPENPRINTERW fpOpenPrinterW
extern

Definition at line 55 of file printdrv.c.

Referenced by LoadTheSpoolerDrv().

◆ gbLpk

BOOL gbLpk
extern

Definition at line 12 of file dllmain.c.

Referenced by GdiInitializeLanguagePack(), and GetFontLanguageInfo().

◆ gcClientObj

ULONG gcClientObj
extern

Definition at line 11 of file clientobj.c.

Referenced by DeleteObject(), GdiCreateClientObjLink(), and GdiRemoveClientObjLink().

◆ GDI_BatchLimit

DWORD GDI_BatchLimit
extern

Definition at line 36 of file misc.c.

Referenced by GdiAllocBatchCommand(), GdiGetBatchLimit(), GdiProcessSetup(), and GdiSetBatchLimit().

◆ GdiDevCaps

PDEVCAPS GdiDevCaps
extern

Definition at line 10 of file dllmain.c.

Referenced by GdiProcessSetup(), and GetDeviceCaps().

◆ GdiHandleTable

PGDI_TABLE_ENTRY GdiHandleTable
extern

Definition at line 26 of file gdihv.c.

◆ GdiSharedHandleTable

PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable
extern

Definition at line 34 of file misc.c.

Referenced by DdQueryDisplaySettingsUniqueness(), and GdiProcessSetup().

◆ ghSpooler

HANDLE ghSpooler
extern

Definition at line 40 of file printdrv.c.

Referenced by IntCreateDICW(), and LoadTheSpoolerDrv().

◆ hLpk

HINSTANCE hLpk
extern

◆ hProcessHeap

HANDLE hProcessHeap
extern

Definition at line 37 of file kbswitch.c.

◆ LpkExtTextOut

LPKETO LpkExtTextOut
extern

◆ LpkGetCharacterPlacement

LPKGCP LpkGetCharacterPlacement
extern

◆ LpkGetTextExtentExPoint

LPKGTEP LpkGetTextExtentExPoint
extern
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 7 of file utils.c.

Referenced by GetTextExtentExPointW(), and LoadLPK().

◆ semLocal

RTL_CRITICAL_SECTION semLocal
extern

Definition at line 13 of file dllmain.c.

Referenced by GdiProcessSetup(), GdiProcessShutdown(), and LoadTheSpoolerDrv().