ftp.nice.ch/pub/next/science/mathematics/HippoDraw.2.0.s.tar.gz#/HippoDraw/Hippo.bproj/Draw.subproj/PSGraphic.m

This is PSGraphic.m in view mode; [Download] [Up]

#import "draw.h"

@implementation PSGraphic

- replaceWithImage
{
    Image *retval = [[Image allocFromZone:[self zone]] initFromStream:newStream];
    [retval setBounds:&bounds];
    if (!gFlags.selected) [retval deselect];
    if (gFlags.locked) [retval lock];
    [self free];
    return retval;    
}

- read:(NXTypedStream *)stream
{
    char *data;
    int length;
    float bbox[4];

    [super read:stream];
    NXReadTypes(stream,"ffffi",&bbox[0],&bbox[1],&bbox[2],&bbox[3],&length);
    vm_allocate(task_self(), (vm_address_t *)&data, length, YES);
    NXReadArray(stream, "c", length, data);
    newStream = NXOpenMemory(data, length, NX_READONLY);

    return self;
}

/*
 * No write: because PSGraphic is no longer used (replaced by Image).
 * It is here only for compatibility.
 */

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.