mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:10:47 +00:00
Dummy implementation for new methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
65742524f5
commit
fd184f1c92
1 changed files with 104 additions and 48 deletions
|
@ -108,11 +108,6 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- _initFromWrasterFile: (NSString *)filename number: (int)imageNumber
|
|
||||||
{
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (id) imageRepWithData: (NSData *)tiffData
|
+ (id) imageRepWithData: (NSData *)tiffData
|
||||||
{
|
{
|
||||||
NSArray* array;
|
NSArray* array;
|
||||||
|
@ -151,43 +146,6 @@
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A special method used mostly when we have the wraster library in the
|
|
||||||
backend, which can read several more image formats */
|
|
||||||
+ (NSArray*) imageRepsWithFile: (NSString *)filename
|
|
||||||
{
|
|
||||||
NSString *ext;
|
|
||||||
int images;
|
|
||||||
NSMutableArray *array;
|
|
||||||
NSBitmapImageRep* imageRep;
|
|
||||||
|
|
||||||
/* Don't use this for TIFF images, use the regular ...Data methods */
|
|
||||||
ext = [filename pathExtension];
|
|
||||||
if (!ext)
|
|
||||||
{
|
|
||||||
NSLog(@"Extension missing from filename - '%@'", filename);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
if ([[self imageUnfilteredFileTypes] indexOfObject: ext] != NSNotFound)
|
|
||||||
{
|
|
||||||
NSData* data = [NSData dataWithContentsOfFile: filename];
|
|
||||||
return [self imageRepsWithData: data];
|
|
||||||
}
|
|
||||||
|
|
||||||
array = [NSMutableArray arrayWithCapacity: 2];
|
|
||||||
images = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
imageRep = [[[self class] alloc] _initFromWrasterFile: filename
|
|
||||||
number: images];
|
|
||||||
if (imageRep)
|
|
||||||
[array addObject: AUTORELEASE(imageRep)];
|
|
||||||
images++;
|
|
||||||
}
|
|
||||||
while (imageRep);
|
|
||||||
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Loads only the default (first) image from the TIFF image contained in
|
/* Loads only the default (first) image from the TIFF image contained in
|
||||||
data. */
|
data. */
|
||||||
- (id) initWithData: (NSData *)tiffData
|
- (id) initWithData: (NSData *)tiffData
|
||||||
|
@ -209,6 +167,7 @@
|
||||||
|
|
||||||
- (id) initWithFocusedViewRect: (NSRect)rect
|
- (id) initWithFocusedViewRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
return [self notImplemented: _cmd];
|
return [self notImplemented: _cmd];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +246,28 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)colorizeByMappingGray:(float)midPoint
|
||||||
|
toColor:(NSColor *)midPointColor
|
||||||
|
blackMapping:(NSColor *)shadowColor
|
||||||
|
whiteMapping:(NSColor *)lightColor
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithBitmapHandle:(void *)bitmap
|
||||||
|
{
|
||||||
|
// TODO Only needed on MS Windows
|
||||||
|
RELEASE(self);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithIconHandle:(void *)icon
|
||||||
|
{
|
||||||
|
// TODO Only needed on MS Windows
|
||||||
|
RELEASE(self);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
OBJC_FREE(_imagePlanes);
|
OBJC_FREE(_imagePlanes);
|
||||||
|
@ -301,7 +282,7 @@
|
||||||
copy = (NSBitmapImageRep*)[super copyWithZone: zone];
|
copy = (NSBitmapImageRep*)[super copyWithZone: zone];
|
||||||
|
|
||||||
copy->_imagePlanes = 0;
|
copy->_imagePlanes = 0;
|
||||||
copy->_imageData = [_imageData copy];
|
copy->_imageData = [_imageData copyWithZone: zone];
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
@ -320,11 +301,6 @@
|
||||||
return [[pasteboard types] containsObject: NSTIFFPboardType];
|
return [[pasteboard types] containsObject: NSTIFFPboardType];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSArray *) _wrasterFileTypes
|
|
||||||
{
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSArray *) imageFileTypes
|
+ (NSArray *) imageFileTypes
|
||||||
{
|
{
|
||||||
NSArray *wtypes = [self _wrasterFileTypes];
|
NSArray *wtypes = [self _wrasterFileTypes];
|
||||||
|
@ -455,6 +431,7 @@
|
||||||
//
|
//
|
||||||
+ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray *)anArray
|
+ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray *)anArray
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
[self notImplemented: _cmd];
|
[self notImplemented: _cmd];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -463,6 +440,7 @@
|
||||||
usingCompression: (NSTIFFCompression)type
|
usingCompression: (NSTIFFCompression)type
|
||||||
factor: (float)factor
|
factor: (float)factor
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
[self notImplemented: _cmd];
|
[self notImplemented: _cmd];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -520,6 +498,21 @@
|
||||||
return [NSData dataWithBytesNoCopy: bytes length: length];
|
return [NSData dataWithBytesNoCopy: bytes length: length];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps
|
||||||
|
usingType:(NSBitmapImageFileType)storageType
|
||||||
|
properties:(NSDictionary *)properties
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSData *)representationUsingType:(NSBitmapImageFileType)storageType
|
||||||
|
properties:(NSDictionary *)properties
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setting and Checking Compression Types
|
// Setting and Checking Compression Types
|
||||||
//
|
//
|
||||||
|
@ -593,6 +586,17 @@
|
||||||
_comp_factor = factor;
|
_comp_factor = factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setProperty:(NSString *)property withValue:(id)value
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)valueForProperty:(NSString *)property
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// NSCoding protocol
|
// NSCoding protocol
|
||||||
//
|
//
|
||||||
|
@ -614,3 +618,55 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation NSBitmapImageRep (GNUstepExtension)
|
||||||
|
|
||||||
|
/* A special method used mostly when we have the wraster library in the
|
||||||
|
backend, which can read several more image formats */
|
||||||
|
+ (NSArray*) imageRepsWithFile: (NSString *)filename
|
||||||
|
{
|
||||||
|
NSString *ext;
|
||||||
|
int images;
|
||||||
|
NSMutableArray *array;
|
||||||
|
NSBitmapImageRep* imageRep;
|
||||||
|
|
||||||
|
/* Don't use this for TIFF images, use the regular ...Data methods */
|
||||||
|
ext = [filename pathExtension];
|
||||||
|
if (!ext)
|
||||||
|
{
|
||||||
|
NSLog(@"Extension missing from filename - '%@'", filename);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
if ([[self imageUnfilteredFileTypes] indexOfObject: ext] != NSNotFound)
|
||||||
|
{
|
||||||
|
NSData* data = [NSData dataWithContentsOfFile: filename];
|
||||||
|
return [self imageRepsWithData: data];
|
||||||
|
}
|
||||||
|
|
||||||
|
array = [NSMutableArray arrayWithCapacity: 2];
|
||||||
|
images = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
imageRep = [[[self class] alloc] _initFromWrasterFile: filename
|
||||||
|
number: images];
|
||||||
|
if (imageRep)
|
||||||
|
[array addObject: AUTORELEASE(imageRep)];
|
||||||
|
images++;
|
||||||
|
}
|
||||||
|
while (imageRep);
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This are just placeholders for the implementation in the backend
|
||||||
|
- _initFromWrasterFile: (NSString *)filename number: (int)imageNumber
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSArray *) _wrasterFileTypes
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue