Many misc. updates, including a couple new font classes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1163 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2002-09-24 22:49:57 +00:00
parent c9ea158353
commit 83a57b389a
7 changed files with 477 additions and 88 deletions
+126 -49
View File
@@ -21,15 +21,13 @@
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">The DisplayDriver class is not a useful class unto itself. It is to provide a consistent interface for the rest of the app_server to whatever rendering context it is utilizing, whether it be a remote screen, a ServerBitmap, installed graphics hardware, or whatever. Documentation below will describe the role of each function.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<P class="Body" style="margin: 0px">
<HR>
</P>
<P class="Body" style="margin: 0px"><BR>
Member Functions</P>
<P class="Body" style="margin: 0px">Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=618 HEIGHT=537 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TABLE WIDTH=618 HEIGHT=602 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">DisplayDriver(void)</P>
@@ -48,47 +46,47 @@ Member Functions</P>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=32>
<P class="Body" style="margin: 0px">void DrawBitmap(ServerBitmap *bmp, SRect src, SRect dest)</P>
<P class="Body" style="margin: 0px">void DrawBitmap(ServerBitmap *bmp, BRect src, BRect dest)</P>
</TD>
<TD WIDTH=240 HEIGHT=32>
<P class="Body" style="margin: 0px">void DrawChar(char c, SPoint pt)</P>
<P class="Body" style="margin: 0px">void DrawChar(char c, BPoint pt)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=47>
<P class="Body" style="margin: 0px">void DrawString(const char *string, int32 length, SPoint pt, escapement_delta *delta=NULL)</P>
<P class="Body" style="margin: 0px">void DrawString(const char *string, int32 length, BPoint pt, escapement_delta *delta=NULL)</P>
</TD>
<TD WIDTH=240 HEIGHT=47>
<P class="Body" style="margin: 0px">void Stroke/FillBezier(SPoint *pts, layerdata *d, int8 *pat)</P>
<P class="Body" style="margin: 0px">void Stroke/FillBezier(BPoint *pts, layerdata *d, int8 *pat)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=32>
<P class="Body" style="margin: 0px">void Stroke/FillEllipse(SRect r, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void Stroke/FillEllipse(BRect r, layerdata *d, int8 *pattern)</P>
</TD>
<TD WIDTH=240 HEIGHT=32>
<P class="Body" style="margin: 0px">void Stroke/FillArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void Stroke/FillArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=47>
<P class="Body" style="margin: 0px">void StrokeLine(SPoint start, SPoint end, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void StrokeLine(BPoint start, BPoint end, layerdata *d, int8 *pattern)</P>
</TD>
<TD WIDTH=240 HEIGHT=47>
<P class="Body" style="margin: 0px">void StrokePolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</P>
<P class="Body" style="margin: 0px">void StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=47>
<P class="Body" style="margin: 0px">void FillPolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern)</P>
</TD>
<TD WIDTH=240 HEIGHT=47>
<P class="Body" style="margin: 0px">void Stroke/FillRect(SRect r, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void Stroke/FillRect(BRect r, layerdata *d, int8 *pattern)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=47>
<P class="Body" style="margin: 0px">void Stroke/FillRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void Stroke/FillRoundRect(BRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</P>
</TD>
<TD WIDTH=240 HEIGHT=47>
<P class="Body" style="margin: 0px">void Stroke/FillShape(SShape *sh, layerdata *d, int8 *pattern)</P>
@@ -96,23 +94,23 @@ Member Functions</P>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=32>
<P class="Body" style="margin: 0px">void Stroke/FillTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</P>
<P class="Body" style="margin: 0px">void Stroke/FillTriangle(BPoints *pts, BRect r, layerdata *d, int8 *pattern)</P>
</TD>
<TD WIDTH=240 HEIGHT=32>
<P class="Body" style="margin: 0px">void StrokeLineArray(SPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</P>
<P class="Body" style="margin: 0px">void StrokeLineArray(BPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=32>
<P class="Body" style="margin: 0px">void DrawPicture(SPicture *pic, BPoint pt)</P>
</TD>
<TD WIDTH=240 HEIGHT=32>
<P class="Body" style="margin: 0px">void CopyBits(BRect src, BRect dest)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">void DrawPicture(SPicture *pic, SPoint pt)</P>
</TD>
<TD WIDTH=240 HEIGHT=17>
<P class="Body" style="margin: 0px">void CopyBits(SRect src, SRect dest)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">void InvertRect(SRect r)</P>
<P class="Body" style="margin: 0px">void InvertRect(BRect r)</P>
</TD>
<TD WIDTH=240 HEIGHT=17>
<P class="Body" style="margin: 0px">uint8 GetDepth(void)</P>
@@ -138,6 +136,22 @@ Member Functions</P>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">bool DumpToFile(const char *path)</P>
</TD>
<TD WIDTH=240 HEIGHT=17>
<P class="Body" style="margin: 0px">void ShowCursor(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">void HideCursor(void)</P>
</TD>
<TD WIDTH=240 HEIGHT=17>
<P class="Body" style="margin: 0px">void ObscureCursor(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=224 HEIGHT=17>
<P class="Body" style="margin: 0px">bool IsCursorHidden(void)</P>
</TD>
<TD WIDTH=240 HEIGHT=17>
&nbsp;
</TD>
@@ -145,6 +159,44 @@ Member Functions</P>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
Protected Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=533 HEIGHT=90 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void Lock(void)</P>
</TD>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void Unlock(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetDepth(void)</P>
</TD>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetHeight(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetWidth(void)</P>
</TD>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetMode(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetCursorHidden(void)</P>
</TD>
<TD WIDTH=200 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetCursorObscured(void)</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
@@ -155,31 +207,35 @@ Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
These four are for general start and stop procedures. The constructor and destructor concern themselves with the internal members common to all drivers, such as the current cursor and the access semaphore. Subclasses will probably end up using these to handle memory allocation-related issues, but likely not much else. Initialize() and Shutdown() are for general setup internal to the module. Note that if Initialize() returns false, the server will not use the module, call Shutdown(), and then delete it as accordingly.</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">void CopyBits(SRect src, SRect dest)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void InvertRect(SRect r)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawBitmap(ServerBitmap *bmp, SRect src, SRect dest, render_mode mode)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawPicture(SPicture *pic, SPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawChar(char c, SPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawString(const char *string, int32 length, SPoint pt, escapement_delta *delta=NULL)</span></P>
<span class="OBOS-Function-Def">void CopyBits(BRect src, BRect dest)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void InvertRect(BRect r)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawBitmap(ServerBitmap *bmp, BRect src, BRect dest, render_mode mode)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawPicture(SPicture *pic, BPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawChar(char c, BPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawString(const char *string, int32 length, BPoint pt, escapement_delta *delta=NULL)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def"><BR>
void StrokeArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeBezier(SPoint *pts, layerdata *d, int8 *pat)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillBezier(SPoint *pts, layerdata *d, int8 *pat)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeEllipse(SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillEllipse(SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLine(SPoint start, SPoint end, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLineArray(SPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokePolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillPolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRect(SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRect(SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
void StrokeArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeBezier(BPoint *pts, layerdata *d, int8 *pat)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillBezier(BPoint *pts, layerdata *d, int8 *pat)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeEllipse(BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillEllipse(BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLine(BPoint start, BPoint end, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLineArray(BPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRect(BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRect(BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRoundRect(BRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRoundRect(BRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeShape(SShape *sh, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillShape(SShape *sh, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeTriangle(BPoints *pts, BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillTriangle(BPoints *pts, BRect r, layerdata *d, int8 *pattern)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void ShowCursor(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void HideCursor(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void ObscureCursor(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool IsCursorHidden(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These drawing functions are the meat and potatoes of the graphics module. Defining any or all of them is completely optional. However, the default versions of these functions will do nothing. Thus, implementing them is likely a good idea, even if not required.</P>
<P class="Body" style="margin: 0px"><BR>
@@ -195,6 +251,27 @@ These five functions are called internally in order to get information about the
<span class="OBOS-Function-Def">bool DumpToFile(const char *path)</span></P>
<P class="Body" style="margin: 0px"><BR>
DumpToFile is completely optional, providing a hook which allows screenshots to be taken. The default version does nothing but return false. If a screenshot is successful, return true.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void Lock(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void Unlock(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These two functions provide a locking scheme for the driver in order to easily make it thread safe. Note that it is not publicly callable.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void SetDepthInternal(uint8 d)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetHeightInternal(uint16 h)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetWidthInternal(uint16 w)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetModeInternal(int32 m)</span></P>
<P class="Body" style="margin: 0px"><BR>
These four functions set the internal state variables for height, width, etc. If the driver reimplements the public members SetDepth(), etc, be sure to call the respective internal call so that calls to GetDepth(), etc. return the proper values.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void SetCursorHidden(bool state)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetCursorObscured(bool state)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool IsCursorObscured(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These calls handle internal state tracking so that subclasses don't have to.</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>