#ifndef __DEVCON_HPP #define __DEVCON_HPP #endif #include "region.hpp" #include "txtwnd.hpp" struct DeviceContext; Bool GpiQueryCellAttr(DeviceContext *dc, const FPoint &p, int *a); Bool GpiQueryCellChar(DeviceContext *dc, const FPoint &p, char *c); Bool GpiQueryCellData(DeviceContext *dc, const FPoint &p, uint16 *d); void GpiSetCellAttr(DeviceContext *dc, const FPoint &p, int a); void GpiSetCellChar(DeviceContext *dc, const FPoint &p, char c); void GpiSetCellData(DeviceContext *dc, const FPoint &p, uint16 d); enum bkmode_t { bm_transparent, bm_opaque }; void GpiSetBkMode(DeviceContext *dc, bkmode_t m); enum color { clr_black, clr_blue, clr_green, clr_cyan, clr_red, clr_magenta, clr_brown, clr_lightgray, clr_darkgray, clr_lightblue, clr_lightgreen, clr_lightcyan, clr_lightred, clr_lightmagenta, clr_yellow, clr_white }; void GpiSetTextColor(DeviceContext *dc, color c); void GpiSetTextBackgroundColor(DeviceContext *dc, color c); FPoint GpiOuttext(DeviceContext *dc, int x, int y, char *psz); inline FPoint GpiOuttext(DeviceContext *dc, const FPoint &p, char *psz) { return GpiOuttext(dc,p.x,p.y,psz); } enum { DT_LEFT = 0x0000, DT_CALCRECT = 0x0002, DT_TEXTATTRS = 0x0040, DT_CENTER = 0x0100, DT_RIGHT = 0x0200, DT_WORDBREAK = 0x4000, DT_ERASERECT = 0x8000 }; Bool GpiDrawText(DeviceContext *dc, const char *psz, int textlen, FRect *rect, color fore, color back, uint32 format); void GpiFillRect(DeviceContext *dc, const FRect &r, int color, char c); void GpiFillRect(DeviceContext *dc, int xLeft, int yTop, int xRight, int yBottom, int color, char c); inline void GpiEraseRect(DeviceContext *dc, const FRect &r, int color) { GpiFillRect(dc,r,color,' '); } inline void GpiEraseRect(DeviceContext *dc, int xLeft, int yTop, int xRight, int yBottom, int color) { GpiFillRect(dc,xLeft,yTop,xRight,yBottom,color,' '); } Bool GpiSetClip(DeviceContext *dc, const Region &newClip); DeviceContext *WinGetScreenDC(); DeviceContext *WinGetWindowDC(Window *wnd); DeviceContext *WinBeginPaint(Window *wnd, FRect *paintRect=0); void WinEndPaint(DeviceContext *dc); void WinReleaseDC(DeviceContext *dc); Bool _initScreen(); Bool _endScreen();