Added prototypes for hyphenation functions...in my work on the TextEdit
OpenStep demo (which runs now, BTW - can't test the document view though,
as I don't have .gmodels or a *step machine to nib2gmodel the nibs), I
discovered that

- (float)hyphenationFactor {
    return (hyphenationSupported()) ? [[self layoutManager] hyphenationFactor] : 0.0;
}

wouldn't compile, since -hyphenationFactor wasn't prototyped and returned
void according to the compiler. Changed to agree with the actual method,
got it to build. Grabbed the menu code from FAR's Edit.m and put it into
TextEdit-main.m, I now get a menu.

-- 
| Jeff Teunissen - Pres., Dusk To Dawn Computing - deek at dusknet.dhs.org
| Disclaimer: I am my employer, so anything I say goes for me too.      :)
| Core developer, The QuakeForge Project        http://www.quakeforge.net/
| Specializing in Debian GNU/Linux           http://dusknet.dhs.org/~deek/
Index: gui/Headers/gnustep/gui/NSLayoutManager.h
===================================================================
RCS file: /gnustep/gnustep/core/gui/Headers/gnustep/gui/NSLayoutManager.h,v
retrieving revision 1.5
diff -u -r1.5 NSLayoutManager.h
--- NSLayoutManager.h   1999/09/09 02:56:03     1.5
+++ NSLayoutManager.h   2000/08/10 18:36:30
@@ -155,7 +155,7 @@
     BOOL                       _showsControlChars;
     float                      _hyphenationFactor;
     BOOL                       _usesScreenFonts;
-  BOOL finished;
+    BOOL                       finished;
 }
 
 /**************************** Initialization ****************************/
@@ -398,6 +398,11 @@
 - (void)drawUnderlineForGlyphRange:(NSRange)glyphRange 
underlineType:(int)underlineVal baselineOffset:(float)baselineOffset 
lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange 
containerOrigin:(NSPoint)containerOrigin;
 - (void)underlineGlyphRange:(NSRange)glyphRange underlineType:(int)underlineVal 
lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange 
containerOrigin:(NSPoint)containerOrigin;
     // The first of these methods actually draws an appropriate underline for the 
glyph range given.  The second method potentailly breaks the range it is given up into 
subranges and calls drawUnderline... for ranges that should actually have the 
underline drawn.  As examples of why there are two methods, consider two situations.  
First, in all cases you don't want to underline the leading and trailing whitespace on 
a line.  The -underlineGlyphRange... method is passed glyph ranges that have 
underlining turned on, but it will then look for this leading and trailing white space 
and only pass the ranges that should actually be underlined to -drawUnderline...  
Second, if the underlineType: indicates that only words, (ie no whitespace), should be 
underlined, then -underlineGlyphRange... will carve the range it is passed up into 
words and only pass word ranges to -drawUnderline.
+
+/************************ Hyphenation support ************************/
+
+- (float) hyphenationFactor;
+- (void) setHyphenationFactor: (float)factor;
 
 @end
 

Reply via email to