From 27398d4966deab63ef99b38c32dbf09e8bed5e6b Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Tue, 20 Mar 2001 01:55:18 +0000 Subject: [PATCH] Implemented Get/SetDeviceGammaRamp. --- dlls/ttydrv/dc.c | 2 ++ dlls/wineps/init.c | 2 ++ graphics/enhmetafiledrv/init.c | 2 ++ graphics/metafiledrv/init.c | 2 ++ graphics/win16drv/init.c | 2 ++ graphics/x11drv/init.c | 2 ++ include/gdi.h | 2 ++ include/wingdi.h | 2 ++ objects/dc.c | 32 +++++++++++++++++++++++++++++--- 9 files changed, 45 insertions(+), 3 deletions(-) diff --git a/dlls/ttydrv/dc.c b/dlls/ttydrv/dc.c index 2bc7163b9e2..a576532a64e 100644 --- a/dlls/ttydrv/dc.c +++ b/dlls/ttydrv/dc.c @@ -54,6 +54,7 @@ static const DC_FUNCTIONS TTYDRV_DC_Driver = NULL, /* pFrameRgn */ TTYDRV_DC_GetCharWidth, /* pGetCharWidth */ NULL, /* pGetDCOrgEx */ + NULL, /* pGetDeviceGammaRamp */ TTYDRV_DC_GetPixel, /* pGetPixel */ NULL, /* pGetPixelFormat */ TTYDRV_DC_GetTextExtentPoint, /* pGetTextExtentPoint */ @@ -90,6 +91,7 @@ static const DC_FUNCTIONS TTYDRV_DC_Driver = TTYDRV_DC_SetBkColor, /* pSetBkColor */ NULL, /* pSetBkMode */ TTYDRV_DC_SetDeviceClipping, /* pSetDeviceClipping */ + NULL, /* pSetDeviceGammaRamp */ TTYDRV_DC_SetDIBitsToDevice, /* pSetDIBitsToDevice */ NULL, /* pSetMapMode (optional) */ NULL, /* pSetMapperFlags */ diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c index 5905f0125b6..70028d2e2ab 100644 --- a/dlls/wineps/init.c +++ b/dlls/wineps/init.c @@ -58,6 +58,7 @@ static const DC_FUNCTIONS PSDRV_Funcs = NULL, /* pFrameRgn */ PSDRV_GetCharWidth, /* pGetCharWidth */ NULL, /* pGetDCOrgEx */ + NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ PSDRV_GetTextExtentPoint, /* pGetTextExtentPoint */ @@ -94,6 +95,7 @@ static const DC_FUNCTIONS PSDRV_Funcs = PSDRV_SetBkColor, /* pSetBkColor */ NULL, /* pSetBkMode */ PSDRV_SetDeviceClipping, /* pSetDeviceClipping */ + NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDIBitsToDevice */ NULL, /* pSetMapMode (optional) */ NULL, /* pSetMapperFlags */ diff --git a/graphics/enhmetafiledrv/init.c b/graphics/enhmetafiledrv/init.c index 0bd69adad37..3609bf9068f 100644 --- a/graphics/enhmetafiledrv/init.c +++ b/graphics/enhmetafiledrv/init.c @@ -53,6 +53,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_FrameRgn, /* pFrameRgn */ NULL, /* pGetCharWidth */ NULL, /* pGetDCOrgEx */ + NULL, /* pGetDeviceGammaRamp */ NULL, /* no implementation */ /* pGetPixel */ NULL, /* pGetPixelFormat */ NULL, /* pGetTextExtentPoint */ @@ -89,6 +90,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_SetBkColor, /* pSetBkColor */ EMFDRV_SetBkMode, /* pSetBkMode */ NULL, /* pSetDeviceClipping */ + NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDIBitsToDevice */ EMFDRV_SetMapMode, /* pSetMapMode */ EMFDRV_SetMapperFlags, /* pSetMapperFlags */ diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c index 9f807477d20..b325f8d61b4 100644 --- a/graphics/metafiledrv/init.c +++ b/graphics/metafiledrv/init.c @@ -53,6 +53,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_FrameRgn, /* pFrameRgn */ NULL, /* pGetCharWidth */ NULL, /* pGetDCOrgEx */ + NULL, /* pGetDeviceGammaRamp */ NULL, /* no implementation */ /* pGetPixel */ NULL, /* pGetPixelFormat */ NULL, /* pGetTextExtentPoint */ @@ -89,6 +90,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_SetBkColor, /* pSetBkColor */ MFDRV_SetBkMode, /* pSetBkMode */ NULL, /* pSetDeviceClipping */ + NULL, /* pSetDeviceGammaRamp */ MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ MFDRV_SetMapMode, /* pSetMapMode */ MFDRV_SetMapperFlags, /* pSetMapperFlags */ diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c index 40f9923b1f8..e9588f92af5 100644 --- a/graphics/win16drv/init.c +++ b/graphics/win16drv/init.c @@ -79,6 +79,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs = NULL, /* pFrameRgn */ WIN16DRV_GetCharWidth, /* pGetCharWidth */ NULL, /* pGetDCOrgEx */ + NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ WIN16DRV_GetTextExtentPoint, /* pGetTextExtentPoint */ @@ -115,6 +116,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs = NULL, /* pSetBkColor */ NULL, /* pSetBkMode */ NULL, /* pSetDeviceClipping */ + NULL, /* pSetDeviceGammaRamp */ NULL, /* pSetDIBitsToDevice */ NULL, /* pSetMapMode */ NULL, /* pSetMapperFlags */ diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c index d1fcb4efe03..56c49e532a0 100644 --- a/graphics/x11drv/init.c +++ b/graphics/x11drv/init.c @@ -62,6 +62,7 @@ const DC_FUNCTIONS X11DRV_DC_Funcs = NULL, /* pFrameRgn */ X11DRV_GetCharWidth, /* pGetCharWidth */ X11DRV_GetDCOrgEx, /* pGetDCOrgEx */ + X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ X11DRV_GetPixel, /* pGetPixel */ X11DRV_GetPixelFormat, /* pGetPixelFormat */ X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */ @@ -98,6 +99,7 @@ const DC_FUNCTIONS X11DRV_DC_Funcs = X11DRV_SetBkColor, /* pSetBkColor */ NULL, /* pSetBkMode */ X11DRV_SetDeviceClipping, /* pSetDeviceClipping */ + X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */ X11DRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */ NULL, /* pSetMapMode (optional) */ NULL, /* pSetMapperFlags */ diff --git a/include/gdi.h b/include/gdi.h index b96af4e9e66..6db9c560c8a 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -199,6 +199,7 @@ typedef struct tagDC_FUNCS BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT); BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT); BOOL (*pGetDCOrgEx)(DC*,LPPOINT); + BOOL (*pGetDeviceGammaRamp)(DC*,LPVOID); COLORREF (*pGetPixel)(DC*,INT,INT); INT (*pGetPixelFormat)(DC*); BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE); @@ -235,6 +236,7 @@ typedef struct tagDC_FUNCS COLORREF (*pSetBkColor)(DC*,COLORREF); INT (*pSetBkMode)(DC*,INT); VOID (*pSetDeviceClipping)(DC*); + BOOL (*pSetDeviceGammaRamp)(DC*,LPVOID); INT (*pSetDIBitsToDevice)(DC*,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT, LPCVOID,const BITMAPINFO*,UINT); INT (*pSetMapMode)(DC*,INT); diff --git a/include/wingdi.h b/include/wingdi.h index 97128ea9393..0dde49e60f3 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3139,6 +3139,7 @@ BOOL WINAPI GetColorAdjustment(HDC, LPCOLORADJUSTMENT); HANDLE WINAPI GetCurrentObject(HDC,UINT); BOOL WINAPI GetCurrentPositionEx(HDC,LPPOINT); INT WINAPI GetDeviceCaps(HDC,INT); +BOOL WINAPI GetDeviceGammaRamp(HDC,LPVOID); COLORREF WINAPI GetDCBrushColor(HDC); BOOL WINAPI GetDCOrgEx(HDC,LPPOINT); COLORREF WINAPI GetDCPenColor(HDC); @@ -3286,6 +3287,7 @@ UINT WINAPI SetBoundsRect(HDC,const RECT*,UINT); BOOL WINAPI SetBrushOrgEx(HDC,INT,INT,LPPOINT); BOOL WINAPI SetColorAdjustment(HDC,const COLORADJUSTMENT*); HCOLORSPACE WINAPI SetColorSpace(HDC,HCOLORSPACE); +BOOL WINAPI SetDeviceGammaRamp(HDC,LPVOID); UINT WINAPI SetDIBColorTable(HDC,UINT,UINT,RGBQUAD*); INT WINAPI SetDIBits(HDC,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); INT WINAPI SetDIBitsToDevice(HDC,INT,INT,DWORD,DWORD,INT, diff --git a/objects/dc.c b/objects/dc.c index d754316aa60..cc4ba0215c3 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -1285,9 +1285,35 @@ INT WINAPI SetICMMode(HDC hdc, INT iEnableICM) /*********************************************************************** * GetDeviceGammaRamp (GDI32.@) */ -BOOL WINAPI GetDeviceGammaRamp(HDC hdc,LPVOID ptr) { - FIXME("(%x,%p), empty stub!\n",hdc,ptr); - return FALSE; +BOOL WINAPI GetDeviceGammaRamp(HDC hDC, LPVOID ptr) +{ + BOOL ret = FALSE; + DC *dc = DC_GetDCPtr( hDC ); + + if( dc ) + { + if (dc->funcs->pGetDeviceGammaRamp) + ret = dc->funcs->pGetDeviceGammaRamp(dc, ptr); + GDI_ReleaseObj( hDC ); + } + return ret; +} + +/*********************************************************************** + * SetDeviceGammaRamp (GDI32.@) + */ +BOOL WINAPI SetDeviceGammaRamp(HDC hDC, LPVOID ptr) +{ + BOOL ret = FALSE; + DC *dc = DC_GetDCPtr( hDC ); + + if( dc ) + { + if (dc->funcs->pSetDeviceGammaRamp) + ret = dc->funcs->pSetDeviceGammaRamp(dc, ptr); + GDI_ReleaseObj( hDC ); + } + return ret; } /***********************************************************************