⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdiobj.h

📁 WinCE5.0部分核心源码
💻 H
📖 第 1 页 / 共 2 页
字号:
    @cmember void | ~BRUSH | () | Destructor.

    @cmember BOOL | Create | (CONST LOGBRUSH *) | Required initialization.

    @cmember virtual int | GetObject | (int,PVOID) |
        Returns information about the brush.
    @cmember virtual GDIOBJ * | SelectObject | (DC *) | Selects brush into DC.
*/
class Brush_t : public GDIOBJ
{
private:

	void*
	operator new(
		size_t
		);


	Brush_t(
		GdiObjectHandle_t
		);


public:

	LOGBRUSH	m_LogBrush;
	MBITMAP*	m_pBitmap;  // bitmap containing pattern

	static
	Brush_t*
	New(
		void
		);

	void
	operator delete(
		void*
		);



	~Brush_t(
		void
		);

	HBRUSH
	GetHBRUSH(
		void
		);



	static
	Brush_t*
	GET_pBRUSH(
		HGDIOBJ
		);



    BOOL
	Create(
		const	LOGBRUSH*
		);


    virtual
	int
	GetObject(
		int,
		PVOID
		);



    virtual
	GDIOBJ*
	SelectObject(
		DC*
		);


    #if DEBUG
    virtual int     Dump (void);
    #endif

};


struct LOGFONTWITHATOM
{
    LONG      lfHeight;
    LONG      lfWidth;
    LONG      lfEscapement;
    LONG      lfOrientation;
    LONG      lfWeight;
    BYTE      lfItalic;
    BYTE      lfUnderline;
    BYTE      lfStrikeOut;
    BYTE      lfCharSet;
    BYTE      lfOutPrecision;
    BYTE      lfClipPrecision;
    BYTE      lfQuality;
    BYTE      lfPitchAndFamily;
    ATOM      lfAtomFaceName;
};


class FontOverrides_t
{
private:
	static int   s_NativeAngle;          // This is the orientation of the LCD. 
	                                     // for which the driver supports ClearType.
	static int   s_CurrentAngle;         // This is used when ClearType is turned on or off.
	static bool  s_AllowAntialiased;     // Is the Antialiased override regkey set?
	static bool  s_AllowClearType;       // Is the ClearType override regkey set?
	static bool  s_OffOnRotation;        // Do we turn ClearType off on Rotation?

	static bool  s_UseAntialiasedFonts;  // Should SelectObject use Antialiased fonts?
	static bool  s_UseClearTypeFonts;    // Should SelectObject use ClearType fonts?
	static DWORD s_ClearTypeQuality;     // What quality should SelectObject use for
	                                     // for ClearType.

	static
	void
	UpdateOverrides();

public:
	static
	void
	Initialize();

	static
	bool
	Rotate(int Angle);

	static
	BOOL
	SetFontSmoothing(BOOL bSmoothing);

	static
	bool
	UseAntialiasedFonts() { return s_UseAntialiasedFonts; }

	static
	bool
	UseClearTypeFonts() { return s_UseClearTypeFonts; }

	static
	DWORD
	ClearTypeQuality() { return s_ClearTypeQuality; }
};

class Font_t : public GDIOBJ
{
private:

	void*
	operator new(
		size_t
		);

	Font_t(
				GdiObjectHandle_t,
		const	LOGFONTW*
		);

public:
	LOGFONTWITHATOM	m_LogFont;

	//	TrueType font realizations (RFONTOBJ); unused in the raster font engine.
	void*	m_prfont;           // Monochrome realization
	void*	m_prfontAA;         // Anti-Aliased version of this realization
	void*	m_prfontCT;
	UINT32	m_uEffxDisplay;     // Display-time font effects, eg, Bold, underline, strikeout


	static
	Font_t*
	New(
		const	LOGFONTW*
		);

	void
	operator delete(
		void*
		);


	~Font_t(
		void
		);


	static
	Font_t*
	GET_pFONT(
		HFONT
		);




	HFONT
	GetHFONT(
		void
		);



	virtual
	int
	GetObject(
		int,
		void*
		);



	virtual
	GDIOBJ*
	SelectObject(
		DC*
		);

#if DEBUG
	virtual
	int
	Dump(
		void
		);
#endif
};



class Palette_t : public GDIOBJ
{
private:

    ColorTable_t  *m_pcolortbl;

	void*
	operator new(
		size_t
		);

	Palette_t(
		GdiObjectHandle_t	GdiObjectHandle
		);

public:

	static
	Palette_t*
	New(
		void
		);


	void
	operator delete(
		void*
		);



	~Palette_t(
		void
		);

	//	If constructor succeeds (ppalette, handle are not NULL),
	//	FInitPal() has to be called to init newly created object
    BOOL
	FInitPalette(
		const	PALETTEENTRY*	ppe,
				ULONG			cLogPalEntries,
				BOOL			fStock
				);


	static
	Palette_t*
	GET_pPALETTE(
		HPALETTE
		);



	HPALETTE
	GetHPALETTE(
		void
		) const;




	virtual
	int
	GetObject(
		int,
		PVOID
		);



    virtual
	GDIOBJ*
	SelectObject(
		DC*
		);


	Palette_t*
	SelectPalette(
		DC*
		);

	//	Getting/Setting palette entries, all params are expected to be validated by the caller.
    void
	GetEntries(
		UINT32			uiStart,
		UINT32			uiNum,
		PALETTEENTRY*	pPe
		);

	void
	SetEntries(
				UINT32			uiStart,
				UINT32			uiNum,
		const	PALETTEENTRY*	pPe
		);


    ULONG
	xxxSetSysPal(
		Driver_t*	pdriver
		);


#ifdef DEBUG
    virtual
	int
	Dump(
		void
		)
	{
		int cThis = 0;
		DEBUGMSG (1, (TEXT("PALETTE size=%d\r\n"), cThis = LocalSize(this)));
		return cThis;
	}
#endif

	ColorTable_t*
	Pcolortbl(
		void
		) const;

	PALETTEENTRY*
	PPalentries(
		void
		) const;

	USHORT
	CEntries(
		void
		) const;


};


//
// At app activation is called by DefWinProc if app is not processing
// WM_QUERYNEWPALETTE message
//
void LoadDefaultPalette(HWND hwnd);

//
// Creates default(stock) palette object on !PAL_INDEXED hw platforms
//
HPALETTE HCreateDefaultPal(void);


//
// GdiMonitor_t maps a Driver_t object to a HMONITOR.
//

class Disp_Driver;

class GdiMonitor_t : public GDIOBJ
{
private:
	Disp_Driver * m_pDriver;

	GdiMonitor_t(
		GdiObjectHandle_t GdiObjectHandle,
		Disp_Driver*      pDriver
		);

public:
	static
	GdiMonitor_t *
	New(
		Disp_Driver* pDriver
		);

	~GdiMonitor_t(
		void
		);

	Disp_Driver *
	GetDriver(
		void
		) const;

	HMONITOR
	GetHMONITOR(
		void
		) const;

	static
	GdiMonitor_t*
	GET_pMONITOR(
		HMONITOR	
		);

	virtual
	int
	GetObject(
		int    CntBytesBuffer,
		void * pObject
		);

	virtual
	GDIOBJ*
	SelectObject(
		DC*
		);

#if DEBUG
	virtual
	int
	Dump(
		void
		);
#endif
};


//
// PRTSTAT is used to track the status of a print job.  It is only used
// in printer DCs.
//
// The normal usage of a printer DC looks something like this (the comment
// on each line says what PRTSTAT the DC has after each statement):
//
//      HDC hdc = CreateDC(..."PRINTER"...);    // prtstatPreDoc
//
//      StartDoc(hdc, pdocinfo);                // prtstatPrePage
//
//      while (more pages to print)
//      {
//          StartPage(hdc);                     // prtstatRecord
//
//          /* Compose page via GDI calls */
//
//          EndPage(hdc);                       // prtstatPlayback as GDI
//                                              // commands are banded to the
//                                              // driver, then
//                                              // prtstatPostPage when done
//      }
//
//      EndDoc(hdc);                            // prtstatPreDoc
//
// If the apps calls AbortDoc, the print job is aborted and the print DC's
// state is returned to prtstatPreDoc (which means the print job can be
// tried again by calling StartDoc).
//
typedef BYTE PRTSTAT;

//
// Normal printer DC usage will progress through these states in order
//
#define prtstatPreDoc   ((PRTSTAT)0)    // Waiting for call to StartDoc
#define prtstatPrePage  ((PRTSTAT)1)    // Waiting for call to StartPage
#define prtstatRecord   ((PRTSTAT)2)    // Recording GDI calls into metafile
#define prtstatPlayback ((PRTSTAT)3)    // Playing metafile back to driver
#define prtstatPostPage ((PRTSTAT)4)    // Page has been played back to driver




//
// Flags for dc.m_ulDirty.
//
#define DC_PLAYMETAFILE         0x00000001


// macros to validate the handles passed in and setup some local variables
// for accessing the handle information.

#define DC_PDC(hdc, pdc, ret)                   \
    do {                                        \
        pdc = DC::GET_pDC(hdc);                     \
		if ( !pdc )	\
        {                                       \
            ASSERT(0);                        \
            SetLastError(ERROR_INVALID_HANDLE); \
            return(ret);                        \
        }                                       \
    } while (0)




#define IS_RGND(P)          ((P)->rdh.nCount < 0x10000)

ULONG   iBmfFromBpp(INT32 iBpp);
INT32   iBppFromBmf(ULONG iBitmapFormat);
void    dib_setup(SURFOBJ *, UINT32 *, ULONG, INT32, INT32);
BOOL    FValidBMI(CONST BITMAPINFO *pbmpi, UINT iUsage);

int InitializeGdiObjConstructors(void);


#endif  // _GDIOBJ_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -