1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/dispdev/RCS/wdispgdi.h $
4 // $Date: 1996/11/21 10:36:59 $
7 // The Provider and Mode Operations for GDI. These are really two inseperable
8 // halves of the same object.
16 ///////////////////////////////////////////////////////////////////////////////
18 // CLASS: cGDIProvider
20 // Implements GDI based version of modeless display device operations
23 class cGDIProvider
: public cWinDisplayProvider
26 cGDIProvider(cWinDisplayDevice
* pOwner
);
27 virtual ~cGDIProvider();
31 ///////////////////////////////////
33 // Hooks from cWinDisplayProvider
35 virtual void DoGetInfo(sGrDeviceInfo
*, sGrModeInfo
*);
36 virtual BOOL
DoOpen(sGrModeCap
*, int flags
);
37 virtual BOOL
DoClose();
38 virtual cWinDisplayModeOperations
* DoSetMode(const sGrModeInfo
&, int flags
, sGrModeCap
* pReturnModeInfo
);
40 void AdjustWindow(BOOL fToMode
= FALSE
);
44 virtual BOOL
DoProcessMessage(UINT msg
, WPARAM wParam
, LPARAM lParam
, long * pRetVal
);
46 friend class cGDIModeOps
;
50 void PickPalette(BOOL fActive
= TRUE
);
51 void ClearSystemPalette();
52 void SetSystemPaletteEntries(BOOL
);
54 ///////////////////////////////////
56 cGDIModeOps
* const m_pGDIModeOps
;
58 int m_fUsingStaticColors
;
61 ///////////////////////////////////
63 // Palette used to help Windows show reasonable 16-bit with 8-bit screen driver
64 HPALETTE m_h16to8RemapPalette
;
67 ///////////////////////////////////////////////////////////////////////////////
71 // Implements GDI based version of mode-based display device operations
74 class cGDIModeOps
: public cWinDisplayModeOperations
77 cGDIModeOps(cWinDisplayDevice
* pDisplayDevice
, cGDIProvider
* pOwner
)
78 : cWinDisplayModeOperations(pDisplayDevice
),
81 m_hOffscreenBitmap(0),
83 m_hStrict8BitPalette(0),
84 m_hMappable8BitPalette(0),
89 virtual ~cGDIModeOps();
91 BOOL
StartMode(const sGrModeInfo
&, int flags
, sGrModeCap
* pReturnModeInfo
);
94 // Implementations of operations
96 virtual BOOL
DoSetPalette(LOGPALETTE
& palette
, unsigned uStart
, unsigned n
);
97 virtual BOOL
DoLock(sGrModeCap
*);
98 virtual BOOL
DoUnlock();
99 virtual void DoFlush();
100 virtual void DoFlushRect(int x0
, int y0
, int x1
, int y1
);
102 void UpdateDisplay();
104 BITMAPINFOHEADER m_OffscreenInfo
;
106 HBITMAP m_hOffscreenBitmap
;
107 HBITMAP m_hOldBitmap
;
109 HPALETTE m_hStrict8BitPalette
;
110 HPALETTE m_hMappable8BitPalette
;
111 HPALETTE m_hCurrentPalette
;
113 cGDIProvider
* const m_pOwner
;
114 friend class cGDIProvider
;
117 ///////////////////////////////////////////////////////////////////////////////
119 #endif /* !__WDISPGDI_H */