diff --git a/Headers/AppKit/NSPICTImageRep.h b/Headers/AppKit/NSPICTImageRep.h index 7735f7706..c4b17f257 100644 --- a/Headers/AppKit/NSPICTImageRep.h +++ b/Headers/AppKit/NSPICTImageRep.h @@ -26,6 +26,7 @@ #define _NSPICTImageRep_h_GNUSTEP_GUI_INCLUDE #include +#include #if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST) @@ -33,8 +34,23 @@ extern "C" { #endif +@class NSData; + @interface NSPICTImageRep : NSImageRep +{ + NSData *_imageData; + NSData *_pictRepresentation; + NSRect _boundingBox; +} ++ (instancetype) imageRepWithData: (NSData *)imageData; + +- (instancetype) initWithData: (NSData *)imageData; + +- (NSRect) boundingBox; + +- (NSData *) PICTRepresentation; + @end #if defined(__cplusplus) diff --git a/Source/NSPICTImageRep.m b/Source/NSPICTImageRep.m index f5c3d87fb..23f7071b3 100644 --- a/Source/NSPICTImageRep.m +++ b/Source/NSPICTImageRep.m @@ -26,5 +26,30 @@ @implementation NSPICTImageRep ++ (instancetype) imageRepWithData: (NSData *)imageData +{ + return AUTORELEASE([[self alloc] initWithData: imageData]); +} + +- (instancetype) initWithData: (NSData *)imageData +{ + self = [super init]; + if (self != nil) + { + ASSIGNCOPY(_imageData, imageData); + } + return self; +} + +- (NSRect) boundingBox +{ + return _boundingBox; +} + +- (NSData *) PICTRepresentation +{ + return [_pictRepresentation copy]; +} + @end