#ifndef __DEVCTXT_H_INCLUDED #define __DEVCTXT_H_INCLUDED #include "wintype.h" #include "gfxtype.h" #include "gfxobj.h" #define DCTXT_SIG_WORD 0x78744344 /* "DCtx */ /* Raster operation codes */ #define R2_BLACK 1 #define R2_NOTMERGEPEN 2 #define R2_MASKNOTPEN 3 #define R2_NOTCOPYPEN 4 #define R2_MASKPENNOT 5 #define R2_NOT 6 #define R2_XORPEN 7 #define R2_NOTMASKPEN 8 #define R2_MASKPEN 9 #define R2_NOTXORPEN 10 #define R2_NOP 11 #define R2_MERGENOTPEN 12 #define R2_COPYPEN 13 #define R2_MERGEPENNOT 14 #define R2_MERGEPEN 15 #define R2_WHITE 16 typedef COLORREF (*DCtx_SetPixel)(PVOID privdata, INT32 x, INT32 y, COLORREF color, INT32 op); typedef BOOL (*DCtx_Line)(PVOID privdata, INT32 x1, INT32 y1, INT32 x2, INT32 y2, COLORREF color, INT32 op); typedef struct tagDCFUNTABLE { DCtx_SetPixel set_pixel; /* sets a single pixel on the display */ DCtx_Line line; /* draws a line on the display */ } DCFUNTABLE; typedef const DCFUNTABLE *PDCFUNTABLE; typedef struct tagDCTXT { GFXOBJECT hdr; /* the header of all objects */ PDCFUNTABLE funcs; /* device context functions */ PVOID privdata; /* private data for the type of DC */ RECT cliprect; /* clipping rectangle */ POINT pos; /* current position */ UINT32 rop2; /* current raster operation */ COLORREF color; /* current drawing color (XXX replace with pens later) */ } DCTXT, *PDCTXT; extern PDCTXT _DC_Allocate(PDCFUNTABLE funcs, PVOID privdata); extern void _DC_FinalizeCommon(PDCTXT pdctxt); extern COLORREF DC_SetPixel(PDCTXT pdctxt, INT32 x, INT32 y, COLORREF color); extern BOOL DC_LineTo(PDCTXT pdctxt, INT32 x, INT32 y); extern BOOL DC_MoveTo(PDCTXT pdctxt, INT32 x, INT32 y, PPOINT oldpt); extern BOOL DC_Rectangle(PDCTXT pdctxt, INT32 left, INT32 top, INT32 right, INT32 bottom); extern UINT32 DC_GetROP2(PDCTXT pdctxt); extern UINT32 DC_SetROP2(PDCTXT pdctxt, UINT32 rop); extern COLORREF DC_GetTextColor(PDCTXT pdctxt); extern COLORREF DC_SetTextColor(PDCTXT pdctxt, COLORREF cr); extern BOOL DC_GetClipRect(PDCTXT pdctxt, PRECT prect); extern BOOL DC_SetClipRect(PDCTXT pdctxt, PRECT prect); #define DC_addref(pdctxt) Go_addref(&(pdctxt->hdr)) #define DC_release(pdctxt) Go_release(&(pdctxt->hdr)) #endif /* __DEVCTXT_H_INCLUDED */