3 new classes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2177 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2002-12-07 21:42:16 +00:00
parent d5d7a2437a
commit dd2607d81b
3 changed files with 362 additions and 0 deletions

View File

@ -0,0 +1,112 @@
<HTML>
<HEAD>
<TITLE>ColorSet.htm</TITLE>
<style type="text/css">
<!--
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
.Text-Background {background-color: rgb(255,255,255)}
.GR-Default {}
.Body {margin: 0px}
.Footer {margin: 0px}
.Header {margin: 0px}
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
-->
</style>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV class="sheet" id="Sheet 1">
<P class="Body" style="margin: 0px"><span class="OBOS-Title">ColorSet class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">The ColorSet class provides an easy manner to manage system attribute colors, such as window tabs, panel background colors, etc. Each member is an RGBColor. The attributes are list below and are publicly accessible.</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">panel_background</P>
<P class="Body" style="margin: 0px">panel_text</P>
<P class="Body" style="margin: 0px">document_background</P>
<P class="Body" style="margin: 0px">document_text</P>
<P class="Body" style="margin: 0px">control_background</P>
<P class="Body" style="margin: 0px">control_text</P>
<P class="Body" style="margin: 0px">control_border</P>
<P class="Body" style="margin: 0px">control_highlight</P>
<P class="Body" style="margin: 0px">tooltip_background</P>
<P class="Body" style="margin: 0px">tooltip_text</P>
<P class="Body" style="margin: 0px">menu_background</P>
<P class="Body" style="margin: 0px">menu_selected_background</P>
<P class="Body" style="margin: 0px">menu_text</P>
<P class="Body" style="margin: 0px">menu_selected_text</P>
<P class="Body" style="margin: 0px">menu_separator_high</P>
<P class="Body" style="margin: 0px">menu_separator_low</P>
<P class="Body" style="margin: 0px">menu_triggers</P>
<P class="Body" style="margin: 0px">window_tab</P>
<P class="Body" style="margin: 0px">window_tab_text</P>
<P class="Body" style="margin: 0px">inactive_window_tab</P>
<P class="Body" style="margin: 0px">inactive_window_tab_text</P>
<P class="Body" style="margin: 0px">keyboard_navigation</P>
<P class="Body" style="margin: 0px">desktop</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><BR>
Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=463 HEIGHT=72 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">ColorSet(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">ColorSet(const ColorSet &amp;cs)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=38>
<P class="Body" style="margin: 0px">ColorSet &amp; operator=(const ColorSet &amp;cs)</P>
</TD>
<TD WIDTH=260 HEIGHT=38>
<P class="Body" style="margin: 0px">void SetColors(const ColorSet &amp;cs)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void PrintToStream(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">ColorSet(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Does nothing.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">ColorSet(const ColorSet &amp;cs)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">ColorSet &amp; operator=(const ColorSet &amp;cs)</span></P>
<P class="Body" style="margin: 0px"><BR>
Calls SetColors on the passed ColorSet object</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void SetColors(const ColorSet &amp;cs)</span></P>
<P class="Body" style="margin: 0px"><BR>
Copies all data members of the passed color set to those of the current one</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void PrintToStream(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Prints the name of each attribute color and then calls the color's PrintToStream member.</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>

View File

@ -0,0 +1,164 @@
<HTML>
<HEAD>
<TITLE>FontStyle.htm</TITLE>
<style type="text/css">
<!--
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
.Text-Background {background-color: rgb(255,255,255)}
.GR-Default {}
.Body {margin: 0px}
.Footer {margin: 0px}
.Header {margin: 0px}
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
-->
</style>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV class="sheet" id="Sheet 1">
<P class="Body" style="margin: 0px"><span class="OBOS-Title">FontStyle class : public SharedObject</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">FontStyle objects represent a font's look, such as bold, italics, etc.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px">Type Definitions</P>
<P class="Body" style="margin: 0px"><BR>
typedef struct CachedFaceRec_</P>
<P class="Body" style="margin: 0px">{</P>
<P class="Body" style="margin: 0px"> BString file_path; </P>
<P class="Body" style="margin: 0px"> uint32 face_index; </P>
<P class="Body" style="margin: 0px">} CachedFaceRec, *CachedFace;</P>
<P class="Body" style="margin: 0px"><BR>
A record used in FreeType caching.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=618 HEIGHT=198 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=213 HEIGHT=32>
<P class="Body" style="margin: 0px">FontStyle(const char *filepath, FT_Face face)</P>
</TD>
<TD WIDTH=250 HEIGHT=32>
<P class="Body" style="margin: 0px">~FontStyle(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=32>
<P class="Body" style="margin: 0px">ServerFont *Instantiate(float size, float rotation=0.0, float shear=90.0)</P>
</TD>
<TD WIDTH=250 HEIGHT=32>
<P class="Body" style="margin: 0px">bool IsFixedWidth(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">bool IsScalable(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasKerning(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasTuned(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">uint16 GlyphCount(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">uint16 CharMapCount(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *Style(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">FontFamily *Family(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">FT_Face GetFace(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *GetPath(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">int16 ConvertToUni code(uint16 c)</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">FontStyle(const char *filepath, FT_Face face)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) set name from face</P>
<P class="Body" style="margin: 0px">2) create a CachedFaceRec object and generate the handle as being the memory address converted to an integer. Assign the path from the parameter.</P>
<P class="Body" style="margin: 0px">3) set the path from the parameter</P>
<P class="Body" style="margin: 0px">4) set family to NULL</P>
<P class="Body" style="margin: 0px">5) create the instance list</P>
<P class="Body" style="margin: 0px">6) check to see if face object has ready-made strikes and set IsTuned flags as appropriate</P>
<P class="Body" style="margin: 0px">7) set fixed-width, kerning, and scalable flags as appropriate, based on face data</P>
<P class="Body" style="margin: 0px">8) get and assign glyph and charmap count</P>
<P class="Body" style="margin: 0px">9) set bounds to an invalid rectangle</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~FontStyle(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) delete all pointer objects</P>
<P class="Body" style="margin: 0px">2) empty instance list, delete all attached instances, and delete the list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">ServerFont *Instantiate(float size, float rotation=0.0, float shear=90.0)</span></P>
<P class="Body" style="margin: 0px"><BR>
Retrieves a specific instance of the font style, based on the size, rotation, and shear values</P>
<P class="Body" style="margin: 0px"><BR>
1) create a new ServerFont object</P>
<P class="Body" style="margin: 0px">2) add the new object to the instance list and return it</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool IsFixedWidth(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool IsScalable(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool HasKerning(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool HasTuned(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 GlyphCount(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 CharMapCount(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">const char *GetPath(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">FT_Face GetFace(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These merely return the appropriate flags/values which are assigned values in the constructor.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">const char *Style(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the string value for the particular style.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">FontFamily *Family(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the pointer to the FontStyle object's family. Do NOT delete this pointer.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">int16 ConvertToUnicode(uint16 c)</span></P>
<P class="Body" style="margin: 0px"><BR>
Converts a character code to a UTF-8 string</P>
<P class="Body" style="margin: 0px"><BR>
1) Look up the face from the cache manager</P>
<P class="Body" style="margin: 0px">2) Call FT_Get_Char_Index for the particular character code and return the value</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>

View File

@ -0,0 +1,86 @@
<HTML>
<HEAD>
<TITLE>SharedObject.htm</TITLE>
<style type="text/css">
<!--
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
.Text-Background {background-color: rgb(255,255,255)}
.GR-Default {}
.Body {margin: 0px}
.Footer {margin: 0px}
.Header {margin: 0px}
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
-->
</style>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV class="sheet" id="Sheet 1">
<P class="Body" style="margin: 0px"><span class="OBOS-Title">SharedObjectf class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
The FontStyle class represents the particular style in a font family, such as Bold, Roman, etc. and provides information on an individual font, such as whether it has a fixed width, whether it is scalable etc. It also houses all instances of the individual style.</P>
<P class="Body" style="margin: 0px"><BR>
<HR>
</P>
<P class="Body" style="margin: 0px">Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=617 HEIGHT=68 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">SharedObject(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">virtual SharedObject(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">virtual void AddDependent(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">virtual void RemoveDependent(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">virtual bool HasDependents(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">SharedObject(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Sets dependent count to 0</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">virtual ~SharedObject(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Does nothing</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">virtual void AddDependent(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Increments dependent count</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">virtual void RemoveDependent(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Decrements dependent count if greater than 0</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">virtual bool HasDependents(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) if dependent count &gt; 0, return true. Otherwise, return false.</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>