* Headers/AppKit/NSTextContainer.h,

* Source/NSTextContainer.m,
        * Source/GSHorizontalTypesetter.m: Correct the definition of
        NSLineMovementDirection.
        * Headers/AppKit/NSFont.h
        * Source/NSFont.m: Add a few missing 10.4 methods.
        * Header/AppKit/NSLayoutManager.h,
        * Source/NSLayoutManager.m: Add one 10.5 method.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-01-19 18:22:45 +00:00
parent ff7f9ada4a
commit 28a4847640
8 changed files with 88 additions and 15 deletions

View file

@ -1,3 +1,14 @@
2013-01-19 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSTextContainer.h,
* Source/NSTextContainer.m,
* Source/GSHorizontalTypesetter.m: Correct the definition of
NSLineMovementDirection.
* Headers/AppKit/NSFont.h
* Source/NSFont.m: Add a few missing 10.4 methods.
* Header/AppKit/NSLayoutManager.h,
* Source/NSLayoutManager.m: Add one 10.5 method.
2013-01-13 Wolfgang Lux <wolfgang.lux@gmail.com> 2013-01-13 Wolfgang Lux <wolfgang.lux@gmail.com>
* configure.ac: * configure.ac:

View file

@ -197,6 +197,10 @@ APPKIT_EXPORT const CGFloat *NSFontIdentityMatrix;
- (CGFloat) xHeight; - (CGFloat) xHeight;
- (CGFloat) widthOfString: (NSString*)string; - (CGFloat) widthOfString: (NSString*)string;
- (CGFloat) defaultLineHeightForFont; - (CGFloat) defaultLineHeightForFont;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (CGFloat) leading;
#endif
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (NSUInteger) numberOfGlyphs; - (NSUInteger) numberOfGlyphs;
@ -236,6 +240,17 @@ APPKIT_EXPORT const CGFloat *NSFontIdentityMatrix;
- (int) positionsForCompositeSequence: (NSGlyph*)glyphs - (int) positionsForCompositeSequence: (NSGlyph*)glyphs
numberOfGlyphs: (int)numGlyphs numberOfGlyphs: (int)numGlyphs
pointArray: (NSPoint*)points; pointArray: (NSPoint*)points;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (void) getAdvancements: (NSSizeArray)advancements
forGlyphs: (const NSGlyph*)glyphs
count: (NSUInteger)count;
- (void) getAdvancements: (NSSizeArray)advancements
forPackedGlyphs: (const void*)glyphs
count: (NSUInteger)count;
- (void) getBoundingRects: (NSRectArray)bounds
forGlyphs: (const NSGlyph*)glyphs
count: (NSUInteger)count;
#endif
- (NSStringEncoding) mostCompatibleStringEncoding; - (NSStringEncoding) mostCompatibleStringEncoding;

View file

@ -183,6 +183,7 @@ GNUstep extension.
- (void) invalidateLayoutForCharacterRange: (NSRange)charRange - (void) invalidateLayoutForCharacterRange: (NSRange)charRange
actualCharacterRange: (NSRangePointer)actualCharRange; actualCharacterRange: (NSRangePointer)actualCharRange;
- (void) invalidateGlyphsOnLayoutInvalidationForGlyphRange: (NSRange)glyphRange;
- (BOOL) allowsNonContiguousLayout; - (BOOL) allowsNonContiguousLayout;
- (void) setAllowsNonContiguousLayout: (BOOL)flag; - (void) setAllowsNonContiguousLayout: (BOOL)flag;

View file

@ -74,20 +74,22 @@ whenever this happens.
@class GSLayoutManager; @class GSLayoutManager;
@class NSTextView; @class NSTextView;
typedef enum { enum {
NSLineSweepLeft, NSLineSweepLeft,
NSLineSweepRight, NSLineSweepRight,
NSLineSweepDown, NSLineSweepDown,
NSLineSweepUp NSLineSweepUp
} NSLineSweepDirection; };
typedef NSUInteger NSLineSweepDirection;
typedef enum { enum {
NSLineMoveLeft, NSLineDoesntMove,
NSLineMoveRight, NSLineMovesLeft,
NSLineMoveDown, NSLineMovesRight,
NSLineMoveUp, NSLineMovesDown,
NSLineDoesntMove NSLineMovesUp
} NSLineMovementDirection; };
typedef NSUInteger NSLineMovementDirection;
@interface NSTextContainer : NSObject @interface NSTextContainer : NSObject
{ {

View file

@ -587,7 +587,7 @@ Return values 0, 1, 2 are mostly the same as from
r = [curTextContainer lineFragmentRectForProposedRect: r r = [curTextContainer lineFragmentRectForProposedRect: r
sweepDirection: NSLineSweepRight sweepDirection: NSLineSweepRight
movementDirection: NSLineMoveDown movementDirection: NSLineMovesDown
remainingRect: &remain]; remainingRect: &remain];
if (!NSIsEmptyRect(r)) if (!NSIsEmptyRect(r))
@ -669,7 +669,7 @@ restart: ;
{ {
rect = [curTextContainer lineFragmentRectForProposedRect: remain rect = [curTextContainer lineFragmentRectForProposedRect: remain
sweepDirection: NSLineSweepRight sweepDirection: NSLineSweepRight
movementDirection: line_frags_num?NSLineDoesntMove:NSLineMoveDown movementDirection: line_frags_num?NSLineDoesntMove:NSLineMovesDown
remainingRect: &remain]; remainingRect: &remain];
if (NSIsEmptyRect(rect)) if (NSIsEmptyRect(rect))
break; break;

View file

@ -1118,6 +1118,12 @@ static BOOL flip_hack;
- (CGFloat) xHeight { return [fontInfo xHeight]; } - (CGFloat) xHeight { return [fontInfo xHeight]; }
- (CGFloat) defaultLineHeightForFont { return [fontInfo defaultLineHeightForFont]; } - (CGFloat) defaultLineHeightForFont { return [fontInfo defaultLineHeightForFont]; }
- (CGFloat) leading
{
// FIXME
return 0.0;
}
/* Computing font metrics attributes*/ /* Computing font metrics attributes*/
- (CGFloat) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
@ -1241,6 +1247,39 @@ static BOOL flip_hack;
return i; return i;
} }
- (void) getAdvancements: (NSSizeArray)advancements
forGlyphs: (const NSGlyph*)glyphs
count: (NSUInteger)count
{
// FIXME
int i;
for (i = 0; i < count; i++)
{
advancements[i] = [self advancementForGlyph: glyphs[i]];
}
}
- (void) getAdvancements: (NSSizeArray)advancements
forPackedGlyphs: (const void*)glyphs
count: (NSUInteger)count
{
// FIXME
}
- (void) getBoundingRects: (NSRectArray)bounds
forGlyphs: (const NSGlyph*)glyphs
count: (NSUInteger)count
{
// FIXME
int i;
for (i = 0; i < count; i++)
{
bounds[i] = [self boundingRectForGlyph: glyphs[i]];
}
}
- (NSStringEncoding) mostCompatibleStringEncoding - (NSStringEncoding) mostCompatibleStringEncoding
{ {
return [fontInfo mostCompatibleStringEncoding]; return [fontInfo mostCompatibleStringEncoding];

View file

@ -1310,6 +1310,11 @@ has the same y origin and height as the line frag rect it is in.
actualCharacterRange: actualCharRange]; actualCharacterRange: actualCharRange];
} }
- (void) invalidateGlyphsOnLayoutInvalidationForGlyphRange: (NSRange)glyphRange
{
// FIXME
}
- (BOOL) allowsNonContiguousLayout - (BOOL) allowsNonContiguousLayout
{ {
return NO; return NO;

View file

@ -379,7 +379,7 @@ framework intact.
switch (moveDir) switch (moveDir)
{ {
case NSLineMoveLeft: case NSLineMovesLeft:
if (maxx < cminx) if (maxx < cminx)
return NSZeroRect; return NSZeroRect;
if (maxx > cmaxx) if (maxx > cmaxx)
@ -389,7 +389,7 @@ framework intact.
} }
break; break;
case NSLineMoveRight: case NSLineMovesRight:
if (minx > cmaxx) if (minx > cmaxx)
return NSZeroRect; return NSZeroRect;
if (minx < cminx) if (minx < cminx)
@ -399,7 +399,7 @@ framework intact.
} }
break; break;
case NSLineMoveDown: case NSLineMovesDown:
if (miny > cmaxy) if (miny > cmaxy)
return NSZeroRect; return NSZeroRect;
if (miny < cminy) if (miny < cminy)
@ -409,7 +409,7 @@ framework intact.
} }
break; break;
case NSLineMoveUp: case NSLineMovesUp:
if (maxy < cminy) if (maxy < cminy)
return NSZeroRect; return NSZeroRect;
if (maxy > cmaxy) if (maxy > cmaxy)