|
|
1.1 ! root 1: #import "draw.h" ! 2: ! 3: @implementation PSGraphic ! 4: ! 5: - replaceWithImage ! 6: { ! 7: Image *retval = [[Image allocFromZone:[self zone]] initFromStream:newStream]; ! 8: [retval setBounds:&bounds]; ! 9: if (!gFlags.selected) [retval deselect]; ! 10: if (gFlags.locked) [retval lock]; ! 11: [self free]; ! 12: return retval; ! 13: } ! 14: ! 15: - read:(NXTypedStream *)stream ! 16: { ! 17: char *data; ! 18: int length; ! 19: float bbox[4]; ! 20: ! 21: [super read:stream]; ! 22: NXReadTypes(stream,"ffffi",&bbox[0],&bbox[1],&bbox[2],&bbox[3],&length); ! 23: vm_allocate(task_self(), (vm_address_t *)&data, length, YES); ! 24: NXReadArray(stream, "c", length, data); ! 25: newStream = NXOpenMemory(data, length, NX_READONLY); ! 26: ! 27: return self; ! 28: } ! 29: ! 30: /* ! 31: * No write: because PSGraphic is no longer used (replaced by Image). ! 32: * It is here only for compatibility. ! 33: */ ! 34: ! 35: @end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.