HBRUSH WINAPI GdiSelectBrush( _In_ HDC hdc, _In_ HBRUSH hbr) { PDC_ATTR pdcattr; HBRUSH hbrOld; HANDLE_METADC(HBRUSH, SelectBrush, NULL, hdc, hbr); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Get the current brush. If it matches the new brush, we're done */ hbrOld = pdcattr->hbrush; if (hbrOld == hbr) return hbrOld; /* Set the new brush and update dirty flags */ pdcattr->hbrush = hbr; pdcattr->ulDirty_ |= DC_BRUSH_DIRTY; return hbrOld; }
BOOL WINAPI LPtoDP(HDC hdc, LPPOINT lpPoints, INT nCount) { #if 0 INT i; PDC_ATTR pdcattr; pdcattr = GdiGetDcAttr(hdc); if (!pdcattr) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; } if (pdcattr->flXform & ANY_XFORM_CHANGES) { GdiFixupTransforms(pdcattr); } // FIXME: can this fail on Windows? GdiTransformPoints(&pdcattr->mxWorldToDevice, lpPoints, lpPoints, nCount); return TRUE; #endif return NtGdiTransformPoints(hdc, lpPoints, lpPoints, nCount, GdiLpToDp); }
/* * @implemented */ COLORREF WINAPI SetBkColor( _In_ HDC hdc, _In_ COLORREF crColor) { PDC_ATTR pdcattr; COLORREF crOldColor; HANDLE_METADC(COLORREF, SetBkColor, CLR_INVALID, hdc, crColor); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return CLR_INVALID; } /* Get old color and store the new */ crOldColor = pdcattr->ulBackgroundClr; pdcattr->ulBackgroundClr = crColor; if (pdcattr->crBackgroundClr != crColor) { pdcattr->ulDirty_ |= (DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL); pdcattr->crBackgroundClr = crColor; } return crOldColor; }
HPEN WINAPI GdiSelectPen( _In_ HDC hdc, _In_ HPEN hpen) { PDC_ATTR pdcattr; HPEN hpenOld; HANDLE_METADC(HPEN, SelectPen, NULL, hdc, hpen); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Get the current pen. If it matches the new pen, we're done */ hpenOld = pdcattr->hpen; if (hpenOld == hpen) return hpenOld; /* Set the new pen and update dirty flags */ pdcattr->ulDirty_ |= DC_PEN_DIRTY; pdcattr->hpen = hpen; return hpenOld; }
/* * @implemented */ COLORREF WINAPI SetDCPenColor( _In_ HDC hdc, _In_ COLORREF crColor) { PDC_ATTR pdcattr; COLORREF crOldColor; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return CLR_INVALID; } /* We handle only enhanced meta DCs here */ HANDLE_METADC(COLORREF, SetDCPenColor, CLR_INVALID, hdc, crColor); /* Get old color and store the new */ crOldColor = pdcattr->ulPenClr; pdcattr->ulPenClr = (ULONG)crColor; if (pdcattr->crPenClr != crColor) { pdcattr->ulDirty_ |= DIRTY_LINE; pdcattr->crPenClr = crColor; } return crOldColor; }
/* * @implemented */ int WINAPI SetROP2( _In_ HDC hdc, _In_ int rop2) { PDC_ATTR pdcattr; INT rop2Old; HANDLE_METADC(INT, SetROP2, 0, hdc, rop2); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (pdcattr->ulDirty_ & DC_MODE_DIRTY) { NtGdiFlush(); pdcattr->ulDirty_ &= ~DC_MODE_DIRTY; } } rop2Old = pdcattr->jROP2; pdcattr->jROP2 = (BYTE)rop2; return rop2Old; }
/* * @implemented * */ int WINAPI SetBkMode( _In_ HDC hdc, _In_ int iBkMode) { PDC_ATTR pdcattr; INT iOldMode; HANDLE_METADC(INT, SetBkMode, 0, hdc, iBkMode); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } iOldMode = pdcattr->lBkMode; pdcattr->jBkMode = iBkMode; // Processed pdcattr->lBkMode = iBkMode; // Raw return iOldMode; }
/* * @implemented */ int WINAPI SetStretchBltMode( _In_ HDC hdc, _In_ int iStretchMode) { INT iOldMode; PDC_ATTR pdcattr; HANDLE_METADC(INT, SetStretchBltMode, 0, hdc, iStretchMode); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } iOldMode = pdcattr->lStretchBltMode; pdcattr->lStretchBltMode = iStretchMode; // Wine returns an error here. We set the default. if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode = WHITEONBLACK; pdcattr->jStretchBltMode = iStretchMode; return iOldMode; }
/* * @unimplemented */ int WINAPI SetPolyFillMode( _In_ HDC hdc, _In_ int iPolyFillMode) { INT iOldPolyFillMode; PDC_ATTR pdcattr; HANDLE_METADC(INT, SetPolyFillMode, 0, hdc, iPolyFillMode); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (pdcattr->ulDirty_ & DC_MODE_DIRTY) { NtGdiFlush(); // Sync up pdcattr from Kernel space. pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY); } } iOldPolyFillMode = pdcattr->lFillMode; pdcattr->lFillMode = iPolyFillMode; return iOldPolyFillMode; }
/* * @implemented */ int WINAPI GetClipRgn( HDC hdc, HRGN hrgn ) { INT Ret; /* Check if DC handle is valid */ if (!GdiGetDcAttr(hdc)) { /* Last error code differs from what NtGdiGetRandomRgn returns */ SetLastError(ERROR_INVALID_PARAMETER); return -1; } Ret = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN); // if (Ret) // { // if(GetLayout(hdc) & LAYOUT_RTL) MirrorRgnDC(hdc,(HRGN)Ret, NULL); // } return Ret; }
/* * @implemented * */ HGDIOBJ WINAPI GetCurrentObject( _In_ HDC hdc, _In_ UINT uObjectType) { PDC_ATTR pdcattr = NULL; /* Check if this is a user mode object */ if ((uObjectType == OBJ_PEN) || (uObjectType == OBJ_EXTPEN) || (uObjectType == OBJ_BRUSH) || (uObjectType == OBJ_COLORSPACE)) { /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { return NULL; } } /* Check what object was requested */ switch (uObjectType) { case OBJ_EXTPEN: case OBJ_PEN: return pdcattr->hpen; case OBJ_BRUSH: return pdcattr->hbrush; case OBJ_COLORSPACE: return pdcattr->hColorSpace; case OBJ_PAL: uObjectType = GDI_OBJECT_TYPE_PALETTE; break; case OBJ_FONT: uObjectType = GDI_OBJECT_TYPE_FONT; break; case OBJ_BITMAP: uObjectType = GDI_OBJECT_TYPE_BITMAP; break; /* All others are invalid */ default: SetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Pass the request to win32k */ return NtGdiGetDCObject(hdc, uObjectType); }
PLDC FASTCALL GdiGetLDC(HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { return NULL; } /* Return the LDC pointer */ return pdcattr->pvLDC; }
/* * @implemented * */ int WINAPI GetStretchBltMode(HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Don't set LastError here! */ return 0; } return pdcattr->lStretchBltMode; }
/* * @unimplemented */ int WINAPI SetGraphicsMode( _In_ HDC hdc, _In_ int iMode) { INT iOldMode; PDC_ATTR pdcattr; /* Check parameters */ if ((iMode < GM_COMPATIBLE) || (iMode > GM_ADVANCED)) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } /* Check for trivial case */ if (iMode == pdcattr->iGraphicsMode) return iMode; if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (pdcattr->ulDirty_ & DC_MODE_DIRTY) { NtGdiFlush(); // Sync up pdcattr from Kernel space. pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY); } } /* One would think that setting the graphics mode to GM_COMPATIBLE * would also reset the world transformation matrix to the unity * matrix. However, in Windows, this is not the case. This doesn't * make a lot of sense to me, but that's the way it is. */ iOldMode = pdcattr->iGraphicsMode; pdcattr->iGraphicsMode = iMode; return iOldMode; }
BOOL FASTCALL GdiSetLDC(HDC hdc, PVOID pvLDC) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { return FALSE; } /* Set the LDC pointer */ pdcattr->pvLDC = pvLDC; return TRUE; }
/* * @implemented * */ int WINAPI GetGraphicsMode(HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Don't set LastError here! */ return 0; } /* Return current graphics mode */ return pdcattr->iGraphicsMode; }
/* * @implemented * */ int WINAPI GetPolyFillMode(HDC hdc) { PDC_ATTR pdcattr; /* Get DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Don't set LastError here! */ return 0; } /* Return current fill mode */ return pdcattr->lFillMode; }
/* * @implemented */ COLORREF WINAPI GetDCPenColor( _In_ HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return CLR_INVALID; } return pdcattr->ulPenClr; }
/* * @implemented */ HFONT WINAPI GetHFONT(HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Don't set LastError here! */ return NULL; } /* Return the current font */ return pdcattr->hlfntNew; }
/* * @implemented * */ COLORREF WINAPI GetBkColor( _In_ HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Don't set LastError here! */ return CLR_INVALID; } return pdcattr->ulBackgroundClr; }
/* * @implemented * */ int WINAPI GetROP2( _In_ HDC hdc) { PDC_ATTR pdcattr; /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { /* Do not set LastError here! */ return 0; } return pdcattr->jROP2; }
HFONT WINAPI GdiSelectFont( _In_ HDC hdc, _In_ HFONT hfont) { PDC_ATTR pdcattr; HFONT hfontOld; HANDLE_METADC(HFONT, SelectFont, NULL, hdc, hfont); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Get the current font. If it matches the new font, we're done */ hfontOld = pdcattr->hlfntNew; if (hfontOld == hfont) return hfontOld; /* Set the new font and update dirty flags */ pdcattr->hlfntNew = hfont; pdcattr->ulDirty_ &= ~SLOW_WIDTHS; pdcattr->ulDirty_ |= DIRTY_CHARSET; /* If the DC does not have a DIB section selected, try a batch command */ if (!(pdcattr->ulDirty_ & DC_DIBSECTION)) { PGDIBSOBJECT pgO; pgO = GdiAllocBatchCommand(hdc, GdiBCSelObj); if (pgO) { pgO->hgdiobj = hfont; return hfontOld; } } /* We could not use the batch command, call win32k */ return NtGdiSelectFont(hdc, hfont); }
BOOL WINAPI MoveToEx( _In_ HDC hdc, _In_ INT x, _In_ INT y, _Out_opt_ LPPOINT ppt) { PDC_ATTR pdcattr; HANDLE_METADC(BOOL, MoveTo, FALSE, hdc, x, y, ppt); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } if (ppt) { if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit! { ppt->x = pdcattr->ptfxCurrent.x; // ret prev before change. ppt->y = pdcattr->ptfxCurrent.y; DPtoLP (hdc, ppt, 1); // reconvert back. } else { ppt->x = pdcattr->ptlCurrent.x; ppt->y = pdcattr->ptlCurrent.y; } } pdcattr->ptlCurrent.x = x; pdcattr->ptlCurrent.y = y; pdcattr->ulDirty_ &= ~DIRTY_PTLCURRENT; pdcattr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty return TRUE; }
/* * @implemented */ BOOL WINAPI GetWorldTransform(HDC hDC, LPXFORM lpXform) { #if 0 PDC_ATTR pdcattr; pdcattr = GdiGetDcAttr(hdc); if (!pdcattr) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; } if (pdcattr->flXform & ANY_XFORM_INVALID) { GdiFixupTransforms(pdcattr); } MatrixToXForm(lpXform, &pdcattr->mxWorldToDevice); #endif return NtGdiGetTransform(hDC, GdiWorldSpaceToPageSpace, lpXform); }
/* * @unimplemented */ BOOL WINAPI SetWindowExtEx( _In_ HDC hdc, _In_ INT nXExtent, _In_ INT nYExtent, _Out_opt_ LPSIZE lpSize) { PDC_ATTR pdcattr; ULONG ulType; /* Check what type of DC that is */ ulType = GDI_HANDLE_GET_TYPE(hdc); switch (ulType) { case GDILoObjType_LO_DC_TYPE: /* Handle this in the path below */ break; #if 0// FIXME: we don't support this case GDILoObjType_LO_METADC16_TYPE: return MFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize); case GDILoObjType_LO_METAFILE_TYPE: return EMFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize); #endif default: /* Other types are not allowed */ SetLastError(ERROR_INVALID_HANDLE); return FALSE; } /* Get the DC attr */ pdcattr = GdiGetDcAttr(hdc); if (!pdcattr) { /* Set the error value and return failure */ SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } if (lpSize) { lpSize->cx = pdcattr->szlWindowExt.cx; lpSize->cy = pdcattr->szlWindowExt.cy; if (pdcattr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; } if (pdcattr->dwLayout & LAYOUT_RTL) { NtGdiMirrorWindowOrg(hdc); pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); } else if ((pdcattr->iMapMode == MM_ISOTROPIC) || (pdcattr->iMapMode == MM_ANISOTROPIC)) { if ((pdcattr->szlWindowExt.cx == nXExtent) && (pdcattr->szlWindowExt.cy == nYExtent)) return TRUE; if ((!nXExtent) || (!nYExtent)) return FALSE; if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY) { NtGdiFlush(); // Sync up Dc_Attr from Kernel space. pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY); } } pdcattr->szlWindowExt.cx = nXExtent; pdcattr->szlWindowExt.cy = nYExtent; if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc); pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); } return TRUE; }
/* * @unimplemented */ INT WINAPI Escape( _In_ HDC hdc, _In_ INT nEscape, _In_ INT cbInput, _In_ LPCSTR lpvInData, _Out_ LPVOID lpvOutData) { INT retValue = SP_ERROR; ULONG ulObjType; ulObjType = GDI_HANDLE_GET_TYPE(hdc); if (ulObjType == GDILoObjType_LO_METADC16_TYPE) { return METADC16_Escape(hdc, nEscape, cbInput, lpvInData, lpvOutData); } switch (nEscape) { case ABORTDOC: /* Note: Windows checks if the handle has any user data for the ABORTDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } else { retValue = AbortDoc(hdc); } break; case DRAFTMODE: case FLUSHOUTPUT: case SETCOLORTABLE: /* Note 1: DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE are outdated */ /* Note 2: Windows checks if the handle has any user data for the DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE commands * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); } retValue = FALSE; break; case SETABORTPROC: /* Note: Windows checks if the handle has any user data for the SETABORTPROC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } retValue = SetAbortProc(hdc, (ABORTPROC)lpvInData); break; case GETCOLORTABLE: retValue = GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LPPALETTEENTRY)lpvOutData); if (!retValue) { retValue = SP_ERROR; } break; case ENDDOC: /* Note: Windows checks if the handle has any user data for the ENDDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } retValue = EndDoc(hdc); break; case GETSCALINGFACTOR: /* Note GETSCALINGFACTOR is outdated have been replace by GetDeviceCaps */ if (ulObjType == GDI_OBJECT_TYPE_DC) { if (lpvOutData) { PPOINT ptr = (PPOINT)lpvOutData; ptr->x = 0; ptr->y = 0; } } retValue = FALSE; break; case GETEXTENDEDTEXTMETRICS: retValue = GetETM(hdc, (EXTTEXTMETRIC *)lpvOutData) != 0; break; case STARTDOC: { DOCINFOA di; /* Note: Windows checks if the handle has any user data for the STARTDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } di.cbSize = sizeof(DOCINFOA); di.lpszOutput = 0; di.lpszDatatype = 0; di.fwType = 0; di.lpszDocName = lpvInData; /* NOTE : doc for StartDocA/W at msdn http://msdn2.microsoft.com/en-us/library/ms535793(VS.85).aspx */ retValue = StartDocA(hdc, &di); /* Check if StartDocA failed */ if (retValue < 0) { { retValue = GetLastError(); /* Translate StartDocA error code to STARTDOC error code * see msdn http://msdn2.microsoft.com/en-us/library/ms535472.aspx */ switch(retValue) { case ERROR_NOT_ENOUGH_MEMORY: retValue = SP_OUTOFMEMORY; break; case ERROR_PRINT_CANCELLED: retValue = SP_USERABORT; break; case ERROR_DISK_FULL: retValue = SP_OUTOFDISK; break; default: retValue = SP_ERROR; break; } } } } break; default: UNIMPLEMENTED; SetLastError(ERROR_CALL_NOT_IMPLEMENTED); } return retValue; }
/* * @implemented * */ int WINAPI GetDeviceCaps( _In_ HDC hdc, _In_ int nIndex) { PDC_ATTR pdcattr; PDEVCAPS pDevCaps = GdiDevCaps; // Primary display device capabilities. DPRINT("Device CAPS1\n"); HANDLE_METADC(INT, GetDeviceCaps, 0, hdc, nIndex); /* Get the DC attribute */ pdcattr = GdiGetDcAttr(hdc); if (pdcattr == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } if (!(pdcattr->ulDirty_ & DC_PRIMARY_DISPLAY)) return NtGdiGetDeviceCaps(hdc, nIndex); switch (nIndex) { case DRIVERVERSION: return pDevCaps->ulVersion; case TECHNOLOGY: return pDevCaps->ulTechnology; case HORZSIZE: return pDevCaps->ulHorzSize; case VERTSIZE: return pDevCaps->ulVertSize; case HORZRES: return pDevCaps->ulHorzRes; case VERTRES: return pDevCaps->ulVertRes; case LOGPIXELSX: return pDevCaps->ulLogPixelsX; case LOGPIXELSY: return pDevCaps->ulLogPixelsY; case BITSPIXEL: return pDevCaps->ulBitsPixel; case PLANES: return pDevCaps->ulPlanes; case NUMBRUSHES: return -1; case NUMPENS: return pDevCaps->ulNumPens; case NUMFONTS: return pDevCaps->ulNumFonts; case NUMCOLORS: return pDevCaps->ulNumColors; case ASPECTX: return pDevCaps->ulAspectX; case ASPECTY: return pDevCaps->ulAspectY; case ASPECTXY: return pDevCaps->ulAspectXY; case CLIPCAPS: return CP_RECTANGLE; case SIZEPALETTE: return pDevCaps->ulSizePalette; case NUMRESERVED: return 20; case COLORRES: return pDevCaps->ulColorRes; case DESKTOPVERTRES: return pDevCaps->ulVertRes; case DESKTOPHORZRES: return pDevCaps->ulHorzRes; case BLTALIGNMENT: return pDevCaps->ulBltAlignment; case SHADEBLENDCAPS: return pDevCaps->ulShadeBlend; case COLORMGMTCAPS: return pDevCaps->ulColorMgmtCaps; case PHYSICALWIDTH: return pDevCaps->ulPhysicalWidth; case PHYSICALHEIGHT: return pDevCaps->ulPhysicalHeight; case PHYSICALOFFSETX: return pDevCaps->ulPhysicalOffsetX; case PHYSICALOFFSETY: return pDevCaps->ulPhysicalOffsetY; case VREFRESH: return pDevCaps->ulVRefresh; case RASTERCAPS: return pDevCaps->ulRasterCaps; case CURVECAPS: return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); case LINECAPS: return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE | LC_STYLED | LC_WIDESTYLED | LC_INTERIORS); case POLYGONALCAPS: return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS); case TEXTCAPS: return pDevCaps->ulTextCaps; case PDEVICESIZE: case SCALINGFACTORX: case SCALINGFACTORY: default: return 0; } return 0; }