home *** CD-ROM | disk | FTP | other *** search
- #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
-