diff --git a/headers/private/servers/app/DisplayDriver.h b/headers/private/servers/app/DisplayDriver.h index 74f321006d..c1868f29fc 100644 --- a/headers/private/servers/app/DisplayDriver.h +++ b/headers/private/servers/app/DisplayDriver.h @@ -42,9 +42,11 @@ #include #include "PatternHandler.h" #include "LayerData.h" +#include "ServerBitmap.h" +#include +#include FT_FREETYPE_H class ServerCursor; -class ServerBitmap; #ifndef ROUND #define ROUND(a) ( (long)(a+.5) ) @@ -116,6 +118,22 @@ private: float maxy; }; +/*! + \class FBBitmap DisplayDriver.h + \brief Class used for easily passing around information about the framebuffer +*/ +class FBBitmap : public ServerBitmap +{ +public: + FBBitmap(void) : ServerBitmap(BRect(0,0,0,0),B_NO_COLOR_SPACE,0) { } + ~FBBitmap(void) { } + void SetBytesPerRow(const int32 &bpr) { _bytesperrow=bpr; } + void SetSpace(const color_space &space) { _space=space; } + void SetSize(const int32 &w, const int32 &h) { _width=w; _height=h; } + void SetBuffer(void *ptr) { _buffer=(uint8*)ptr; } + void SetBitsPerPixel(color_space space,int32 bytesperline) { _HandleSpace(space,bytesperline); } +}; + /*! \class DisplayDriver DisplayDriver.h \brief Mostly abstract class which handles all graphics output for the server. @@ -248,6 +266,16 @@ protected: // virtual void FillPatternRect(int32 left, int32 top, int32 right, int32 bottom); virtual void SetThickPatternPixel(int x, int y); + // Blit functions specific to FreeType2 glyph copying. These probably could be replaced with + // more generic functions, but these are written and can be replaced later. + void BlitMono2RGB32(FT_Bitmap *src, const BPoint &pt, const DrawData *d); + void BlitGray2RGB32(FT_Bitmap *src, const BPoint &pt, const DrawData *d); + + // Two functions for gaining direct access to the framebuffer of a child class. This removes the need + // for a set of glyph-blitting virtual functions for each driver. + virtual bool AcquireBuffer(FBBitmap *bmp); + virtual void ReleaseBuffer(void); + void FillArc(const BRect &r, const float &angle, const float &span, DisplayDriver*, SetHorizontalLineFuncType setLine); void FillBezier(BPoint *pts, DisplayDriver* driver, SetHorizontalLineFuncType setLine); void FillEllipse(const BRect &r, DisplayDriver* driver, SetHorizontalLineFuncType setLine); diff --git a/headers/private/servers/app/ServerFont.h b/headers/private/servers/app/ServerFont.h index 163e3c1a58..a3d804429f 100644 --- a/headers/private/servers/app/ServerFont.h +++ b/headers/private/servers/app/ServerFont.h @@ -40,19 +40,19 @@ public: uint16 flags=0, uint8 spacing=B_CHAR_SPACING); ServerFont(const ServerFont &font); ~ServerFont(void); - font_direction Direction(void) { return fdirection; } - uint32 Encoding(void) { return fencoding; } - edge_info Edges(void) { return fedges; } - uint32 Flags(void) { return fflags; } - uint32 Spacing(void) { return fspacing; } - float Shear(void) { return fshear; } - float Rotation(void) { return frotation; } - float Size(void) { return fsize; } - uint32 Face(void) { return fface; } + font_direction Direction(void) const { return fdirection; } + uint32 Encoding(void) const { return fencoding; } + edge_info Edges(void) const { return fedges; } + uint32 Flags(void) const { return fflags; } + uint32 Spacing(void) const { return fspacing; } + float Shear(void) const { return fshear; } + float Rotation(void) const { return frotation; } + float Size(void) const { return fsize; } + uint32 Face(void) const { return fface; } uint32 CountGlyphs(void); int32 CountTuned(void); font_file_format FileFormat(void); - FontStyle *Style(void) { return fstyle; } + FontStyle *Style(void) const { return fstyle; } void SetDirection(const font_direction &dir) { fdirection=dir; } void SetEdges(const edge_info &info) { fedges=info; } @@ -67,7 +67,8 @@ public: BRect BoundingBox(void); void Height(font_height *fh); - ServerFont& operator=(const ServerFont& font); + ServerFont &operator=(const ServerFont& font); + protected: friend class FontStyle; FontStyle *fstyle;