convert line ends
[canaan.git] / prj / tech / libsrc / dispdev / wdispgdi.h
blobcbc522330f1e2862e26c79d46ddd7d61b559cc91
1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/dispdev/RCS/wdispgdi.h $
3 // $Author: TOML $
4 // $Date: 1996/11/21 10:36:59 $
5 // $Revision: 1.7 $
6 //
7 // The Provider and Mode Operations for GDI. These are really two inseperable
8 // halves of the same object.
9 //
11 #ifndef __WDISPGDI_H
12 #define __WDISPGDI_H
14 class cGDIModeOps;
16 ///////////////////////////////////////////////////////////////////////////////
18 // CLASS: cGDIProvider
20 // Implements GDI based version of modeless display device operations
23 class cGDIProvider : public cWinDisplayProvider
25 public:
26 cGDIProvider(cWinDisplayDevice * pOwner);
27 virtual ~cGDIProvider();
29 private:
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);
42 ///////////////
44 virtual BOOL DoProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, long * pRetVal);
46 friend class cGDIModeOps;
48 ///////////////
50 void PickPalette(BOOL fActive = TRUE);
51 void ClearSystemPalette();
52 void SetSystemPaletteEntries(BOOL);
54 ///////////////////////////////////
56 cGDIModeOps * const m_pGDIModeOps;
58 int m_fUsingStaticColors;
59 int m_fStrictPalette;
61 ///////////////////////////////////
63 // Palette used to help Windows show reasonable 16-bit with 8-bit screen driver
64 HPALETTE m_h16to8RemapPalette;
67 ///////////////////////////////////////////////////////////////////////////////
69 // CLASS: cGDIModeOps
71 // Implements GDI based version of mode-based display device operations
74 class cGDIModeOps : public cWinDisplayModeOperations
76 private:
77 cGDIModeOps(cWinDisplayDevice * pDisplayDevice, cGDIProvider * pOwner)
78 : cWinDisplayModeOperations(pDisplayDevice),
79 m_pOwner(pOwner),
80 m_hOffscreenDC(0),
81 m_hOffscreenBitmap(0),
82 m_hOldBitmap(0),
83 m_hStrict8BitPalette(0),
84 m_hMappable8BitPalette(0),
85 m_hCurrentPalette(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;
105 HDC m_hOffscreenDC;
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 */