Many, many API updates

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2176 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2002-12-07 21:39:48 +00:00
parent 9e159bcf9a
commit d5d7a2437a
11 changed files with 580 additions and 161 deletions
+62 -22
View File
@@ -19,81 +19,121 @@
<DIV class="sheet" id="Sheet 1">
<P class="Body" style="margin: 0px"><span class="OBOS-Title">FontFamily class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
FontFamily objects are used to house all related font styles allocated as FontStyle objects.</P>
FontFamily objects are used to tie together all related font styles.</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>
<TABLE WIDTH=463 HEIGHT=90 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">FontFamily(font_family name)</P>
<P class="Body" style="margin: 0px">FontFamily(const char *name)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">~FontFamily(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">font_family GetName(void)</P>
<TD WIDTH=203 HEIGHT=22>
<P class="Body" style="margin: 0px">const char *GetName(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">void AddStyle(FontStyle *style)</P>
<TD WIDTH=260 HEIGHT=22>
<P class="Body" style="margin: 0px">void AddStyle(const char *path, FT_Face face)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void RemoveStyle(FontStyle *style)</P>
<P class="Body" style="margin: 0px">void RemoveStyle(const char *style)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">FontStyle *FindStyle(font_style name)</P>
<P class="Body" style="margin: 0px">FontStyle *GetStyle(const char *stylename)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *GetStyle(int32 index)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">int32 CountStyles(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasStyle(const char *style)</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"><span class="OBOS-Function-Def">FontFamily(font_family name)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">FontFamily(const char *name)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Set internal name to the one passed to the constructor</P>
1) Create and set internal name to the one passed to the constructor</P>
<P class="Body" style="margin: 0px">2) Create the styles list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~FontFamily(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Does nothing</P>
1) delete the internal name</P>
<P class="Body" style="margin: 0px">2) empty and delete the internal style list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">font_family GetName(void)</span></P>
<span class="OBOS-Function-Def">const char *GetName(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the internal family name</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void AddStyle(FontStyle *style)</span></P>
<span class="OBOS-Function-Def">void AddStyle(const char *path, FT_Face face)</span></P>
<P class="Body" style="margin: 0px"><BR>
Adds the style to the family. Note that the FontFamily object is not responsible for freeing FontStyle objects added in this way.</P>
Adds the style to the family.</P>
<P class="Body" style="margin: 0px"><BR>
1) Add the style object to the internal STL map object for styles</P>
1) Create the FontStyle object and add it to the style list.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void RemoveStyle(FontStyle *style)</span></P>
<span class="OBOS-Function-Def">void RemoveStyle(const char *style)</span></P>
<P class="Body" style="margin: 0px"><BR>
Removes the style from the FontFamily object.</P>
<P class="Body" style="margin: 0px"><BR>
1) Find the style in the style list. Return if not found.</P>
<P class="Body" style="margin: 0px">2) Delete the style list's item</P>
1) Call GetStyle on the given pointer</P>
<P class="Body" style="margin: 0px">2) If non-NULL, delete the object</P>
<P class="Body" style="margin: 0px">3) If the style list is now empty, ask the FontServer to remove it from the family list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">FontStyle *FindStyle(font_style name)</span></P>
<span class="OBOS-Function-Def">FontStyle *GetStyle(const char *style)</span></P>
<P class="Body" style="margin: 0px"><BR>
Looks up a FontStyle object based on its style name. Returns NULL if not found.</P>
<P class="Body" style="margin: 0px"><BR>
1) Call the style list's find() method.</P>
<P class="Body" style="margin: 0px">2) Return the appropriate FontStyle object or NULL if not found.</P>
1) Iterate through the style list</P>
<P class="Body" style="margin: 0px"> a) compare <span style="font-style: italic">style</span> to each FontStyle object's GetName method and return the object if they are the same</P>
<P class="Body" style="margin: 0px">2) If all items have been checked and nothing has been returned, return NULL</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">const char *GetStyle(int32 index)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the name of the style at <span style="font-style: italic">index</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Get the FontStyle item at <span style="font-style: italic">index</span> obtained via the style list's ItemAt call</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">int32 CountStyles(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the number of items in the style list and, thus, the number of styles in the family</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool HasStyle(const char *stylename)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns true if the family has a style with the name <span style="font-style: italic">stylename</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Call GetStyle on the style name and return false if NULL, true if not.</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>