2003-07-31 23:52:10 +00:00
|
|
|
/*
|
|
|
|
NSStringDrawing.h
|
|
|
|
|
|
|
|
Categories which add measure capabilities to NSAttributedString
|
|
|
|
and NSString.
|
|
|
|
|
|
|
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
|
|
|
Date: Aug 1998
|
|
|
|
Rewrite: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Date: Mar 1999
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-10-29 21:16:17 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-10 04:01:49 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-10-29 21:16:17 +00:00
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-10-29 21:16:17 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2007-10-29 21:16:17 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
2007-10-29 21:16:17 +00:00
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
2006-11-06 13:58:37 +00:00
|
|
|
Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSStringDrawing
|
|
|
|
#define _GNUstep_H_NSStringDrawing
|
2008-01-02 23:39:49 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2006-11-06 13:58:37 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
#include <Foundation/NSString.h>
|
|
|
|
#include <Foundation/NSAttributedString.h>
|
|
|
|
#include <Foundation/NSGeometry.h>
|
2007-06-18 21:08:54 +00:00
|
|
|
|
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
NSStringDrawingUsesLineFragmentOrigin=0x01,
|
|
|
|
NSStringDrawingUsesFontLeading=0x02,
|
|
|
|
NSStringDrawingDisableScreenFontSubstitution=0x04,
|
|
|
|
NSStringDrawingUsesDeviceMetrics=0x08,
|
|
|
|
NSStringDrawingOneShot=0x10
|
|
|
|
} NSStringDrawingOptions;
|
|
|
|
#endif
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
@interface NSString (NSStringDrawing)
|
|
|
|
|
|
|
|
- (void) drawAtPoint: (NSPoint)point withAttributes: (NSDictionary*)attrs;
|
|
|
|
- (void) drawInRect: (NSRect)rect withAttributes: (NSDictionary*)attrs;
|
|
|
|
- (NSSize) sizeWithAttributes: (NSDictionary*)attrs;
|
|
|
|
|
2007-06-18 21:08:54 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
|
|
|
- (NSRect) boundingRectWithSize: (NSSize)size
|
|
|
|
options: (NSStringDrawingOptions)options
|
|
|
|
attributes: (NSDictionary *)attributes;
|
|
|
|
- (void) drawWithRect: (NSRect)rect
|
|
|
|
options: (NSStringDrawingOptions)options
|
|
|
|
attributes: (NSDictionary *)attributes;
|
|
|
|
#endif
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSAttributedString (NSStringDrawing)
|
|
|
|
|
|
|
|
- (NSSize) size;
|
|
|
|
- (void) drawAtPoint: (NSPoint)point;
|
|
|
|
- (void) drawInRect: (NSRect)rect;
|
|
|
|
|
2007-06-18 21:08:54 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
|
|
|
- (NSRect) boundingRectWithSize: (NSSize)size
|
|
|
|
options: (NSStringDrawingOptions)options;
|
|
|
|
- (void) drawWithRect: (NSRect)rect
|
|
|
|
options: (NSStringDrawingOptions)options;
|
|
|
|
#endif
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
@class NSAttributedString;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _GNUstep_H_NSStringDrawing */
|