diff --git a/CIGLScene Test App/CIGLScene Test App-Info.plist b/CIGLScene Test App/CIGLScene Test App-Info.plist index e12f7057..ba0e84af 100644 --- a/CIGLScene Test App/CIGLScene Test App-Info.plist +++ b/CIGLScene Test App/CIGLScene Test App-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/CrashReporterTestApp/CrashReporterTestApp-Info.plist b/CrashReporterTestApp/CrashReporterTestApp-Info.plist index 2da151bb..a5b3f9ab 100644 --- a/CrashReporterTestApp/CrashReporterTestApp-Info.plist +++ b/CrashReporterTestApp/CrashReporterTestApp-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/GLScene Test App/GLScene Test App-Info.plist b/GLScene Test App/GLScene Test App-Info.plist index e12f7057..ba0e84af 100644 --- a/GLScene Test App/GLScene Test App-Info.plist +++ b/GLScene Test App/GLScene Test App-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/ISF Editor/AVCaptureVideoSource.h b/ISF Editor/AVCaptureVideoSource.h new file mode 100644 index 00000000..05183308 --- /dev/null +++ b/ISF Editor/AVCaptureVideoSource.h @@ -0,0 +1,22 @@ +#import +#import "VideoSource.h" +#import + + + + +@interface AVCaptureVideoSource : VideoSource { + AVCaptureDeviceInput *propDeviceInput; + AVCaptureSession *propSession; + AVCaptureVideoDataOutput *propOutput; + dispatch_queue_t propQueue; + CVOpenGLTextureCacheRef propTextureCache; + VVBuffer *propLastBuffer; + + //OSSpinLock lastBufferLock; + //VVBuffer *lastBuffer; +} + +- (void) loadDeviceWithUniqueID:(NSString *)n; + +@end diff --git a/ISF Editor/AVCaptureVideoSource.m b/ISF Editor/AVCaptureVideoSource.m new file mode 100644 index 00000000..f9d025a7 --- /dev/null +++ b/ISF Editor/AVCaptureVideoSource.m @@ -0,0 +1,199 @@ +#import "AVCaptureVideoSource.h" + + + + +@implementation AVCaptureVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + //NSLog(@"%s",__func__); + if (self = [super init]) { + propDeviceInput = nil; + propSession = nil; + propOutput = nil; + propQueue = NULL; + CVReturn err = kCVReturnSuccess; + //NSLog(@"\t\tshared context used for tex cache is %@",[_globalVVBufferPool sharedContext]); + err = CVOpenGLTextureCacheCreate(NULL,NULL,[[_globalVVBufferPool sharedContext] CGLContextObj],[[GLScene defaultPixelFormat] CGLPixelFormatObj],NULL,&propTextureCache); + if (err != kCVReturnSuccess) { + NSLog(@"\t\terr %d at CVOpenGLTextureCacheCreate, %s",err,__func__); + } + propLastBuffer = nil; + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [super prepareToBeDeleted]; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + if (!deleted) + [self prepareToBeDeleted]; + + OSSpinLockLock(&propLock); + CVOpenGLTextureCacheRelease(propTextureCache); + VVRELEASE(propLastBuffer); + OSSpinLockUnlock(&propLock); + + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (NSArray *) arrayOfSourceMenuItems { + NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; + if (devices==nil || [devices count]<1) + return nil; + NSMutableArray *returnMe = MUTARRAY; + for (AVCaptureDevice *devicePtr in devices) { + NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:[devicePtr localizedName] action:nil keyEquivalent:@""]; + NSString *uniqueID = [devicePtr uniqueID]; + [newItem setRepresentedObject:uniqueID]; + [returnMe addObject:newItem]; + [newItem release]; + } + return returnMe; +} +- (void) _stop { + //NSLog(@"%s",__func__); + if (propSession != nil) { + [propSession stopRunning]; + if (propDeviceInput != nil) + [propSession removeInput:propDeviceInput]; + if (propOutput != nil) + [propSession removeOutput:propOutput]; + + dispatch_release(propQueue); + propQueue = NULL; + + [propDeviceInput release]; + propDeviceInput = nil; + [propOutput release]; + propOutput = nil; + [propSession release]; + propSession = nil; + } + VVRELEASE(propLastBuffer); +} +- (VVBuffer *) allocBuffer { + VVBuffer *returnMe = nil; + OSSpinLockLock(&propLock); + returnMe = (propLastBuffer==nil) ? nil : [propLastBuffer retain]; + OSSpinLockUnlock(&propLock); + return returnMe; +} + + +/*===================================================================================*/ +#pragma mark --------------------- misc +/*------------------------------------*/ + + +- (void) loadDeviceWithUniqueID:(NSString *)n { + if ([self propRunning]) + [self stop]; + if (n==nil) + return; + BOOL bail = NO; + NSError *err = nil; + OSSpinLockLock(&propLock); + AVCaptureDevice *propDevice = [AVCaptureDevice deviceWithUniqueID:n]; + propDeviceInput = (propDevice==nil) ? nil : [[AVCaptureDeviceInput alloc] initWithDevice:propDevice error:&err]; + if (propDeviceInput != nil) { + propSession = [[AVCaptureSession alloc] init]; + propOutput = [[AVCaptureVideoDataOutput alloc] init]; + + if (![propSession canAddInput:propDeviceInput]) { + NSLog(@"\t\terr: problem adding propDeviceInput in %s",__func__); + bail = YES; + } + if (![propSession canAddOutput:propOutput]) { + NSLog(@"\t\terr: problem adding propOutput in %s",__func__); + bail = YES; + } + + if (!bail) { + propQueue = dispatch_queue_create([[[NSBundle mainBundle] bundleIdentifier] UTF8String], NULL); + [propOutput setSampleBufferDelegate:self queue:propQueue]; + + [propSession addInput:propDeviceInput]; + [propSession addOutput:propOutput]; + [propSession startRunning]; + } + } + else + bail = YES; + OSSpinLockUnlock(&propLock); + + if (bail) + [self stop]; + else + [self start]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- AVCaptureVideoDataOutputSampleBufferDelegate protocol (and AVCaptureFileOutputDelegate, too- some protocols share these methods) +/*------------------------------------*/ + + +- (void)captureOutput:(AVCaptureOutput *)o didDropSampleBuffer:(CMSampleBufferRef)b fromConnection:(AVCaptureConnection *)c { + NSLog(@"%s",__func__); +} +- (void)captureOutput:(AVCaptureOutput *)o didOutputSampleBuffer:(CMSampleBufferRef)b fromConnection:(AVCaptureConnection *)c { + //NSLog(@"%s",__func__); + /* + CMFormatDescriptionRef portFormatDesc = CMSampleBufferGetFormatDescription(b); + NSLog(@"\t\t\tCMMediaType is %ld, video is %ld",CMFormatDescriptionGetMediaType(portFormatDesc),kCMMediaType_Video); + NSLog(@"\t\t\tthe FourCharCode for the media subtype is %ld",CMFormatDescriptionGetMediaSubType(portFormatDesc)); + CMVideoDimensions vidDims = CMVideoFormatDescriptionGetDimensions(portFormatDesc); + NSLog(@"\t\t\tport size is %d x %d",vidDims.width,vidDims.height); + */ + + OSSpinLockLock(&propLock); + // if this came from a connection belonging to the data output + VVBuffer *newBuffer = nil; + //CMBlockBufferRef blockBufferRef = CMSampleBufferGetDataBuffer(b) + CVImageBufferRef imgBufferRef = CMSampleBufferGetImageBuffer(b); + if (imgBufferRef != NULL) { + //CGSize imgBufferSize = CVImageBufferGetDisplaySize(imgBufferRef); + //NSSizeLog(@"\t\timg buffer size is",imgBufferSize); + CVOpenGLTextureRef cvTexRef = NULL; + CVReturn err = kCVReturnSuccess; + + + err = CVOpenGLTextureCacheCreateTextureFromImage(NULL,propTextureCache,imgBufferRef,NULL,&cvTexRef); + if (err != kCVReturnSuccess) { + NSLog(@"\t\terr %d at CVOpenGLTextureCacheCreateTextureFromImage() in %s",err,__func__); + } + else { + newBuffer = [_globalVVBufferPool allocBufferForCVGLTex:cvTexRef]; + if (newBuffer != nil) { + VVRELEASE(propLastBuffer); + propLastBuffer = [newBuffer retain]; + + [newBuffer release]; + newBuffer = nil; + } + CVOpenGLTextureRelease(cvTexRef); + } + } + CVOpenGLTextureCacheFlush(propTextureCache,0); + OSSpinLockUnlock(&propLock); + +} + + +@end diff --git a/ISF Editor/AlphaOverCheckerboard.fs b/ISF Editor/AlphaOverCheckerboard.fs new file mode 100644 index 00000000..b9fa5f25 --- /dev/null +++ b/ISF Editor/AlphaOverCheckerboard.fs @@ -0,0 +1,90 @@ +/*{ + "DESCRIPTION": "draws the passed image over a checkerboard such that the alpha channel in the image is visible. the passed image is automatically scaled to always fit within the GL context.", + "CREDIT": "by zoidberg WOOP WOOP WOOP WOOP WOOP", + "CATEGORIES": [ + ], + "INPUTS": [ + { + "NAME": "inputImage", + "TYPE": "image" + }, + { + "NAME": "viewAlpha", + "TYPE": "bool", + "DEFAULT": true + } + ] + +}*/ + +// rect that fits 'a' in 'b' using sizing mode 'fit' +vec4 RectThatFitsRectInRect(vec4 a, vec4 b) { + float bAspect = b.z/b.w; + float aAspect = a.z/a.w; + if (aAspect==bAspect) { + return b; + } + vec4 returnMe = vec4(0.0); + // fit + + // if the rect i'm trying to fit stuff *into* is wider than the rect i'm resizing + if (bAspect > aAspect) { + returnMe.w = b.w; + returnMe.z = returnMe.w * aAspect; + } + // else if the rect i'm resizing is wider than the rect it's going into + else if (bAspect < aAspect) { + returnMe.z = b.z; + returnMe.w = returnMe.z / aAspect; + } + else { + returnMe.z = b.z; + returnMe.w = b.w; + } + returnMe.x = (b.z-returnMe.z)/2.0+b.x; + returnMe.y = (b.w-returnMe.w)/2.0+b.y; + return returnMe; +} + +#define checkerboardWidth 25.0 + +void main() { + // first calculate the "bottom" pixel color (a checkerboard) + vec4 bottomPixel = vec4(1,0,0,1); + + float sizeOfTwoCheckers = floor(checkerboardWidth)*2.0; + vec2 normPosInTwoByTwoGrid = mod(gl_FragCoord.xy, sizeOfTwoCheckers)/vec2(sizeOfTwoCheckers); + bool drawWhite = false; + if (normPosInTwoByTwoGrid.x>0.5) + drawWhite = !drawWhite; + if (normPosInTwoByTwoGrid.y>0.5) + drawWhite = !drawWhite; + bottomPixel = (drawWhite==true) ? vec4(0.80, 0.80, 0.80, 1) : vec4(0.70, 0.70, 0.70, 1); + + + // get the rect of the mask image after it's been resized according to the passed sizing mode. this is in pixel coords relative to the rendering space! + vec4 rectOfResizedInputImage = RectThatFitsRectInRect(vec4(0.0, 0.0, _inputImage_imgSize.x, _inputImage_imgSize.y), vec4(0,0,RENDERSIZE.x,RENDERSIZE.y)); + // i know the pixel coords of this frag in the render space- convert this to NORMALIZED texture coords for the resized mask image + vec2 normMaskSrcCoord; + normMaskSrcCoord.x = (gl_FragCoord.x-rectOfResizedInputImage.x)/rectOfResizedInputImage.z; + normMaskSrcCoord.y = (gl_FragCoord.y-rectOfResizedInputImage.y)/rectOfResizedInputImage.w; + // get the color of the pixel from the input image for these normalized coords (the color is transparent black if there should be no image here as a result of the rect resize) + vec4 inputImagePixel = (normMaskSrcCoord.x>=0.0 && normMaskSrcCoord.x<=1.0 && normMaskSrcCoord.y>=0.0 && normMaskSrcCoord.y<=1.0) ? IMG_NORM_PIXEL(inputImage, normMaskSrcCoord) : vec4(0,0,0,0); + + // now we do the "source atop" composition that will show the checkerboard backing + + // if the top pixel is transparent, something may be visible "through" it + float TTO = (viewAlpha==true) ? inputImagePixel.a : 1.0; + // the less opaque the top, the more the bottom should "show through"- unless the bottom is transparent! + float TBO = bottomPixel.a; + + // ...so use TBO to calculate the "real bottom color"... + vec4 realBottomColor = mix(bottomPixel,inputImagePixel,(1.0-TBO)); + // ...then use TTO to calculate how much this shows through the top color... + vec4 realTop = mix(realBottomColor, inputImagePixel, TTO); + + vec4 outColor = realTop; + outColor.a = (TTO) + (bottomPixel.a * (1.0-TTO)); + gl_FragColor = outColor; + +} diff --git a/ISF Editor/Assets.xcassets/AppIcon.appiconset/Contents.json b/ISF Editor/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..2db2b1c7 --- /dev/null +++ b/ISF Editor/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ISF Editor/AudioController.h b/ISF Editor/AudioController.h new file mode 100644 index 00000000..da4c75ae --- /dev/null +++ b/ISF Editor/AudioController.h @@ -0,0 +1,46 @@ +#import +#import +#import +#import "ISFAVFAudioSource.h" +#import "ISFAudioFFT.h" + + + +extern id _globalAudioController; +extern NSString *kAudioControllerInputNameChangedNotification; + + + + +@interface AudioController : NSObject { + BOOL deleted; + OSSpinLock audioLock; + ISFAVFAudioSource *audioSource; + MutLockArray *audioBufferArray; + ISFAudioBufferList *rawABL; + ISFAudioFFT *audioFFT; + NSArray *fftResults; + + OSSpinLock bufferLock; + VVBuffer *audioBuffer; + VVBuffer *fftBuffer; +} + +- (void) prepareToBeDeleted; + +- (void) updateAudioResults; + +- (NSArray *) arrayOfAudioMenuItems; +- (void) loadDeviceWithUniqueID:(NSString *)n; + +- (NSString *) inputName; + +- (void) audioInputsChangedNotification:(NSNotification *)note; + +- (VVBuffer *) allocAudioImageBuffer; +- (VVBuffer *) allocAudioImageBufferWithWidth:(long)w; +- (VVBuffer *) allocAudioFFTImageBuffer; +- (VVBuffer *) allocAudioFFTImageBufferWithWidth:(long)w; + + +@end diff --git a/ISF Editor/AudioController.m b/ISF Editor/AudioController.m new file mode 100644 index 00000000..8faf9e1f --- /dev/null +++ b/ISF Editor/AudioController.m @@ -0,0 +1,438 @@ +#import "AudioController.h" +//#import + + + + +#define LOCK OSSpinLockLock +#define UNLOCK OSSpinLockUnlock + + + + +id _globalAudioController = nil; +NSString *kAudioControllerInputNameChangedNotification = @"kAudioControllerInputNameChangedNotification"; +// set this to 256, 512, 1024, 2048, 4096 +int fftQuality = 512; + + + + +@implementation AudioController + + +- (id) init { + self = [super init]; + if (self != nil) { + _globalAudioController = self; + + deleted = NO; + audioLock = OS_SPINLOCK_INIT; + audioBufferArray = [[MutLockArray arrayWithCapacity:0] retain]; + // create the FFT object + audioSource = [[ISFAVFAudioSource alloc] init]; + [audioSource setPropDelegate:self]; + audioFFT = [[ISFAudioFFT alloc] init]; + + AVCaptureDevice *defaultDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; + if (defaultDevice != nil) { + [audioSource loadDeviceWithUniqueID:[defaultDevice uniqueID]]; + } + + /* + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(captureDevicesDidChangeNotification:) + name:AVCaptureDeviceWasConnectedNotification + object:nil]; + */ + // fake an audio input change notification + [self audioInputsChangedNotification:nil]; + } + return self; +} +- (void) prepareToBeDeleted { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + LOCK(&audioLock); + [audioSource prepareToBeDeleted]; + VVRELEASE(audioSource); + VVRELEASE(audioFFT); + UNLOCK(&audioLock); + + VVRELEASE(audioBufferArray); + + LOCK(&bufferLock); + + UNLOCK(&bufferLock); + + deleted = YES; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + + [super dealloc]; +} +- (NSArray *) arrayOfAudioMenuItems { + if (deleted) + return nil; + return [audioSource arrayOfSourceMenuItems]; +} +- (void) loadDeviceWithUniqueID:(NSString *)n { + if (deleted) + return; + LOCK(&bufferLock); + [audioSource loadDeviceWithUniqueID:n]; + UNLOCK(&bufferLock); + + // if the input name changed, post a notification + [[NSNotificationCenter defaultCenter] + postNotificationName:kAudioControllerInputNameChangedNotification + object:self]; +} +- (NSString *) inputName { + NSString *returnMe = nil; + LOCK(&audioLock); + returnMe = [audioSource inputName]; + UNLOCK(&audioLock); + return returnMe; +} + + +- (void) audioInputsChangedNotification:(NSNotification *)note { + LOCK(&audioLock); + + UNLOCK(&audioLock); +} + +- (void) audioSource:(id)as receivedAudioBufferList:(id)b { + //NSLog(@"%s",__func__); + if (b == nil) + return; + // note that this code is written to work with non-interleaved buffers + // with minor changes it could work either way + if ([b interleaved]) { + //NSLog(@"err: AudioController expected non-interleaved buffers"); + return; + } + //NSLog(@"%s - %d",__func__,[b numberOfFrames]); + // add the buffer to the queue, + // remove any buffers at the start of the start of the queue that aren't needed + int samplesInQueue = 0; + NSMutableArray *toDeleteArray = [NSMutableArray arrayWithCapacity:0]; + [audioBufferArray wrlock]; + [audioBufferArray addObject:b]; + + for (ISFAudioBufferList *abl in [audioBufferArray reverseObjectEnumerator]) { + if (samplesInQueue > fftQuality * 2 * 2) { + [toDeleteArray addObject:abl]; + } + samplesInQueue = samplesInQueue + [abl numberOfFrames]; + } + + [audioBufferArray removeObjectsInArray:toDeleteArray]; + [audioBufferArray unlock]; + //NSLog(@"\t\tbuffers in queue: %d for %d at quality %d",[audioBufferArray lockCount],samplesInQueue,fftQuality); +} + +- (void) updateAudioResults { + //NSLog(@"%s",__func__); + if (deleted) + return; + NSArray *audioBuffers = nil; + int samplesInQueue = 0; + NSMutableArray *toDeleteArray = [NSMutableArray arrayWithCapacity:0]; + + [audioBufferArray wrlock]; + // make sure there are enough samples in the queue to service this + for (ISFAudioBufferList *abl in [audioBufferArray objectEnumerator]) { + samplesInQueue += [abl numberOfFrames]; + if (samplesInQueue > fftQuality * 2) { + break; + } + [toDeleteArray addObject:abl]; + } + if (samplesInQueue >= fftQuality * 2) { + audioBuffers = toDeleteArray; + [audioBufferArray removeObjectsInArray:toDeleteArray]; + } + [audioBufferArray unlock]; + + if (audioBuffers == nil) { + //NSLog(@"\t\tnot enough samples in queue %d",samplesInQueue); + return; + } + ISFAudioBufferList *newBuffer = [ISFAudioBufferList createBufferListFromArray:audioBuffers]; + if (newBuffer == nil) { + NSLog(@"err: new audio buffer was nil"); + return; + } + if ([newBuffer interleaved]) { + NSLog(@"err: updateAudioResults expected non-interleaved buffers"); + return; + } + + // do the FFT + LOCK(&audioLock); + NSArray *channelResults = [audioFFT processAudioBufferWithFFT:newBuffer]; + UNLOCK(&audioLock); + + // update the buffers + LOCK(&bufferLock); + VVRELEASE(rawABL); + rawABL = [newBuffer retain]; + UNLOCK(&bufferLock); + + + LOCK(&bufferLock); + NSSize tmpSize = [audioBuffer size]; + //NSSize newBufferSize = NSMakeSize([abl numberOfSamplesPerChannel], [abl numberOfChannels]); + // always twice the size of the fft buffer, discarding any extra samples we read to avoid latency + NSSize newBufferSize = NSMakeSize(fftQuality * 2,[newBuffer numberOfChannels]); + AudioBufferList *actualABL = [newBuffer audioBufferList]; + + if (!NSEqualSizes(tmpSize, newBufferSize)) + VVRELEASE(audioBuffer); + if (audioBuffer == nil) { + //audioBuffer = [_globalVVBufferPool allocRedFloatCPUBackedTexRangeSized:newBufferSize]; + audioBuffer = [_globalVVBufferPool allocBGRAFloatCPUBackedTexRangeSized:newBufferSize]; + } + + if ((audioBuffer != nil) && (actualABL != NULL)) { + //NSLog(@"\t\traw: %d of %d samples",fftQuality * 2, [abl numberOfSamplesPerChannel]); + float *wPtr = nil; + float *audioData = nil; + + for (int i=0; imBuffers[i].mData; + //wPtr = (float *)[audioBuffer cpuBackingPtr] + ((int)sizeof(float)*(int)newBufferSize.width); + wPtr = (float *)[audioBuffer cpuBackingPtr] + i * ((int)sizeof(float)*(int)newBufferSize.width); + // instead of just copying this data, lets be super cool and use vDSP to add 0.5 to everything so it is centered around 0.0 + // we can set this call to write the results into our memory block for the buffer instead of overwrite the original + // void vDSP_vsadd ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N ); + float tmpVal = 0.5; + vDSP_vsadd(audioData,1,&tmpVal,wPtr,4,(int)newBufferSize.width); + // we wrote the results to the 'r' channel of the output image, now populate the 'b', 'g', and 'a' channels... + float *copySrc = wPtr; + for (int j=0; jmBuffers[rowIndex].mData; + // now run through and populate every "column" in this row of the output image + for (int outputValIndex=0; outputValIndex= rawResultsCount) + rPtr = ablBufferData + (rawResultsCount - valsPerAvg); + + // calculate the average, write it to the buffer + float avgVal = 0.; + /* + // this is actually a max, not an average + for (int i=0; i= magsCount) + rPtr = magsPtr + (magsCount - valsPerAvg); + + // calculate the average, write it to the buffer + float avgVal = 0.; + + // this is actually a max, not an average... + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IISF Filters (drop folder to list, +select to view a filter) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ISF Editor/Cube Array.qtz b/ISF Editor/Cube Array.qtz new file mode 100644 index 00000000..6868e412 Binary files /dev/null and b/ISF Editor/Cube Array.qtz differ diff --git a/ISF Editor/DocController.h b/ISF Editor/DocController.h new file mode 100644 index 00000000..ee25d1c4 --- /dev/null +++ b/ISF Editor/DocController.h @@ -0,0 +1,65 @@ +#import +#import +#import + + + + +/* this controller manages opening, displaying, and editing an ISF file. it also manages the + error, fragment shader, vertex shader, and JSON text views, as well as the split view that + contains both the file text view and the error/frag/vert/JSON text views. +*/ +@interface DocController : NSObject { + IBOutlet id isfController; + IBOutlet NSWindow *window; + + NSString *fragFilePath; + NSString *fragFilePathContentsOnOpen; // we retain the contents of the file as it was opened for comparison purposes + BOOL fragEditsPerformed; + NSString *vertFilePath; + NSString *vertFilePathContentsOnOpen; + BOOL vertEditsPerformed; + NSTimer *tmpFileSaveTimer; // when we make a new file, before it's been properly saved to disk, it's just a tmp file- which is saved frequently... + + IBOutlet NSSplitView *splitView; + IBOutlet NSView *splitViewFileSubview; + IBOutlet NSView *splitViewNonFileSubview; + + IBOutlet NSSplitView *fileSplitView; + IBOutlet NSView *fileSplitViewFragSubview; + IBOutlet NSView *fileSplitviewVertSubview; + IBOutlet NSView *fileSplitViewJSONSubview; + + MGSFragaria *fragFileFragaria; + MGSFragaria *vertFileFragaria; + MGSFragaria *jsonFragaria; + MGSFragaria *errorFragaria; + MGSFragaria *vertTextFragaria; + MGSFragaria *fragTextFragaria; + + IBOutlet NSView *fragFileTextView; + IBOutlet NSView *vertFileTextView; + IBOutlet NSTabView *nonFileTabView; + IBOutlet NSView *jsonTextView; + IBOutlet NSView *errorTextView; + IBOutlet NSView *vertTextView; + IBOutlet NSView *fragTextView; + + IBOutlet id jsonController; +} + +- (void) createNewFile; +- (void) loadFile:(NSString *)p; +- (void) saveOpenFile; +- (void) reloadFileFromTableView; + +- (void) loadNonFileContentDict:(NSDictionary *)n; + +- (BOOL) contentsNeedToBeSaved; + +- (void) fragEditPerformed; +- (void) vertEditPerformed; + +- (NSString *) fragFilePath; + +@end diff --git a/ISF Editor/DocController.m b/ISF Editor/DocController.m new file mode 100644 index 00000000..dad31026 --- /dev/null +++ b/ISF Editor/DocController.m @@ -0,0 +1,643 @@ +#import "DocController.h" +#import "ISFController.h" +#import "JSONGUIController.h" + + + + +@implementation DocController + + +- (id) init { + self = [super init]; + if (self!=nil) { + fragFilePath = nil; + fragFilePathContentsOnOpen = nil; + fragEditsPerformed = NO; + vertFilePath = nil; + vertFilePathContentsOnOpen = nil; + vertEditsPerformed = NO; + tmpFileSaveTimer = nil; + + // + // assign user defaults. + // a number of properties are derived from the user defaults system rather than the doc spec. + // + // see MGSFragariaPreferences.h for details + // + [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:MGSFragariaPrefsAutocompleteSuggestAutomatically]; + + fragFileFragaria = [[MGSFragaria alloc] init]; + vertFileFragaria = [[MGSFragaria alloc] init]; + + jsonFragaria = [[MGSFragaria alloc] init]; + errorFragaria = [[MGSFragaria alloc] init]; + vertTextFragaria = [[MGSFragaria alloc] init]; + fragTextFragaria = [[MGSFragaria alloc] init]; + + [fragFileFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + [vertFileFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + [jsonFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + [errorFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + [vertTextFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + [fragTextFragaria setObject:@"GLSL" forKey:MGSFOSyntaxDefinitionName]; + } + return self; +} +- (void) awakeFromNib { + //NSLog(@"%s",__func__); + + [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:0] ofDividerAtIndex:0]; + [fileSplitView setPosition:[fileSplitView maxPossiblePositionOfDividerAtIndex:0] ofDividerAtIndex:0]; + + [fragFileFragaria embedInView:fragFileTextView]; + [vertFileFragaria embedInView:vertFileTextView]; + [jsonFragaria embedInView:jsonTextView]; + [errorFragaria embedInView:errorTextView]; + [vertTextFragaria embedInView:vertTextView]; + [fragTextFragaria embedInView:fragTextView]; + + NSTextView *tmpTextView = nil; + tmpTextView = [jsonFragaria objectForKey:ro_MGSFOTextView]; + [tmpTextView setEditable:NO]; + tmpTextView = [errorFragaria objectForKey:ro_MGSFOTextView]; + [tmpTextView setEditable:NO]; + tmpTextView = [vertTextFragaria objectForKey:ro_MGSFOTextView]; + [tmpTextView setEditable:NO]; + tmpTextView = [fragTextFragaria objectForKey:ro_MGSFOTextView]; + [tmpTextView setEditable:NO]; + + [fragFileFragaria setObject:self forKey:MGSFODelegate]; + [vertFileFragaria setObject:self forKey:MGSFODelegate]; +} + + +- (void) createNewFile { + //NSLog(@"%s",__func__); + // kill the save timer if it exists + @synchronized (self) { + if (tmpFileSaveTimer!=nil) { + [tmpFileSaveTimer invalidate]; + tmpFileSaveTimer = nil; + } + } + // first of all, assemble a new empty file, located at "/tmp/ISFTesterTmpFile.fs" + NSString *newFilePath = @"/tmp/ISFTesterTmpFile.fs"; + NSString *newFileGuts = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"NewFileTemplate" ofType:@"txt"] encoding:NSUTF8StringEncoding error:nil]; + if (![newFileGuts writeToFile:newFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) { + NSLog(@"\t\terr: couldn't create tmp file in %s",__func__); + return; + } + //else + //NSLog(@"\t\ti appear to have correctly written to the path %@",newFilePath); + + // load the tmp file i just created + [self loadFile:newFilePath]; +} +- (void) loadFile:(NSString *)p { + NSLog(@"%s ... %@",__func__,p); + // kill the save timer if it exists + @synchronized (self) { + if (tmpFileSaveTimer!=nil) { + [tmpFileSaveTimer invalidate]; + tmpFileSaveTimer = nil; + } + } + /* + // clear out everything in the non-file text views + NSLog(@"\t\tclearing out contents with a non-file content dict..."); + dispatch_async(dispatch_get_main_queue(), ^{ + [self loadNonFileContentDict:nil]; + }); + */ + + + + // load the file at the passed path (a .fs or .frag file) to an NSString + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *fileContents = (p==nil || ![fm fileExistsAtPath:p]) ? nil : [NSString stringWithContentsOfFile:p encoding:NSUTF8StringEncoding error:nil]; + // if i loaded stuff from a file, replace the relevant vars & update the file text view + @synchronized (self) { + VVRELEASE(fragFilePath); + VVRELEASE(fragFilePathContentsOnOpen); + fragEditsPerformed = NO; + if (fileContents!=nil) { + fragFilePath = [p retain]; + fragFilePathContentsOnOpen = [fileContents retain]; + dispatch_async(dispatch_get_main_queue(), ^{ + [fragFileFragaria setString:fileContents]; + }); + } + else { + dispatch_async(dispatch_get_main_queue(), ^{ + [fragFileFragaria setString:@""]; + }); + } + + } + + + // i'm also going to want to load the stuff from the vertex shader file to the corresponding editor... + // look for a vert shader that matches the name of the frag shader + NSString *noExtPath = [p stringByDeletingPathExtension]; + NSString *tmpVertPath = nil; + tmpVertPath = VVFMTSTRING(@"%@.vs",noExtPath); + if ([fm fileExistsAtPath:tmpVertPath]) + fileContents = [NSString stringWithContentsOfFile:tmpVertPath encoding:NSUTF8StringEncoding error:nil]; + else { + tmpVertPath = VVFMTSTRING(@"%@.vert",noExtPath); + if ([fm fileExistsAtPath:tmpVertPath]) + fileContents = [NSString stringWithContentsOfFile:tmpVertPath encoding:NSUTF8StringEncoding error:nil]; + else { + fileContents = nil; + } + } + // if i loaded stuff from a file, replace the relevant vars & update the file text view + @synchronized (self) { + VVRELEASE(vertFilePath); + VVRELEASE(vertFilePathContentsOnOpen); + vertEditsPerformed = NO; + if (fileContents!=nil) { + vertFilePath = [tmpVertPath retain]; + vertFilePathContentsOnOpen = [fileContents retain]; + dispatch_async(dispatch_get_main_queue(), ^{ + [vertFileFragaria setString:fileContents]; + }); + } + else { + dispatch_async(dispatch_get_main_queue(), ^{ + [vertFileFragaria setString:@""]; + }); + } + } + + + // tell the JSON GUI controller to refresh its UI (loads the outline view with the GUI for editing inputs/passes/etc) + [jsonController refreshUI]; +} +- (void) saveOpenFile { + NSLog(@"********************************"); + NSLog(@"%s",__func__); + // get the current strings- if it's nil or empty, bail + NSString *currentFragString = [[[fragFileFragaria string] copy] autorelease]; + if (currentFragString!=nil && [currentFragString length]<1) + currentFragString = nil; + NSString *currentVertString = [[[vertFileFragaria string] copy] autorelease]; + if (currentVertString!=nil && [currentVertString length]<1) + currentVertString = nil; + if ((currentFragString==nil || [currentFragString length]<1) && (currentVertString==nil || [currentVertString length]<1)) { + NSLog(@"\t\tbailing on save, currentFragString and currentVertString empty"); + return; + } + + + + + + @synchronized (self) { + // kill the save timer if it exists + if (tmpFileSaveTimer!=nil) { + [tmpFileSaveTimer invalidate]; + tmpFileSaveTimer = nil; + } + // if the current string matches the contents on open, bail- nothing to save anywhere + BOOL fragContentsChanged = NO; + BOOL vertContentsChanged = NO; + /* + if (fragFilePathContentsOnOpen==nil) + NSLog(@"\t\tfragFilePathContentsOnOpen is nil"); + else + NSLog(@"\t\tfragFilePathContentsOnOpen is non-nil"); + if (vertFilePathContentsOnOpen==nil) + NSLog(@"\t\tvertFilePathContentsOnOpen is nil"); + else + NSLog(@"\t\tvertFilePathContentsOnOpen is non-nil"); + + if (currentFragString==nil) + NSLog(@"\t\tcurrentFragString is nil"); + else + NSLog(@"\t\tcurrentFragString is non-nil"); + if (currentVertString==nil) + NSLog(@"\t\tcurrentVertString is nil"); + else + NSLog(@"\t\tcurrentVertString is non-nil"); + */ + // check to see if the actual file contents have changed + if ((fragFilePathContentsOnOpen==nil && currentFragString!=nil) || (fragFilePathContentsOnOpen!=nil && currentFragString!=nil && ![fragFilePathContentsOnOpen isEqualToString:currentFragString])) + fragContentsChanged = YES; + if ((vertFilePathContentsOnOpen==nil && currentVertString!=nil) || (vertFilePathContentsOnOpen!=nil && currentVertString!=nil && ![vertFilePathContentsOnOpen isEqualToString:currentVertString])) + vertContentsChanged = YES; + + // if the frag file is in /tmp/, we're going to pretend that its contents have changed (so it gets written to disk) + if (!fragContentsChanged && fragFilePath!=nil && [fragFilePath rangeOfString:@"/tmp/"].location==0) + fragContentsChanged = YES; + if (!vertContentsChanged && vertFilePath!=nil && [vertFilePath rangeOfString:@"/tmp/"].location==0) + vertContentsChanged = YES; + + if (!fragContentsChanged && !vertContentsChanged) { + //NSLog(@"\t\tbailing on save, contents haven't changed since file opened"); + return; + } + + //NSLog(@"\t\tfragContentsChanged is %d, vertContentsChanged is %d",fragContentsChanged,vertContentsChanged); + // if the file path is nil or this is a temp file, open an alert so the user can supply a name and save location for the file + if (fragFilePath==nil || [fragFilePath rangeOfString:@"/tmp/"].location==0) { + //NSLog(@"\t\tfile paths are in tmp, need to show a save panel..."); + + NSSavePanel *savePanel = [[NSSavePanel savePanel] retain]; + // the default save directory should be the directory currently listed in the window at left (default to system ISF folder if not specified yet) + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + NSString *tmpPath = [def objectForKey:@"fxPath"]; + // if there's no default path yet, try to use the system-level default path (if it exists) + if (tmpPath==nil) { + NSFileManager *fm = [NSFileManager defaultManager]; + BOOL defaultIsFolder = NO; + if ([fm fileExistsAtPath:tmpPath isDirectory:&defaultIsFolder] && defaultIsFolder) + tmpPath = @"/Library/Graphics/ISF"; + } + [savePanel setDirectoryURL:[NSURL fileURLWithPath:tmpPath]]; + [savePanel setExtensionHidden:YES]; + [savePanel setAllowsOtherFileTypes:NO]; + [savePanel setAllowedFileTypes:OBJARRAY(@"fs")]; + [savePanel + beginSheetModalForWindow:window + completionHandler:^(NSInteger result) { + // if the user clicked okay, save the file(s) + if (result == NSFileHandlingPanelOKButton) { + NSString *pathToSave = [[savePanel URL] path]; + NSString *noExtPathToSave = [pathToSave stringByDeletingPathExtension]; + if (fragContentsChanged) { + NSString *localWritePath = VVFMTSTRING(@"%@.fs",noExtPathToSave); + @synchronized (self) { + VVRELEASE(fragFilePath); + fragFilePath = [localWritePath retain]; + VVRELEASE(fragFilePathContentsOnOpen); + fragFilePathContentsOnOpen = [currentFragString retain]; + fragEditsPerformed = NO; + } + if (![currentFragString writeToFile:localWritePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) { + NSLog(@"\t\tERR: problem writing frag file to path %@",localWritePath); + } + //else + //NSLog(@"********************* wrote .fs file to disk A"); + } + if (vertContentsChanged) { + NSString *localWritePath = VVFMTSTRING(@"%@.vs",noExtPathToSave); + @synchronized (self) { + VVRELEASE(vertFilePath); + vertFilePath = [localWritePath retain]; + VVRELEASE(vertFilePathContentsOnOpen); + vertFilePathContentsOnOpen = [currentVertString retain]; + vertEditsPerformed = NO; + } + if (![currentVertString writeToFile:localWritePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) { + NSLog(@"\t\tERR: problem writing vert file to path %@",localWritePath); + } + //else + //NSLog(@"********************* wrote .vs file to disk A"); + } + + if (fragContentsChanged || vertContentsChanged) + [isfController loadFile:pathToSave]; + + } + // else the user clicked cancel- we don't want to save + else { + @synchronized (self) { + NSLog(@"**** not sure if i want to comment this out, refer here if file stuff is broken, %s",__func__); + /* + VVRELEASE(fragFilePath); + VVRELEASE(fragFilePathContentsOnOpen); + fragEditsPerformed = NO; + VVRELEASE(vertFilePath); + VVRELEASE(vertFilePathContentsOnOpen); + vertEditsPerformed = NO; + */ + } + } + }]; + } + // else the file path is non-nil and not in /tmp/, just save the file to disk + else { + //NSLog(@"\t\tfile paths aren't in tmp, just saving to disk..."); + if (fragContentsChanged) { + // if i successfully wrote the file to disk + if ([currentFragString writeToFile:fragFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) { + //NSLog(@"********************* wrote .fs file to disk B"); + VVRELEASE(fragFilePathContentsOnOpen); + fragFilePathContentsOnOpen = [currentFragString retain]; + fragEditsPerformed = NO; + } + //else + //NSLog(@"\t\tERR: problem saving frag file %@ to disk",fragFilePath); + } + if (vertContentsChanged) { + // if the vert file path is nil, it means that i just created a vert shader by jotting down some text in an empty editor, and i need to save it as a new file + if (vertFilePath==nil && fragFilePath!=nil) { + vertFilePath = [[[fragFilePath stringByDeletingPathExtension] stringByAppendingPathExtension:@"vs"] retain]; + } + // if i successfully wrote the file to disk + //NSLog(@"\t\tshould be dumping currentVertString to file %@ in %s",vertFilePath,__func__); + if ([currentVertString writeToFile:vertFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) { + //NSLog(@"********************* wrote .vs file to disk B"); + VVRELEASE(vertFilePathContentsOnOpen); + vertFilePathContentsOnOpen = [currentVertString retain]; + vertEditsPerformed = NO; + } + //else + //NSLog(@"\t\tERR: problem saving vert file %@ to disk",vertFilePath); + } + } + } + +} +- (void) reloadFileFromTableView { + +} + + +- (void) loadNonFileContentDict:(NSDictionary *)n { + //NSLog(@"%s ... %p",__func__,n); + //NSLog(@"%s ... %@",__func__,n); + BOOL openSplitView = NO; + NSString *tmpString = nil; + NSArray *syntaxErrs = [n objectForKey:@"syntaxErr"]; + + tmpString = (n==nil) ? nil : [n objectForKey:@"error"]; + if (tmpString==nil) + tmpString = @"// No errors!"; + else { + // if there's an error string, we need to make sure the split view is open! + openSplitView = YES; + } + dispatch_async(dispatch_get_main_queue(), ^{ + [errorFragaria setString:tmpString]; + [fragFileFragaria setSyntaxErrors:syntaxErrs]; + }); + + tmpString = (n==nil) ? nil : [n objectForKey:@"json"]; + if (tmpString==nil) + tmpString = @""; + dispatch_async(dispatch_get_main_queue(), ^{ + [jsonFragaria setString:tmpString]; + }); + + tmpString = (n==nil) ? nil : [n objectForKey:@"vertex"]; + if (tmpString==nil) + tmpString = @""; + dispatch_async(dispatch_get_main_queue(), ^{ + [vertTextFragaria setString:tmpString]; + }); + + tmpString = (n==nil) ? nil : [n objectForKey:@"fragment"]; + if (tmpString==nil) + tmpString = @""; + dispatch_async(dispatch_get_main_queue(), ^{ + [fragTextFragaria setString:tmpString]; + }); + + /* + // tell the JSON GUI controller to refresh its UI (loads the outline view with the GUI for editing inputs/passes/etc) + [jsonController refreshUI]; + */ + + // if we have to pop open the split view containing the error info, do so now + if (openSplitView) { + // open the split view if necessary + if ([splitView isSubviewCollapsed:splitViewNonFileSubview]) { + [splitView setPosition:[splitView frame].size.height-250.0 ofDividerAtIndex:0]; + } + // switch to the error tab + [nonFileTabView selectTabViewItemAtIndex:0]; + } +} +- (NSString *) fragFilePath { + NSString *returnMe = nil; + @synchronized (self) { + returnMe = [[fragFilePath retain] autorelease]; + } + return returnMe; +} + + +#pragma mark - +#pragma mark NSSplitViewDelegate protocol + + +- (BOOL)splitView:(NSSplitView *)sv canCollapseSubview:(NSView *)subview { + if (subview==splitViewFileSubview) + return NO; + if (subview == fileSplitviewVertSubview) { + //if ([sv isSubviewCollapsed:fileSplitViewFragSubview] && ![sv isSubviewCollapsed:fileSplitViewJSONSubview]) + // return NO; + //else + // return YES; + } + return YES; +} +- (BOOL)splitView:(NSSplitView *)sv shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex { + //NSLog(@"%s ... %d",__func__,dividerIndex); + return YES; +} +- (CGFloat)splitView:(NSSplitView *)sv constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex { + //NSLog(@"%s ... %d, %f",__func__,dividerIndex,proposedMax); + if (sv==splitView) { + NSRect splitViewFrame = [splitView frame]; + return splitViewFrame.size.height - 250.0; + } + else if (sv==fileSplitView) { + //NSLog(@"%s ... %d, %f",__func__,dividerIndex,proposedMax); + NSRect splitViewFrame = [sv frame]; + CGFloat returnMe = splitViewFrame.size.width; + if (dividerIndex == 0) { + //return proposedMax; + if (![sv isSubviewCollapsed:fileSplitViewJSONSubview]) + returnMe -= 360.; + returnMe -= [sv dividerThickness]; + returnMe -= 180.; + //if (![sv isSubviewCollapsed:fileSplitviewVertSubview]) + // returnMe -= [fileSplitviewVertSubview frame].size.width; + //returnMe -= [sv dividerThickness]; + } + else if (dividerIndex == 1) { + return [sv frame].size.width-360.-[sv dividerThickness]-[sv dividerThickness]; + //if (![sv isSubviewCollapsed:fileSplitViewJSONSubview]) + // returnMe -= 360.; + //returnMe -= [sv dividerThickness]; + } + return returnMe; + + /* + NSRect splitViewFrame = [sv frame]; + return splitViewFrame.size.width - 250.0; + */ + } + return proposedMax; +} +- (CGFloat)splitView:(NSSplitView *)sv constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { + //NSLog(@"%s ... %d, %f",__func__,dividerIndex,proposedMin); + if (sv==splitView) { + return 250.0; + } + else if (sv==fileSplitView) { + //NSLog(@"%s ... %d, %f",__func__,dividerIndex,proposedMin); + CGFloat returnMe = 0.; + if (dividerIndex == 0) { + returnMe = 180.; + } + else if (dividerIndex == 1) { + return [sv frame].size.width-360.-[sv dividerThickness]-[sv dividerThickness]; + //if (![sv isSubviewCollapsed:fileSplitViewFragSubview]) + // returnMe += [fileSplitViewFragSubview frame].size.width; + //returnMe += [sv dividerThickness]; + //if (![sv isSubviewCollapsed:fileSplitviewVertSubview]) + // returnMe += [fileSplitviewVertSubview frame].size.width; + //returnMe += [sv dividerThickness]; + } + return returnMe; + + /* + return 250.0; + */ + } + return proposedMin; +} +/* +- (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex { + NSLog(@"%s ... %d, %f",__func__,dividerIndex,proposedPosition); + //NSRectLog(@"\t\tsplitViewPagesSubview frame is",[splitViewPagesSubview frame]); + //if (splitView==fileSplitView && dividerIndex==1) { + // return fmax(proposedPosition, [splitView frame].size.width-360.); + //} + return proposedPosition; +} +*/ +- (BOOL)splitView:(NSSplitView *)sv shouldAdjustSizeOfSubview:(NSView *)subview { + if (sv == fileSplitView) { + if (subview == fileSplitViewJSONSubview) + return NO; + } + return YES; +} + + +#pragma mark - +#pragma mark NSTextDelegate + + +- (void)textDidChange:(NSNotification *)notification { + //NSLog(@"%s ... %@",__func__,notification); + if ([notification object]==[fragFileFragaria textView]) + [self fragEditPerformed]; + else if ([notification object]==[vertFileFragaria textView]) + [self vertEditPerformed]; +} +- (void)textDidBeginEditing:(NSNotification *)aNotification { + //NSLog(@"%s",__func__); + //[self editPerformed]; +} +- (void)textDidEndEditing:(NSNotification *)aNotification { + //NSLog(@"%s",__func__); + //[self editPerformed]; +} +- (BOOL)textShouldBeginEditing:(NSText *)aTextObject { + return YES; +} +- (BOOL)textShouldEndEditing:(NSText *)aTextObject { + return YES; +} +- (void) fragEditPerformed { + @synchronized (self) { + fragEditsPerformed = YES; + // kill the save timer if it exists + if (tmpFileSaveTimer!=nil) { + [tmpFileSaveTimer invalidate]; + tmpFileSaveTimer = nil; + } + // if this file is saved in /tmp/, start a timer to save it in a couple seconds + if (fragFilePath!=nil && [fragFilePath rangeOfString:@"/tmp/"].location==0) { + tmpFileSaveTimer = [NSTimer + scheduledTimerWithTimeInterval:2.0 + target:self + selector:@selector(tmpFileSaveTimerProc:) + userInfo:nil + repeats:NO]; + } + } +} +- (void) vertEditPerformed { + @synchronized (self) { + vertEditsPerformed = YES; + // kill the save timer if it exists + if (tmpFileSaveTimer!=nil) { + [tmpFileSaveTimer invalidate]; + tmpFileSaveTimer = nil; + } + // if this file is saved in /tmp/, start a timer to save it in a couple seconds + if (vertFilePath!=nil && [vertFilePath rangeOfString:@"/tmp/"].location==0) { + tmpFileSaveTimer = [NSTimer + scheduledTimerWithTimeInterval:2.0 + target:self + selector:@selector(tmpFileSaveTimerProc:) + userInfo:nil + repeats:NO]; + } + } +} +- (void) tmpFileSaveTimerProc:(NSTimer *)t { + //NSLog(@"%s",__func__); + NSString *currentFragString = [[[fragFileFragaria string] copy] autorelease]; + NSString *currentVertString = [[[vertFileFragaria string] copy] autorelease]; + @synchronized (self) { + tmpFileSaveTimer = nil; + BOOL needsToReload = NO; + if (fragFilePath!=nil && [fragFilePath rangeOfString:@"/tmp/"].location==0) { + if (![currentFragString writeToFile:fragFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) + NSLog(@"\t\terr: problem writing file to path %@",fragFilePath); + //else + //NSLog(@"********************* wrote .fs file to disk C"); + needsToReload = YES; + } + if (vertFilePath!=nil && [vertFilePath rangeOfString:@"/tmp/"].location==0) { + //NSLog(@"\t\tshould be dumping currentVertString to file %@ in %s",vertFilePath,__func__); + if (![currentVertString writeToFile:vertFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]) + NSLog(@"\t\terr: problem writing file to path %@",vertFilePath); + //else + //NSLog(@"********************* wrote .vs file to disk C"); + needsToReload = YES; + } + if (needsToReload) + [isfController reloadTargetFile]; + } +} + + +#pragma mark - +#pragma mark key-val + + +- (BOOL) contentsNeedToBeSaved { + BOOL returnMe = NO; + @synchronized (self) { + if (fragEditsPerformed) { + NSString *currentContents = [fragFileFragaria string]; + if (currentContents!=nil && [currentContents length]>0) { + if (fragFilePathContentsOnOpen==nil || ![fragFilePathContentsOnOpen isEqualToString:currentContents]) { + returnMe = YES; + } + } + } + if (vertEditsPerformed) { + NSString *currentContents = [vertFileFragaria string]; + if (currentContents!=nil && [currentContents length]>0) { + if (vertFilePathContentsOnOpen==nil || ![vertFilePathContentsOnOpen isEqualToString:currentContents]) { + returnMe = YES; + } + } + } + } + return returnMe; +} + + +@end diff --git a/ISF Editor/DynamicVideoSource.h b/ISF Editor/DynamicVideoSource.h new file mode 100644 index 00000000..9abc9823 --- /dev/null +++ b/ISF Editor/DynamicVideoSource.h @@ -0,0 +1,62 @@ +#import +#import "VideoSource.h" +#import "AVCaptureVideoSource.h" +#import "MovieFileVideoSource.h" +#import "QCVideoSource.h" +#import "IMGVideoSource.h" +#import "SyphonVideoSource.h" + + + + +typedef enum { + SrcMode_None = 0, + SrcMode_VidIn, + SrcMode_AVFMov, + SrcMode_QC, + SrcMode_IMG, + SrcMode_Syphon +} SrcMode; + +@protocol DynamicVideoSourceDelegate +- (void) listOfStaticSourcesUpdated:(id)ds; +@end + + + + +@interface DynamicVideoSource : NSObject { + BOOL deleted; + + OSSpinLock srcLock; // used to lock the various src vars + SrcMode srcMode; // which source i'm currently using + + OSSpinLock delegateLock; + id delegate; + + AVCaptureVideoSource *vidInSrc; + MovieFileVideoSource *movSrc; + QCVideoSource *qcSrc; + IMGVideoSource *imgSrc; + SyphonVideoSource *syphonSrc; + + OSSpinLock lastBufferLock; + VVBuffer *lastBuffer; +} + +- (void) loadVidInWithUniqueID:(NSString *)u; +- (void) loadMovieAtPath:(NSString *)p; +- (void) loadQCCompAtPath:(NSString *)p; +- (void) loadImgAtPath:(NSString *)p; +- (void) loadSyphonServerWithDescription:(NSDictionary *)d; + +- (void) eject; + +- (NSMenu *) allocStaticSourcesMenu; +- (VVBuffer *) allocBuffer; + +- (void) _useMode:(SrcMode)n; + +- (void) setDelegate:(id)n; + +@end diff --git a/ISF Editor/DynamicVideoSource.m b/ISF Editor/DynamicVideoSource.m new file mode 100644 index 00000000..19425aef --- /dev/null +++ b/ISF Editor/DynamicVideoSource.m @@ -0,0 +1,283 @@ +#import "DynamicVideoSource.h" + + + + +@implementation DynamicVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + deleted = NO; + srcLock = OS_SPINLOCK_INIT; + srcMode = SrcMode_None; + lastBufferLock = OS_SPINLOCK_INIT; + lastBuffer = nil; + + vidInSrc = [[AVCaptureVideoSource alloc] init]; + movSrc = [[MovieFileVideoSource alloc] init]; + qcSrc = [[QCVideoSource alloc] init]; + imgSrc = [[IMGVideoSource alloc] init]; + syphonSrc = [[SyphonVideoSource alloc] init]; + + [vidInSrc setPropDelegate:self]; + [movSrc setPropDelegate:self]; + [qcSrc setPropDelegate:self]; + [imgSrc setPropDelegate:self]; + [syphonSrc setPropDelegate:self]; + + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc addObserver:self selector:@selector(reloadCaptureSourcesNotification:) name:AVCaptureDeviceWasConnectedNotification object:nil]; + [nc addObserver:self selector:@selector(reloadCaptureSourcesNotification:) name:AVCaptureDeviceWasDisconnectedNotification object:nil]; + return self; + } + [self release]; + return nil; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + VVRELEASE(vidInSrc); + VVRELEASE(movSrc); + VVRELEASE(qcSrc); + VVRELEASE(imgSrc); + VVRELEASE(syphonSrc); + [super dealloc]; +} +- (void) prepareToBeDeleted { + [vidInSrc prepareToBeDeleted]; + [movSrc prepareToBeDeleted]; + [qcSrc prepareToBeDeleted]; + [imgSrc prepareToBeDeleted]; + [syphonSrc prepareToBeDeleted]; + deleted = YES; +} + + +/*===================================================================================*/ +#pragma mark --------------------- frontend methods +/*------------------------------------*/ + + +- (void) loadVidInWithUniqueID:(NSString *)u { + //NSLog(@"%s ... %@",__func__,u); + if ([self srcMode]!=SrcMode_VidIn) + [self _useMode:SrcMode_VidIn]; + [vidInSrc loadDeviceWithUniqueID:u]; +} +- (void) loadMovieAtPath:(NSString *)p { + //NSLog(@"%s ... %@",__func__,p); + if ([self srcMode]!=SrcMode_AVFMov) + [self _useMode:SrcMode_AVFMov]; + [movSrc loadFileAtPath:p]; +} +- (void) loadQCCompAtPath:(NSString *)p { + //NSLog(@"%s ... %@",__func__,p); + if ([self srcMode]!=SrcMode_QC) + [self _useMode:SrcMode_QC]; + [qcSrc loadFileAtPath:p]; +} +- (void) loadImgAtPath:(NSString *)p { + //NSLog(@"%s ... %@",__func__,p); + if ([self srcMode]!=SrcMode_IMG) + [self _useMode:SrcMode_IMG]; + [imgSrc loadFileAtPath:p]; +} +- (void) loadSyphonServerWithDescription:(NSDictionary *)d { + //NSLog(@"%s",__func__); + //NSLog(@"\t\tdict is %@",d); + if ([self srcMode]!=SrcMode_Syphon) + [self _useMode:SrcMode_Syphon]; + [syphonSrc loadServerWithServerDescription:d]; +} +- (void) eject { + [self _useMode:SrcMode_None]; +} + + +- (NSMenu *) allocStaticSourcesMenu { + NSMenu *returnMe = [[NSMenu alloc] initWithTitle:@""]; + [returnMe setAutoenablesItems:NO]; + NSArray *tmpArray = nil; + + tmpArray = [qcSrc arrayOfSourceMenuItems]; + if (tmpArray!=nil) { + NSMenuItem *catItem = [[NSMenuItem alloc] initWithTitle:@" Built-In QC Sources" action:nil keyEquivalent:@""]; + [catItem setEnabled:NO]; + [returnMe addItem:catItem]; + [catItem release]; + + for (NSMenuItem *itemPtr in tmpArray) + [returnMe addItem:itemPtr]; + } + + tmpArray = [vidInSrc arrayOfSourceMenuItems]; + if (tmpArray!=nil) { + NSMenuItem *catItem = [[NSMenuItem alloc] initWithTitle:@" Live Inputs" action:nil keyEquivalent:@""]; + [catItem setEnabled:NO]; + [returnMe addItem:catItem]; + [catItem release]; + + for (NSMenuItem *itemPtr in tmpArray) + [returnMe addItem:itemPtr]; + } + + tmpArray = [syphonSrc arrayOfSourceMenuItems]; + if (tmpArray!=nil) { + NSMenuItem *catItem = [[NSMenuItem alloc] initWithTitle:@" Syphon Sources" action:nil keyEquivalent:@""]; + [catItem setEnabled:NO]; + [returnMe addItem:catItem]; + [catItem release]; + + for (NSMenuItem *itemPtr in tmpArray) + [returnMe addItem:itemPtr]; + } + return returnMe; +} +- (VVBuffer *) allocBuffer { + //NSLog(@"%s",__func__); + VVBuffer *returnMe = nil; + VVBuffer *newBuffer = nil; + VideoSource *src = nil; + OSSpinLockLock(&srcLock); + switch (srcMode) { + case SrcMode_None: + break; + case SrcMode_VidIn: + src = vidInSrc; + break; + case SrcMode_AVFMov: + src = movSrc; + break; + case SrcMode_QC: + src = qcSrc; + break; + case SrcMode_IMG: + src = imgSrc; + break; + case SrcMode_Syphon: + src = syphonSrc; + break; + } + if (src!=nil) { + //[src _render]; + newBuffer = [src allocBuffer]; + } + OSSpinLockUnlock(&srcLock); + + OSSpinLockLock(&lastBufferLock); + if (newBuffer != nil) { + VVRELEASE(lastBuffer); + lastBuffer = newBuffer; + returnMe = [newBuffer retain]; + } + else { + returnMe = (lastBuffer==nil) ? nil : [lastBuffer retain]; + } + OSSpinLockUnlock(&lastBufferLock); + + return returnMe; +} + + +/*===================================================================================*/ +#pragma mark --------------------- backend methods +/*------------------------------------*/ + + +- (void) _useMode:(SrcMode)n { + //NSLog(@"%s ... %d",__func__,n); + SrcMode oldMode; + OSSpinLockLock(&srcLock); + oldMode = srcMode; + if (oldMode != n) { + switch (oldMode) { + case SrcMode_None: + break; + case SrcMode_VidIn: + [vidInSrc stop]; + break; + case SrcMode_AVFMov: + [movSrc stop]; + break; + case SrcMode_QC: + [qcSrc stop]; + break; + case SrcMode_IMG: + [imgSrc stop]; + break; + case SrcMode_Syphon: + [syphonSrc stop]; + break; + } + switch (n) { + case SrcMode_None: + break; + case SrcMode_VidIn: + [vidInSrc start]; + break; + case SrcMode_AVFMov: + [movSrc start]; + break; + case SrcMode_QC: + [qcSrc start]; + break; + case SrcMode_IMG: + [imgSrc start]; + break; + case SrcMode_Syphon: + [syphonSrc start]; + break; + } + srcMode = n; + } + OSSpinLockUnlock(&srcLock); +} + +- (SrcMode) srcMode { + SrcMode returnMe; + OSSpinLockLock(&srcLock); + returnMe = srcMode; + OSSpinLockUnlock(&srcLock); + return returnMe; +} + + +- (void) setDelegate:(id)n { + OSSpinLockLock(&delegateLock); + delegate = n; + OSSpinLockUnlock(&delegateLock); +} + + +- (void) reloadCaptureSourcesNotification:(NSNotification *)note { + //NSLog(@"%s",__func__); + [self listOfStaticSourcesUpdated:nil]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- VideoSourceDelegate protocol +/*------------------------------------*/ + + +- (void) listOfStaticSourcesUpdated:(id)ds { + //NSLog(@"%s",__func__); + id localDelegate = nil; + OSSpinLockLock(&delegateLock); + localDelegate = (delegate==nil) ? nil : [delegate retain]; + OSSpinLockUnlock(&delegateLock); + + if (localDelegate != nil) { + [localDelegate listOfStaticSourcesUpdated:self]; + [localDelegate release]; + } +} + + +@end diff --git a/ISF Editor/IMGVideoSource.h b/ISF Editor/IMGVideoSource.h new file mode 100644 index 00000000..eeb04126 --- /dev/null +++ b/ISF Editor/IMGVideoSource.h @@ -0,0 +1,13 @@ +#import +#import "VideoSource.h" + + + + +@interface IMGVideoSource : VideoSource { + VVBuffer *propLastBuffer; +} + +- (void) loadFileAtPath:(NSString *)p; + +@end diff --git a/ISF Editor/IMGVideoSource.m b/ISF Editor/IMGVideoSource.m new file mode 100644 index 00000000..f7d99107 --- /dev/null +++ b/ISF Editor/IMGVideoSource.m @@ -0,0 +1,80 @@ +#import "IMGVideoSource.h" + + + + +@implementation IMGVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + propLastBuffer = nil; + //lastBufferLock = OS_SPINLOCK_INIT; + //lastBuffer = nil; + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [super prepareToBeDeleted]; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + OSSpinLockLock(&propLock); + VVRELEASE(propLastBuffer); + OSSpinLockUnlock(&propLock); + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (void) loadFileAtPath:(NSString *)p { + NSLog(@"%s ... %@",__func__,p); + if (p==nil) + return; + NSImage *img = [[NSImage alloc] initWithContentsOfFile:p]; + if (img==nil) { + NSLog(@"\t\terr: couldn't make NSImage from path \"%@\"",p); + return; + } + + VVBuffer *newBuffer = [_globalVVBufferPool allocBufferForNSImage:img]; + if (newBuffer==nil) { + NSLog(@"\t\terr: couldn't make VVBuffer from NSImage in %s",__func__); + } + else { + [newBuffer setFlipped:YES]; + + OSSpinLockLock(&propLock); + VVRELEASE(propLastBuffer); + propLastBuffer = newBuffer; + OSSpinLockUnlock(&propLock); + } + + [img release]; + img = nil; +} +- (void) _stop { + VVRELEASE(propLastBuffer); +} +- (VVBuffer *) allocBuffer { + VVBuffer *returnMe = nil; + OSSpinLockLock(&propLock); + returnMe = (propLastBuffer==nil) ? nil : [propLastBuffer retain]; + OSSpinLockUnlock(&propLock); + return returnMe; +} + + +@end diff --git a/ISF Editor/ISF Editor-Info.plist b/ISF Editor/ISF Editor-Info.plist new file mode 100644 index 00000000..8f47de72 --- /dev/null +++ b/ISF Editor/ISF Editor-Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleGetInfoString + 2.8 + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.8 + CFBundleSignature + ???? + CFBundleVersion + 2.0 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2016 Vidvox. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/ISF Editor/ISF QuickLook Plugin.pkg b/ISF Editor/ISF QuickLook Plugin.pkg new file mode 100644 index 00000000..4a3b89eb Binary files /dev/null and b/ISF Editor/ISF QuickLook Plugin.pkg differ diff --git a/ISF Editor/ISFAVFAudioSource.h b/ISF Editor/ISFAVFAudioSource.h new file mode 100644 index 00000000..f40e11b7 --- /dev/null +++ b/ISF Editor/ISFAVFAudioSource.h @@ -0,0 +1,41 @@ +#import +#import +#import "ISFAudioBufferList.h" + + +@protocol ISFAVFAudioSourceDelegate +- (void) audioSource:(id)as receivedAudioBufferList:(id)b; +@end + + + +@interface ISFAVFAudioSource : NSObject { + + BOOL deleted; + OSSpinLock propLock; + BOOL propRunning; + id propDelegate; + AVCaptureDeviceInput *propDeviceInput; + AVCaptureSession *propSession; + AVCaptureAudioDataOutput *propOutput; + dispatch_queue_t propQueue; + +} + +- (void) prepareToBeDeleted; + +- (NSArray *) arrayOfSourceMenuItems; +- (NSString *) inputName; +- (void) loadDeviceWithUniqueID:(NSString *)n; +- (void) setPropDelegate:(id)d; + +- (void) start; +- (void) _start; +- (void) stop; +- (void) _stop; +- (BOOL) propRunning; + +- (void) _updateWithCMSampleBufferRef:(CMSampleBufferRef)ref; +- (void) captureDevicesWasRemovedChangeNotification:(NSNotification *)note; + +@end diff --git a/ISF Editor/ISFAVFAudioSource.m b/ISF Editor/ISFAVFAudioSource.m new file mode 100644 index 00000000..1160147c --- /dev/null +++ b/ISF Editor/ISFAVFAudioSource.m @@ -0,0 +1,286 @@ +// +// ISFAVFAudioSource.m +// ISF Syphon Filter Tester +// +// Created by David Lublin on 8/17/16. +// Copyright © 2016 zoidberg. All rights reserved. +// + +#import "ISFAVFAudioSource.h" + +@implementation ISFAVFAudioSource + + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + +- (id) init { + //NSLog(@"%s",__func__); + if (self = [super init]) { + deleted = NO; + propLock = OS_SPINLOCK_INIT; + propRunning = NO; + propDelegate = nil; + propDeviceInput = nil; + propSession = nil; + propOutput = nil; + propQueue = NULL; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(captureDevicesWasRemovedChangeNotification:) + name:AVCaptureDeviceWasDisconnectedNotification + object:nil]; + + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [self stop]; + deleted = YES; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + if (!deleted) + [self prepareToBeDeleted]; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + OSSpinLockLock(&propLock); + propDelegate = nil; + OSSpinLockUnlock(&propLock); + + [super dealloc]; +} + +- (void) captureDevicesWasRemovedChangeNotification:(NSNotification *)note { + +} +- (NSArray *) arrayOfSourceMenuItems { + NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio]; + if (devices==nil || [devices count]<1) + return nil; + NSMutableArray *returnMe = [NSMutableArray arrayWithCapacity:0]; + for (AVCaptureDevice *devicePtr in devices) { + NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:[devicePtr localizedName] action:nil keyEquivalent:@""]; + NSString *uniqueID = [devicePtr uniqueID]; + [newItem setRepresentedObject:uniqueID]; + [returnMe addObject:newItem]; + [newItem release]; + } + return returnMe; +} +- (NSString *) inputName { + if (deleted) + return nil; + NSString *returnMe = nil; + OSSpinLockLock(&propLock); + if (propDeviceInput != nil) { + returnMe = [[propDeviceInput device] localizedName]; + } + OSSpinLockUnlock(&propLock); + return returnMe; +} +- (void) loadDeviceWithUniqueID:(NSString *)n { + if ([self propRunning]) + [self stop]; + if (n==nil) + return; + //NSLog(@"%s - %@",__func__,n); + BOOL bail = NO; + NSError *err = nil; + OSSpinLockLock(&propLock); + AVCaptureDevice *propDevice = [AVCaptureDevice deviceWithUniqueID:n]; + propDeviceInput = (propDevice==nil) ? nil : [[AVCaptureDeviceInput alloc] initWithDevice:propDevice error:&err]; + if (propDeviceInput != nil) { + propSession = [[AVCaptureSession alloc] init]; + propOutput = [[AVCaptureAudioDataOutput alloc] init]; + + if (![propSession canAddInput:propDeviceInput]) { + NSLog(@"\t\terr: problem adding propDeviceInput in %s",__func__); + bail = YES; + } + if (![propSession canAddOutput:propOutput]) { + NSLog(@"\t\terr: problem adding propOutput in %s",__func__); + bail = YES; + } + + if (!bail) { + propQueue = dispatch_queue_create([[[NSBundle mainBundle] bundleIdentifier] UTF8String], NULL); + [propOutput setSampleBufferDelegate:self queue:propQueue]; + + [propSession addInput:propDeviceInput]; + [propSession addOutput:propOutput]; + [propSession startRunning]; + } + } + else + bail = YES; + OSSpinLockUnlock(&propLock); + + if (bail) + [self stop]; + else + [self start]; +} +- (void) start { + //NSLog(@"%s ... %@",__func__,self); + OSSpinLockLock(&propLock); + if (!propRunning) { + [self _start]; + propRunning = YES; + } + else + NSLog(@"\t\tERR: starting something that wasn't stopped, %s",__func__); + OSSpinLockUnlock(&propLock); +} +- (void) _start { + //NSLog(@"%s ... %@",__func__,self); +} +- (void) stop { + //NSLog(@"%s ... %@",__func__,self); + OSSpinLockLock(&propLock); + if (propRunning) { + [self _stop]; + propRunning = NO; + } + else + NSLog(@"\t\tERR: stopping something that wasn't running, %s",__func__); + OSSpinLockUnlock(&propLock); +} +- (void) _stop { + //NSLog(@"%s",__func__); + if (propSession != nil) { + [propSession stopRunning]; + if (propDeviceInput != nil) + [propSession removeInput:propDeviceInput]; + if (propOutput != nil) + [propSession removeOutput:propOutput]; + + dispatch_release(propQueue); + propQueue = NULL; + + [propDeviceInput release]; + propDeviceInput = nil; + [propOutput release]; + propOutput = nil; + [propSession release]; + propSession = nil; + } +} +- (BOOL) propRunning { + BOOL returnMe; + OSSpinLockLock(&propLock); + returnMe = propRunning; + OSSpinLockUnlock(&propLock); + return returnMe; +} +- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { + //NSLog(@"%s",__func__); + if (deleted) + return; + [self _updateWithCMSampleBufferRef:sampleBuffer]; +} +- (void) _updateWithCMSampleBufferRef:(CMSampleBufferRef)ref { + //NSLog(@"%s",__func__); + if (deleted) + return; + if (ref == nil) + return; + // if there is no delegate, return here + id _delegate = nil; + OSSpinLockLock(&propLock); + _delegate = propDelegate; + OSSpinLockUnlock(&propLock); + if (_delegate == nil) + return; + + // determine the number of samples and bail if 0 + CMItemCount numSamplesInBuffer = CMSampleBufferGetNumSamples(ref); + if (numSamplesInBuffer == 0) + return; + + //NSLog(@"\t\tnumSamplesInBuffer %ld",numSamplesInBuffer); + + // first use CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer to determine how big the buffer is + OSStatus osErr = noErr; + const AudioStreamBasicDescription *asbd = NULL; + size_t bufferSize = 0; + osErr = CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(ref, + &bufferSize, + NULL, + 0, + NULL, + NULL, + 0, + NULL + ); + + if (osErr != noErr) { + NSLog(@"\t\terror on CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer 1"); + } + + //NSLog(@"\t\tbuffer size %d",(int)bufferSize); + // now allocate the buffer and call CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer again + AudioBufferList *audioBufferList = malloc(sizeof(AudioBufferList)+bufferSize); + CMBlockBufferRef blockBuffer = NULL; + + osErr = CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(ref, + NULL, + audioBufferList, + bufferSize, + NULL, + NULL, + kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment, + &blockBuffer); + + if (osErr == kCMSampleBufferError_AllocationFailed) { + NSLog(@"\t\terror kCMSampleBufferError_AllocationFailed on CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer"); + } + else if (osErr == kCMSampleBufferError_ArrayTooSmall) { + NSLog(@"\t\terror kCMSampleBufferError_ArrayTooSmall on CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer"); + } + else if (osErr != noErr) { + NSLog(@"\t\terror on CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer 2"); + } + + CMFormatDescriptionRef fmtDesc = CMSampleBufferGetFormatDescription(ref); + CMMediaType fmtMediaType = CMFormatDescriptionGetMediaType(fmtDesc); + if (fmtMediaType==kCMMediaType_Audio) { + AudioStreamBasicDescription newASBD; + asbd = CMAudioFormatDescriptionGetStreamBasicDescription(fmtDesc); + + newASBD.mFormatID = asbd->mFormatID; + newASBD.mFormatFlags = asbd->mFormatFlags; + newASBD.mBytesPerPacket = asbd->mBytesPerPacket; + newASBD.mFramesPerPacket = asbd->mFramesPerPacket; + newASBD.mBytesPerFrame = asbd->mBytesPerFrame; + newASBD.mBitsPerChannel = asbd->mBitsPerChannel; + newASBD.mSampleRate = asbd->mSampleRate; + newASBD.mChannelsPerFrame = asbd->mChannelsPerFrame; + newASBD.mReserved = asbd->mReserved; + + ISFAudioBufferList *tmpABL = [ISFAudioBufferList createCopyFromAudioBufferList:audioBufferList description:newASBD]; + if (tmpABL != nil) { + [_delegate audioSource:self receivedAudioBufferList:tmpABL]; + } + } + + if (audioBufferList != NULL) { + free(audioBufferList); + } + + if (blockBuffer != NULL) { + CFRelease(blockBuffer); + } +} +- (void) setPropDelegate:(id)n { + OSSpinLockLock(&propLock); + propDelegate = n; + OSSpinLockUnlock(&propLock); +} + +@end diff --git a/ISF Editor/ISFAudioBufferList.h b/ISF Editor/ISFAudioBufferList.h new file mode 100644 index 00000000..4fe06c1b --- /dev/null +++ b/ISF Editor/ISFAudioBufferList.h @@ -0,0 +1,61 @@ +#import +#import +#import +#import +#import +#import + + + +/* + + This is a simple wrapper for an audio buffer list object + + You can either create one that references a pre-allocated buffer, + or it can be used to make a copy from an existing audio buffer list + +*/ + + + +@interface ISFAudioBufferList : NSObject { + + BOOL deleted; + + pthread_mutex_t _lock; + AudioBufferList *audioBufferList; + UInt32 numberOfSamplesPerChannel; + AudioStreamBasicDescription audioStreamBasicDescription; + + UInt32 numberOfFrames; + UInt32 numberOfChannels; + + BOOL isCopy; + +} + ++ (id) createBufferListFromArray:(NSArray *)buffers; +- (id) initBufferListFromArray:(NSArray *)buffers; + ++ (id) createWithAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d; +- (id) initWithAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d; + ++ (id) createCopyFromAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d; +- (id) initCopyFromAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d; + +- (void) generalInit; +- (void) prepareToBeDeleted; + +- (void) _setAudioBufferList:(AudioBufferList *)n; +- (void) _copyAudioBufferList:(AudioBufferList *)n; +- (void) _copyAudioBufferListFromArray:(NSArray *)buffers; +- (void) _deallocateBuffer; + +// methods for getting at the data +- (AudioBufferList *) audioBufferList; +- (AudioStreamBasicDescription) audioStreamBasicDescription; +- (UInt32) numberOfFrames; +- (UInt32) numberOfChannels; +- (BOOL) interleaved; + +@end diff --git a/ISF Editor/ISFAudioBufferList.m b/ISF Editor/ISFAudioBufferList.m new file mode 100644 index 00000000..4084cee8 --- /dev/null +++ b/ISF Editor/ISFAudioBufferList.m @@ -0,0 +1,334 @@ +// +// ISFAudioBufferList.m +// ISF Syphon Filter Tester +// +// Created by David Lublin on 8/17/16. +// Copyright © 2016 zoidberg. All rights reserved. +// + +#import "ISFAudioBufferList.h" + +@implementation ISFAudioBufferList + + +/*===================================================================================*/ +#pragma mark --------------------- Init / Dealloc +/*------------------------------------*/ + + ++ (id) createBufferListFromArray:(NSArray *)buffers { + ISFAudioBufferList *returnMe = [[ISFAudioBufferList alloc] initBufferListFromArray:buffers]; + + if (returnMe) + [returnMe autorelease]; + + return returnMe; +} +- (id) initBufferListFromArray:(NSArray *)buffers { + if (buffers==nil) + goto BAIL; + + if (self = [super init]) { + [self generalInit]; + [self _copyAudioBufferListFromArray:buffers]; + return self; + } +BAIL: + if (self != nil) + [self release]; + return nil; +} ++ (id) createWithAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d { + ISFAudioBufferList *returnMe = [[ISFAudioBufferList alloc] initWithAudioBufferList:n description:d]; + + if (returnMe != nil) + [returnMe autorelease]; + + return returnMe; +} +- (id) initWithAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d { + if (n==nil) + goto BAIL; + + if (self = [super init]) { + [self generalInit]; + audioStreamBasicDescription = d; + [self _setAudioBufferList:n]; + return self; + } +BAIL: + if (self != nil) + [self release]; + return nil; +} ++ (id) createCopyFromAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d { + ISFAudioBufferList *returnMe = [[ISFAudioBufferList alloc] initCopyFromAudioBufferList:n description:d]; + + if (returnMe != nil) + [returnMe autorelease]; + + return returnMe; +} +- (id) initCopyFromAudioBufferList:(AudioBufferList *)n description:(AudioStreamBasicDescription)d { + if (n==nil) + goto BAIL; + + if (self = [super init]) { + [self generalInit]; + audioStreamBasicDescription = d; + [self _copyAudioBufferList:n]; + return self; + } +BAIL: + if (self != nil) + [self release]; + return nil; +} +- (void) generalInit { + deleted = NO; + + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_lock, &attr); + pthread_mutexattr_destroy(&attr); + + audioBufferList = NULL; + isCopy = NO; +} +- (void) prepareToBeDeleted { + [self _deallocateBuffer]; + deleted = YES; +} +- (void) dealloc { + if (deleted == NO) + [self prepareToBeDeleted]; + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- Audio Buffer List +/*------------------------------------*/ + +- (void) _setAudioBufferList:(AudioBufferList *)n { + [self _deallocateBuffer]; + + if (n==nil) + return; + + pthread_mutex_lock(&_lock); + isCopy = NO; + audioBufferList = n; + numberOfChannels = audioStreamBasicDescription.mChannelsPerFrame; + if (audioBufferList->mNumberBuffers > 0) { + UInt32 tmpSize = audioBufferList->mBuffers[0].mDataByteSize; + UInt32 tmpChannelCount = audioBufferList->mBuffers[0].mNumberChannels; + numberOfFrames = tmpSize / (tmpChannelCount * audioStreamBasicDescription.mBitsPerChannel/8); + } + pthread_mutex_unlock(&_lock); +} +- (void) _copyAudioBufferList:(AudioBufferList *)n { + [self _deallocateBuffer]; + + if (n==nil) + return; + + // Create an copy audio buffer list with the specified duration using the layout and description as a guide + // The buffers should be sized according to the specified AudioStreamBasicDescription format + // mSampleRate, mFormatID, mFormatFlags, mBytesPerPacket, mFramesPerPacket, mBytesPerFrame, mChannelsPerFrame, mBitsPerChannel + + // Make the new bufferList based on the layout specified + // Allocate the bufferList itself + pthread_mutex_lock(&_lock); + isCopy = YES; + UInt32 propsize; + UInt32 numberOfBuffers = n->mNumberBuffers; + + // Allocate the size of a single AudioBuffer and AudioBufferList + // Compute the size of the bufferList object itself + propsize = sizeof(AudioBufferList) + numberOfBuffers * sizeof(AudioBuffer); + audioBufferList = (AudioBufferList *)malloc(propsize); + + // Set the number of buffers + audioBufferList->mNumberBuffers = numberOfBuffers; + + // Figure out how much space I need to allocate for each channel of each buffer + // In audio data a frame is one sample across all channels + // I'm going to want to buffer 1 second of audio for each channel + + UInt32 i; + UInt32 totalNumberOfChannels = 0; + UInt32 totalDataByteSize = 0; + // For each AudioBuffer in b.. + // Set the number of channels for the buffer + // Determine the needed size of the buffer data and allocate it + // The size will be the # of samples to buffer * # of channels * size of a sample + + for (i=0; imBuffers[i].mNumberChannels; + UInt32 dataByteSize = n->mBuffers[i].mDataByteSize; + + audioBufferList->mBuffers[i].mNumberChannels = buffNumberOfChannels; + audioBufferList->mBuffers[i].mDataByteSize = dataByteSize; + + if (dataByteSize > 0) { + //NSLog(@"\t\tabout to allocate %ld bytes for mbuffer %d",(long)dataByteSize,i); + audioBufferList->mBuffers[i].mData = malloc(dataByteSize); + bzero(audioBufferList->mBuffers[i].mData,dataByteSize); + + memcpy(audioBufferList->mBuffers[i].mData, + n->mBuffers[i].mData, + dataByteSize); + } + else { + audioBufferList->mBuffers[i].mData = NULL; + audioBufferList->mBuffers[i].mDataByteSize = 0; + } + + totalNumberOfChannels = totalNumberOfChannels + buffNumberOfChannels; + totalDataByteSize = totalDataByteSize + dataByteSize; + //NSLog(@"\t\tfound bufferList with size %ld for %ld channels", dataByteSize, numberOfChannels); + } + numberOfChannels = totalNumberOfChannels; + if (totalNumberOfChannels > 0) + numberOfFrames = totalDataByteSize / (totalNumberOfChannels * audioStreamBasicDescription.mBitsPerChannel / 8); + else + numberOfFrames = 0; + + pthread_mutex_unlock(&_lock); + + //NSLog(@"\t\tnumber of frames: %d",numberOfFrames); +} +- (void) _copyAudioBufferListFromArray:(NSArray *)buffers { + // deallocate the old buffer if needed + [self _deallocateBuffer]; + if (buffers == nil) + return; + if ([buffers count] == 0) + return; + + // use the first buffer as our guide for how things are laid out + ISFAudioBufferList *firstBuffer = [buffers objectAtIndex:0]; + audioStreamBasicDescription = [firstBuffer audioStreamBasicDescription]; + + // figure out what the audio buffer layout is going to look like so we can allocate the right size + isCopy = YES; + UInt32 propsize; + UInt32 totalNumberOfChannels = audioStreamBasicDescription.mChannelsPerFrame; + UInt32 numberOfBuffers = 1; + int i = 0; + + // if it is non-interleaved + if (audioStreamBasicDescription.mFormatFlags & kAudioFormatFlagIsNonInterleaved) { + numberOfBuffers = audioStreamBasicDescription.mChannelsPerFrame; + } + + // run through all the buffers to figure out how much space we need to allocate, etc + // also make sure all the buffers have matching descriptions (sample rate, bit rate, channel count, etc) + NSInteger newBufferByteSize = 0; + NSInteger sampleOffset = 0; + NSInteger newFrameCount = 0; + + for (ISFAudioBufferList *abl in buffers) { + newFrameCount += [abl numberOfFrames]; + } + + // From this point on, lock because we're actually messing with the audiobufferlist + pthread_mutex_lock(&_lock); + // unlike the case where we make a straight copy, we need to do this in two steps + // + // first allocate the bufferlist and its mbuffers + // second iterate through the incoming buffers to copy their data per buffer + propsize = sizeof(AudioBufferList) + numberOfBuffers * sizeof(AudioBuffer); + audioBufferList = (AudioBufferList *)malloc(propsize); + audioBufferList->mNumberBuffers = numberOfBuffers; + + for (i = 0; i < numberOfBuffers; ++i) { + audioBufferList->mBuffers[i].mNumberChannels = totalNumberOfChannels; + if (audioStreamBasicDescription.mFormatFlags & kAudioFormatFlagIsNonInterleaved) + audioBufferList->mBuffers[i].mNumberChannels = 1; + // note that mBitsPerChannel is also known as number of bits per sample! + // when dealing with interleaved data, each mBuffer can in theory hold a different number of channels + newBufferByteSize = audioBufferList->mBuffers[i].mNumberChannels * newFrameCount * audioStreamBasicDescription.mBitsPerChannel/8; + //NSLog(@"\t\tabout to allocate %ld bytes for mbuffer %d",(long)newBufferByteSize,i); + audioBufferList->mBuffers[i].mDataByteSize = (UInt32)newBufferByteSize; + if (newBufferByteSize>0) { + audioBufferList->mBuffers[i].mData = malloc(newBufferByteSize); + bzero(audioBufferList->mBuffers[i].mData,newBufferByteSize); + } + else { + audioBufferList->mBuffers[i].mData = NULL; + } + } + + // run through all the buffers and write into the new buffer + UInt32 totalDataByteSize = 0; + for (ISFAudioBufferList *abl in buffers) { + // write to the current offset and then advance + // do this for each mbuffer! + AudioBufferList *n = [abl audioBufferList]; + int ablBufferCount = n->mNumberBuffers; + if (ablBufferCount == numberOfBuffers) { + for (i = 0; i < numberOfBuffers; ++i) { + UInt32 buffNumberOfChannels = n->mBuffers[i].mNumberChannels; + UInt32 dataByteSize = n->mBuffers[i].mDataByteSize; + long dataByteOffset = sampleOffset * buffNumberOfChannels * audioStreamBasicDescription.mBitsPerChannel/8; + + audioBufferList->mBuffers[i].mNumberChannels = buffNumberOfChannels; + audioBufferList->mBuffers[i].mDataByteSize = dataByteSize; + + if (dataByteSize > 0) { + totalDataByteSize += dataByteSize; + memcpy(audioBufferList->mBuffers[i].mData+dataByteOffset, + n->mBuffers[i].mData, + dataByteSize); + } + } + sampleOffset += [abl numberOfFrames]; + } + } + numberOfChannels = totalNumberOfChannels; + if (totalNumberOfChannels > 0) + numberOfFrames = totalDataByteSize / (totalNumberOfChannels * audioStreamBasicDescription.mBitsPerChannel / 8); + else + numberOfFrames = 0; + pthread_mutex_unlock(&_lock); +} +- (void) _deallocateBuffer { + pthread_mutex_lock(&_lock); + // if this buffer is a copy I need to actually free it + // either way make sure to get rid of the reference pointer! + if ((audioBufferList != NULL) && (isCopy)) { + //NSLog(@"\t\tdeallocating buffer copy %d",audioBufferList->mBuffers[0].mDataByteSize); + int i; + for (i = 0;imNumberBuffers;++i) { + if ((audioBufferList->mBuffers[i].mData != NULL) && (audioBufferList->mBuffers[i].mDataByteSize > 0)) { + free(audioBufferList->mBuffers[i].mData); + //NSLog(@"\t\tdeallocating buffer copy %d:%d",i,audioBufferList->mBuffers[i].mDataByteSize); + } + } + free(audioBufferList); + } + audioBufferList = NULL; + pthread_mutex_unlock(&_lock); +} +- (AudioBufferList *) audioBufferList { + return audioBufferList; +} +- (AudioStreamBasicDescription) audioStreamBasicDescription { + return audioStreamBasicDescription; +} +- (UInt32) numberOfFrames { + return numberOfFrames; +} +- (UInt32) numberOfChannels { + return numberOfChannels; +} +- (BOOL) interleaved { + if (audioStreamBasicDescription.mFormatFlags & kAudioFormatFlagIsNonInterleaved) { + return NO; + } + return YES; +} +@end diff --git a/ISF Editor/ISFAudioFFT.h b/ISF Editor/ISFAudioFFT.h new file mode 100644 index 00000000..6f0231db --- /dev/null +++ b/ISF Editor/ISFAudioFFT.h @@ -0,0 +1,38 @@ +#import +#import +#import +#import "ISFAudioBufferList.h" +#import "ISFAudioFFTResults.h" + + + + + + +@interface ISFAudioFFT : NSObject { + + FFTSetup fftSetup; + UInt32 log2n; + + pthread_mutex_t _lock; + + BOOL deleted; + +} + +- (void) prepareToBeDeleted; + +// Performs a fwd FFT on the data in the audio buffer and returns a set of real and img data points +// returns an array of ISFAudioFFTResults, one per channel from the incoming audio buffer +- (NSArray *) processAudioBufferWithFFT:(ISFAudioBufferList *)b; + +// Set the quality level +- (void) _setLog2n:(UInt32)val; + +// vDSP_create_fftsetup +- (void) _prepareFFTSetup; + +// vDSP_destroy_fftsetup +- (void) _destroyFFTSetup; + +@end diff --git a/ISF Editor/ISFAudioFFT.m b/ISF Editor/ISFAudioFFT.m new file mode 100644 index 00000000..7339c0e4 --- /dev/null +++ b/ISF Editor/ISFAudioFFT.m @@ -0,0 +1,186 @@ +// +// ISFAudioFFT.m +// ISF Syphon Filter Tester +// +// Created by David Lublin on 8/17/16. +// Copyright © 2016 zoidberg. All rights reserved. +// + +#import "ISFAudioFFT.h" + +@implementation ISFAudioFFT + +- (id) init { + if (self=[super init]) { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_lock, &attr); + pthread_mutexattr_destroy(&attr); + + fftSetup = NULL; + log2n = 1; + deleted = NO; + return self; + } + if (self != nil) + [self release]; + return nil; +} + +- (void) prepareToBeDeleted { + deleted = YES; +} + +- (void) dealloc { + [self _destroyFFTSetup]; + pthread_mutex_destroy(&_lock); + [super dealloc]; +} +// Performs a fwd FFT on the data in the audio buffer and returns a set of real and img data points +// note that this DSPComplex must be freed when finished using it!!! +- (NSArray *) processAudioBufferWithFFT:(ISFAudioBufferList *)b { + if (deleted) + return nil; + //NSLog(@"%s",__func__); + NSMutableArray *returnMe = [NSMutableArray arrayWithCapacity:0]; + + if (b == nil) + goto BAIL; + + if ([b numberOfFrames]==0) + goto BAIL; + + // how many frames does b have? + // we may need to _setLog2n and update the fftsetup + UInt32 numberOfFrames = [b numberOfFrames]; + UInt32 logVal = log2(numberOfFrames); + + // add one to this + [self _setLog2n:logVal+1]; + + // Determine the dimensions + //long numberOfChannels = [b numberOfChannels]; + //NSLog(@"\t\tnumberOfFrames: %d",numberOfFrames); + UInt32 numberOfFramesToProcess = pow(2,log2n); + + // Get the actual AudioBufferList from the buffer object + AudioBufferList *abl = [b audioBufferList]; + // Figure out the number of buffers we need to iterate over (if it is non-interleaved or something like a MOTU device) + UInt32 numberOfBuffers = abl->mNumberBuffers; + AudioStreamBasicDescription audioStreamBasicDescription = [b audioStreamBasicDescription]; + + pthread_mutex_lock(&_lock); + if (fftSetup==NULL) { + [self _prepareFFTSetup]; + } + //NSLog(@"\t\tnumberOfFramesToProcess: %d",numberOfFramesToProcess); + + if (numberOfFrames) { + // Do this for each buffer in the audio buffer list + for (int buffNumber = 0;buffNumbermBuffers[buffNumber].mData; + int buffChannelCount = abl->mBuffers[buffNumber].mNumberChannels; + + // Each buffer may have multiple channels if it is interleaved + for (int channelNumber = 0;channelNumbermBuffers[buffNumber].mData + channelNumber; + long i; + // Set the values of the data being passed into the FFT + // Our real values are the audio samples and we ignore the imaginary values + //NSLog(@"\t\tnumber of samples: %ld",numberOfFrames); + if (bufferData != nil) { + for(i=0;i14) + log2n=14; +} + +// vDSP_create_fftsetup +- (void) _prepareFFTSetup { + //NSLog(@"%s",__func__); + if (deleted) + return; + + pthread_mutex_lock(&_lock); + if (fftSetup!=NULL) + vDSP_destroy_fftsetup(fftSetup); + + fftSetup = NULL; + + fftSetup = vDSP_create_fftsetup(log2n,kFFTRadix2); + pthread_mutex_unlock(&_lock); + +} + +// vDSP_destroy_fftsetup +- (void) _destroyFFTSetup { + + pthread_mutex_lock(&_lock); + if (fftSetup!=NULL) + vDSP_destroy_fftsetup(fftSetup); + + fftSetup = NULL; + pthread_mutex_unlock(&_lock); + +} + +@end diff --git a/ISF Editor/ISFAudioFFTResults.h b/ISF Editor/ISFAudioFFTResults.h new file mode 100644 index 00000000..e7ec1065 --- /dev/null +++ b/ISF Editor/ISFAudioFFTResults.h @@ -0,0 +1,44 @@ +#import +#import +#import +#import + + + + +extern CMMemoryPoolRef _ISFAudioFFTResultsPool; +extern CFAllocatorRef _ISFAudioFFTResultsPoolAllocator; +extern OSSpinLock _ISFAudioFFTResultsPoolLock; + + + + + +@interface ISFAudioFFTResults : NSObject { + + DSPSplitComplex results; // The raw DSPSplitComplex return from a VDSP fft_zrop + UInt32 resultsCount; // The number of result values + // - note that the second half of the result will likely be the first half reversed + + size_t magnitudesCount; // populated on init, the # of vals in 'magnitudes' + float *magnitudes; // populated on init- these are probably the vals you want to work with. + + AudioStreamBasicDescription audioStreamBasicDescription; + +} + +// Creation ++ (id) createWithResults:(DSPSplitComplex)r count:(UInt32)c streamDescription:(AudioStreamBasicDescription)asbd; +- (id) initWithResults:(DSPSplitComplex)r count:(UInt32)c streamDescription:(AudioStreamBasicDescription)asbd; + +- (NSInteger) numberOfResults; +- (void) copyMagnitudesTo:(float *)dest maxSize:(size_t)s; +- (void) copyMagnitudesTo:(float *)dest maxSize:(size_t)s stride:(int)str; + +// the number of elements in 'magnitudes' +- (size_t) magnitudesCount; +// weak ref- use it immediately, finish using it before the object that vended it is released. +- (float *) magnitudes; + + +@end diff --git a/ISF Editor/ISFAudioFFTResults.m b/ISF Editor/ISFAudioFFTResults.m new file mode 100644 index 00000000..ad7417f4 --- /dev/null +++ b/ISF Editor/ISFAudioFFTResults.m @@ -0,0 +1,149 @@ +#import "ISFAudioFFTResults.h" + + + + +CMMemoryPoolRef _ISFAudioFFTResultsPool = NULL; +CFAllocatorRef _ISFAudioFFTResultsPoolAllocator = NULL; +OSSpinLock _ISFAudioFFTResultsPoolLock = OS_SPINLOCK_INIT; + + + +@interface ISFAudioFFTResults () +- (void) calculateNormalizedMagnitudesAndPeaks; +@end + + + + + +@implementation ISFAudioFFTResults + ++ (id) createWithResults:(DSPSplitComplex)r count:(UInt32)c streamDescription:(AudioStreamBasicDescription)asbd { + ISFAudioFFTResults *returnMe = [[ISFAudioFFTResults alloc] initWithResults:r count:c streamDescription:asbd]; + if (returnMe) + [returnMe autorelease]; + + return returnMe; +} +- (id) initWithResults:(DSPSplitComplex)r count:(UInt32)c streamDescription:(AudioStreamBasicDescription)asbd { + if (self = [super init]) { + results.realp = r.realp; + results.imagp = r.imagp; + resultsCount = c; + magnitudesCount = 0; + magnitudes = NULL; + audioStreamBasicDescription = asbd; + + magnitudesCount = 0; + magnitudes = NULL; + + [self calculateNormalizedMagnitudesAndPeaks]; + + return self; + } + if (self != nil) + [self release]; + return nil; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + if (results.realp!=NULL) + free(results.realp); + results.realp = NULL; + if (results.imagp!=NULL) + free(results.imagp); + results.imagp = NULL; + if (magnitudes != NULL) { + //free(magnitudes); + CFAllocatorDeallocate(_ISFAudioFFTResultsPoolAllocator, magnitudes); + magnitudes = NULL; + } + + [super dealloc]; +} +- (void) copyMagnitudesTo:(float *)dest maxSize:(size_t)s { + //NSLog(@"%s",__func__); + if (dest==nil || s<1 || magnitudes==nil || magnitudesCount<1) + return; + memcpy(dest, magnitudes, fminl(sizeof(float)*magnitudesCount, s)); +} +- (void) copyMagnitudesTo:(float *)dest maxSize:(size_t)s stride:(int)str { + //NSLog(@"%s",__func__); + if (dest==nil || s<1 || magnitudes==nil || magnitudesCount<1) + return; + float *rPtr = magnitudes; + float *wPtr = dest; + for (int i=0; i0) { + *wPtr = tmpMag*log10(tmpFreq)/log(grain); + } + else { + *wPtr = tmpMag/log(grain); + } + + ++wPtr; + ++rPtr; + } + + CFAllocatorDeallocate(_ISFAudioFFTResultsPoolAllocator, rawMagnitudes); + +} +- (size_t) magnitudesCount { + return magnitudesCount; +} +- (float *) magnitudes { + return magnitudes; +} +- (NSInteger) numberOfResults { + if ((results.realp==NULL)||(results.imagp==NULL)) { + return 0; + } + UInt32 nOver2 = resultsCount/2; + return nOver2; +} + +@end diff --git a/ISF Editor/ISFController.h b/ISF Editor/ISFController.h new file mode 100644 index 00000000..c80d8c53 --- /dev/null +++ b/ISF Editor/ISFController.h @@ -0,0 +1,56 @@ +// +// ISFController.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import +#import +#import +#import "ISFUIItem.h" + + + + +@interface ISFController : NSObject { + IBOutlet id appDelegate; + IBOutlet NSScrollView *uiScrollView; + + IBOutlet NSTextField *widthField; + IBOutlet NSTextField *heightField; + NSSize renderSize; + + ISFGLScene *scene; + BOOL sceneIsFilter; + + NSString *targetFile; + + MutLockArray *itemArray; +} + +- (void) setSharedGLContext:(NSOpenGLContext *)n; + +- (IBAction) widthFieldUsed:(id)sender; +- (IBAction) heightFieldUsed:(id)sender; +- (IBAction) doubleResClicked:(id)sender; +- (IBAction) halveResClicked:(id)sender; +- (void) _pushUIToRenderingResolution; +- (void) _pushRenderingResolutionToUI; +@property (assign,readwrite) NSSize renderSize; + +- (void) loadFile:(NSString *)f; +- (VVBuffer *) renderFXOnThisBuffer:(VVBuffer *)n passDict:(NSMutableDictionary *)d; +// only used to render for recording! +- (void) renderIntoBuffer:(VVBuffer *)b atTime:(double)t; + +- (void) populateUI; + +- (void) passNormalizedMouseClickToPoints:(NSPoint)p; + +- (ISFGLScene *) scene; +- (NSString *) targetFile; +- (void) reloadTargetFile; + +@end diff --git a/ISF Editor/ISFController.m b/ISF Editor/ISFController.m new file mode 100644 index 00000000..4fa18d4a --- /dev/null +++ b/ISF Editor/ISFController.m @@ -0,0 +1,378 @@ +// +// ISFController.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import "ISFController.h" +#import "VVKQueueCenter.h" +#import "ISFEditorAppDelegate.h" + + + + +#define ISFITEMHEIGHT 50 +#define ISFITEMSPACE 10 + + + + +@implementation ISFController + + +- (id) init { + //NSLog(@"%s",__func__); + if (self = [super init]) { + scene = nil; + targetFile = nil; + itemArray = [[MutLockArray alloc] init]; + return self; + } + [self release]; + return nil; +} +- (void) awakeFromNib { + [self setRenderSize:NSMakeSize(640,360)]; + [self _pushRenderingResolutionToUI]; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + VVRELEASE(scene); + VVRELEASE(targetFile); + VVRELEASE(itemArray); + [VVKQueueCenter removeObserver:self]; + [super dealloc]; +} +- (void) setSharedGLContext:(NSOpenGLContext *)n { + //NSLog(@"%s",__func__); + if (n==nil) + return; + @synchronized (self) { + VVRELEASE(scene); + scene = [[ISFGLScene alloc] initWithSharedContext:n pixelFormat:[GLScene defaultPixelFormat] sized:NSMakeSize(320,240)]; + [scene setThrowExceptions:YES]; + } +} + + +- (IBAction) widthFieldUsed:(id)sender { + NSString *tmpString = [widthField stringValue]; + NSNumber *tmpNum = (tmpString==nil) ? nil : [tmpString numberByEvaluatingString]; + if (tmpNum==nil) + return; + NSSize tmpSize = [self renderSize]; + tmpSize.width = [tmpNum intValue]; + [self setRenderSize:tmpSize]; + [self _pushUIToRenderingResolution]; +} +- (IBAction) heightFieldUsed:(id)sender { + NSString *tmpString = [heightField stringValue]; + NSNumber *tmpNum = (tmpString==nil) ? nil : [tmpString numberByEvaluatingString]; + if (tmpNum==nil) + return; + NSSize tmpSize = [self renderSize]; + tmpSize.height = [tmpNum intValue]; + [self setRenderSize:tmpSize]; + [self _pushUIToRenderingResolution]; +} +- (IBAction) doubleResClicked:(id)sender { + NSSize tmpSize = [self renderSize]; + tmpSize = NSMakeSize(ceil(tmpSize.width*2.0), ceil(tmpSize.height*2.0)); + [self setRenderSize:tmpSize]; + [self _pushRenderingResolutionToUI]; +} +- (IBAction) halveResClicked:(id)sender { + NSSize tmpSize = [self renderSize]; + tmpSize = NSMakeSize(ceil(tmpSize.width/2.0), ceil(tmpSize.height/2.0)); + [self setRenderSize:tmpSize]; + [self _pushRenderingResolutionToUI]; +} +- (void) _pushUIToRenderingResolution { + NSString *tmpString = nil; + uint32_t tmpInt = 0; + NSSize newSize; + tmpString = [widthField stringValue]; + tmpInt = (tmpString==nil || [tmpString numberByEvaluatingString]==nil) ? 640 : [[tmpString numberByEvaluatingString] intValue]; + newSize.width = tmpInt; + + tmpString = [heightField stringValue]; + tmpInt = (tmpString==nil || [tmpString numberByEvaluatingString]==nil) ? 360 : [[tmpString numberByEvaluatingString] intValue]; + newSize.height = tmpInt; + + [self setRenderSize:newSize]; +} +- (void) _pushRenderingResolutionToUI { + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self _pushRenderingResolutionToUI]; + return; + }); + return; + } + NSSize tmpSize = [self renderSize]; + [widthField setStringValue:VVFMTSTRING(@"%d",(int)tmpSize.width)]; + [heightField setStringValue:VVFMTSTRING(@"%d",(int)tmpSize.height)]; +} +@synthesize renderSize; + + +- (void) loadFile:(NSString *)f { + //NSLog(@"%s ... %@",__func__,f); + if (f != nil) { + VVRELEASE(targetFile); + targetFile = [f retain]; + } + + NSFileManager *fm = [NSFileManager defaultManager]; + // if the passed file doesn't exist, just bail immediately + if (![fm fileExistsAtPath:f]) + return; + [VVKQueueCenter removeObserver:self]; + [VVKQueueCenter addObserver:self forPath:f]; + NSString *vertShaderName = [[f stringByDeletingPathExtension] stringByAppendingPathExtension:@"vs"]; + if (![fm fileExistsAtPath:vertShaderName]) { + vertShaderName = [[f stringByDeletingPathExtension] stringByAppendingPathExtension:@"vert"]; + if ([fm fileExistsAtPath:vertShaderName]) + [VVKQueueCenter addObserver:self forPath:vertShaderName]; + } + + + @try { + // i only want to fetch the shaders if the file isn't nil! + [appDelegate setFetchShaders:(f==nil)?NO:YES]; + //if (f==nil) + // NSLog(@"\t\tfetchShaders is NO in %s",__func__); + //else + // NSLog(@"\t\tfetchShaders is YES in %s",__func__); + + [scene _renderLock]; + sceneIsFilter = [ISFFileManager _isAFilter:f]; + [scene useFile:f]; + } + @catch (NSException *err) { + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *tmpString = [err reason]; + VVRunAlertPanel([err name],tmpString,@"Oh snap!",nil,nil); + }); + } + [scene _renderUnlock]; + [self populateUI]; + [appDelegate _isfFileReloaded]; +} +- (void) file:(NSString *)p changed:(u_int)fflag { + //NSLog(@"%s ... %@",__func__,p); + + NSString *tmpPath = p; + //NSLog(@"\t\ttmpPath is %@",tmpPath); + if (tmpPath != nil) { + [tmpPath retain]; + //[self loadFile:p]; + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *newPath = [[tmpPath stringByDeletingPathExtension] stringByAppendingPathExtension:@"fs"]; + [self loadFile:newPath]; + }); + [tmpPath release]; + tmpPath = nil; + } +} +- (VVBuffer *) renderFXOnThisBuffer:(VVBuffer *)n passDict:(NSMutableDictionary *)d { + if (n==nil) + return nil; + + if ([scene filePath]==nil) + return nil; + // apply the passed buffer to the scene as "inputImage" + //[scene setFilterInputImageBuffer:n]; + [scene setBuffer:n forInputImageKey:@"inputImage"]; + // run through the inputs, getting their values and pushing them to the scene + [itemArray rdlock]; + for (ISFUIItem *itemPtr in [itemArray array]) { + id tmpVal = [itemPtr getNSObjectValue]; + if (tmpVal != nil) { + //NSLog(@"\t\t%@ - %@",[itemPtr name],tmpVal); + [scene setNSObjectVal:tmpVal forInputKey:[itemPtr name]]; + } + } + [itemArray unlock]; + + VVBuffer *returnMe = nil; + + returnMe = [scene + allocAndRenderToBufferSized:((sceneIsFilter) ? [n srcRect].size : [self renderSize]) + prefer2DTex:NO + passDict:d]; + //returnMe = [scene allocAndRenderToBufferSized:[n srcRect].size prefer2DTex:NO passDict:d]; + + return returnMe; +} +// only used to render for recording +- (void) renderIntoBuffer:(VVBuffer *)b atTime:(double)t { + if (b==nil) + return; + if ([scene filePath]==nil) + return; + // run through the inputs, getting their values and pushing them to the scene + [itemArray rdlock]; + for (ISFUIItem *itemPtr in [itemArray array]) { + id tmpVal = [itemPtr getNSObjectValue]; + if (tmpVal != nil) { + //NSLog(@"\t\t%@ - %@",[itemPtr name],tmpVal); + [scene setNSObjectVal:tmpVal forInputKey:[itemPtr name]]; + } + } + [itemArray unlock]; + + [scene renderToBuffer:b sized:[b srcRect].size renderTime:t passDict:nil]; +} + + +- (void) populateUI { + //NSLog(@"%s",__func__); + [itemArray wrlock]; + for (ISFUIItem *itemPtr in [itemArray array]) { + [itemPtr removeFromSuperview]; + } + [itemArray removeAllObjects]; + [itemArray unlock]; + + if (scene==nil || [scene filePath]==nil) { + //NSLog(@"\t\tbailing, scene hasn't loaded a file, %s",__func__); + return; + } + + NSSize newDocViewSize = [self calculateDocViewSize]; + NSView *dv = [uiScrollView documentView]; + //NSRect docVisRect = [uiScrollView documentVisibleRect]; + + MutLockArray *sceneInputs = [scene inputs]; + if (sceneInputs!=nil) { + // resize the doc view to hold everything + //[dv setFrame:NSMakeRect(0, 0, docVisRect.size.width, (ISFITEMHEIGHT+ISFITEMSPACE)*[sceneInputs count])]; + [dv setFrame:NSMakeRect(0, 0, newDocViewSize.width, newDocViewSize.height)]; + //docVisRect = [uiScrollView documentVisibleRect]; + + // set the size of the temp rect used to create UI items + NSRect tmpRect; + tmpRect.size.width = [dv frame].size.width; + tmpRect.size.height = ISFITEMHEIGHT; + tmpRect.origin.x = 0.0; + //tmpRect.origin.y = VVMAXY([dv frame]) - tmpRect.size.height - ISFITEMSPACE; + tmpRect.origin.y = 0; + + [sceneInputs rdlock]; + NSEnumerator *it = [[sceneInputs array] reverseObjectEnumerator]; + ISFAttrib *attrib = nil; + while (attrib = [it nextObject]) { + //NSLog(@"\t\tinput %@",[attrib attribName]); + ISFAttribValType attribType = [attrib attribType]; + ISFUIItem *newElement = nil; + switch (attribType) { + case ISFAT_Event: + case ISFAT_Bool: + case ISFAT_Long: + case ISFAT_Float: + case ISFAT_Color: + case ISFAT_Image: + case ISFAT_Audio: + case ISFAT_AudioFFT: + if (![attrib isFilterInputImage]) { + tmpRect.size.height = ISFITEMHEIGHT; + newElement = [[ISFUIItem alloc] initWithFrame:tmpRect attrib:attrib]; + [dv addSubview:newElement]; + [itemArray lockAddObject:newElement]; + [newElement release]; + tmpRect.origin.y += (tmpRect.size.height + ISFITEMSPACE); + } + break; + case ISFAT_Point2D: + //tmpRect.size.height = 2.*ISFITEMHEIGHT; + tmpRect.size.height = ISFITEMHEIGHT; + newElement = [[ISFUIItem alloc] initWithFrame:tmpRect attrib:attrib]; + [dv addSubview:newElement]; + [itemArray lockAddObject:newElement]; + [newElement release]; + tmpRect.origin.y += (tmpRect.size.height + ISFITEMSPACE); + break; + case ISFAT_Cube: + NSLog(@"\t\tskipping creation of UI item for cube input %@",attrib); + break; + } + } + [sceneInputs unlock]; + } +} +- (NSSize) calculateDocViewSize { + NSSize returnMe = NSMakeSize([uiScrollView documentVisibleRect].size.width, 0); + MutLockArray *sceneInputs = [scene inputs]; + if (sceneInputs!=nil) { + [sceneInputs rdlock]; + for (ISFAttrib *attrib in [sceneInputs array]) { + ISFAttribValType attribType = [attrib attribType]; + switch (attribType) { + case ISFAT_Event: + case ISFAT_Bool: + case ISFAT_Long: + case ISFAT_Float: + case ISFAT_Color: + case ISFAT_Image: + case ISFAT_Audio: + case ISFAT_AudioFFT: + returnMe.height += (ISFITEMHEIGHT + ISFITEMSPACE); + break; + case ISFAT_Point2D: + //returnMe.height += ((2. * ISFITEMHEIGHT) + ISFITEMSPACE); + returnMe.height += (ISFITEMHEIGHT + ISFITEMSPACE); + break; + case ISFAT_Cube: + break; + } + } + [sceneInputs unlock]; + } + return returnMe; +} + + +- (void) passNormalizedMouseClickToPoints:(NSPoint)p { + //NSLog(@"%s ... (%0.2f, %0.2f)",__func__,p.x,p.y); + NSMutableArray *points = [scene inputsOfType:ISFAT_Point2D]; + for (ISFAttrib *attrib in points) { + NSString *attribName = [attrib attribName]; + ISFAttribVal minVal = [attrib minVal]; + ISFAttribVal maxVal = [attrib maxVal]; + NSPoint tmpPoint; + if (minVal.point2DVal[0]==maxVal.point2DVal[0] && minVal.point2DVal[1]==maxVal.point2DVal[1]) { + NSSize lastRenderSize = [scene renderSize]; + tmpPoint = NSMakePoint(p.x*lastRenderSize.width, p.y*lastRenderSize.height); + } + else + tmpPoint = NSMakePoint(p.x*(maxVal.point2DVal[0]-minVal.point2DVal[0])+minVal.point2DVal[0], p.y*(maxVal.point2DVal[1]-minVal.point2DVal[1])+minVal.point2DVal[1]); + //NSLog(@"\t\tpassing point (%0.2f, %0.2f) to attrib %@",tmpPoint.x,tmpPoint.y,attrib); + [itemArray rdlock]; + for (ISFUIItem *itemPtr in [itemArray array]) { + if ([[itemPtr name] isEqualToString:attribName]) { + [itemPtr setNSObjectValue:[NSValue valueWithPoint:tmpPoint]]; + break; + } + } + [itemArray unlock]; + } +} + + +- (ISFGLScene *) scene { + return scene; +} +- (NSString *) targetFile { + return targetFile; +} +- (void) reloadTargetFile { + if (targetFile==nil) + return; + [self loadFile:[[targetFile copy] autorelease]]; +} + + +@end diff --git a/ISF Editor/ISFConverter.h b/ISF Editor/ISFConverter.h new file mode 100644 index 00000000..9d133a92 --- /dev/null +++ b/ISF Editor/ISFConverter.h @@ -0,0 +1,37 @@ +#import +#import +#import +#import "RegexKitLite.h" +//#import + + + + +@interface ISFConverter : NSObject { + IBOutlet id appDelegate; + IBOutlet NSWindow *mainWindow; + + IBOutlet NSWindow *glslWindow; + IBOutlet NSTextField *glslURLField; + + IBOutlet NSWindow *shadertoyWindow; + IBOutlet NSTextField *shadertoyURLField; +} + +- (void) openGLSLSheet; +- (void) closeGLSLSheet; +- (void) openShadertoySheet; +- (void) closeShadertoySheet; + +- (IBAction) glslCancelClicked:(id)sender; +- (IBAction) glslOKClicked:(id)sender; +- (IBAction) glslTextFieldUsed:(id)sender; + +- (IBAction) shadertoyCancelClicked:(id)sender; +- (IBAction) shadertoyOKClicked:(id)sender; +- (IBAction) shadertoyTextFieldUsed:(id)sender; + +- (NSString *) _convertGLSLSandboxString:(NSString *)rawFragString supplementalJSONDictEntries:(NSDictionary *)suppEntries; +- (NSString *) _converShaderToySourceArray:(NSArray *)rawFragStrings supplementalJSONDictEntries:(NSMutableDictionary *)suppEntries varSwapNameDicts:(NSArray *)varSwapNameDicts; + +@end diff --git a/ISF Editor/ISFConverter.m b/ISF Editor/ISFConverter.m new file mode 100644 index 00000000..55cf0a7e --- /dev/null +++ b/ISF Editor/ISFConverter.m @@ -0,0 +1,1489 @@ +#import "ISFConverter.h" +#import "ISFEditorAppDelegate.h" + + + + +@implementation ISFConverter + + +#pragma mark - +#pragma mark open and close sheet stuff + + +- (void) openGLSLSheet { + [mainWindow + beginSheet:glslWindow + completionHandler:^(NSInteger result) { + + }]; +} +- (void) closeGLSLSheet { + [mainWindow endSheet:glslWindow]; +} +- (void) openShadertoySheet { + [mainWindow + beginSheet:shadertoyWindow + completionHandler:^(NSInteger result) { + + }]; +} +- (void) closeShadertoySheet { + [mainWindow endSheet:shadertoyWindow]; +} + + +#pragma mark - +#pragma mark GLSL Sandbox UI item methods + + +- (IBAction) glslCancelClicked:(id)sender { + NSLog(@"%s",__func__); + [self closeGLSLSheet]; +} +- (IBAction) glslOKClicked:(id)sender { + NSLog(@"%s",__func__); + + // parse the URL, assemble the URL of the raw file containing the shader source i need to download + NSString *rawURLString = [glslURLField stringValue]; + //NSLog(@"\t\tWARNING: rawURLString is hard-coded in %s",__func__); + //NSString *rawURLString = @"http://glslsandbox.com/e#23546.2"; + NSArray *rawURLComponents = [rawURLString componentsSeparatedByString:@"e#"]; + if (rawURLComponents==nil || [rawURLComponents count]!=2) { + NSLog(@"\t\terr, couldn't parse user-supplied URL"); + NSLog(@"\t\tURL was %@, components were %@",rawURLString,rawURLComponents); + return; + } + NSString *shaderIDString = [rawURLComponents objectAtIndex:1]; + NSString *sourceBlobURL = VVFMTSTRING(@"glslsandbox.com/item/%@",shaderIDString); + + // download the shader source, parse the reply, extract the shader source from it + VVCURLDL *sourceBlobDownloader = [VVCURLDL createWithAddress:sourceBlobURL]; + //NSLog(@"\t\tbeginning source blob download..."); + [sourceBlobDownloader perform]; + //NSLog(@"\t\tsource blob download complete"); + NSDictionary *parsedDownload = [[sourceBlobDownloader responseString] objectFromJSONString]; + NSString *rawShaderSource = [parsedDownload objectForKey:@"code"]; + if (rawShaderSource==nil) { + NSLog(@"\t\terr: couldn't locate raw shader source in parsed reply"); + NSLog(@"\t\tparsed download is %@",parsedDownload); + NSLog(@"\t\tresponseString was %@",[sourceBlobDownloader responseString]); + return; + } + NSLog(@"\t\tparsedDownload is %@",parsedDownload); + + // convert the shader source string, export to the user-library ISF folder + NSMutableDictionary *suppEntries = MUTDICT; + [suppEntries setObject:VVFMTSTRING(@"Automatically converted from %@",rawURLString) forKey:@"DESCRIPTION"]; + NSString *convertedShaderSource = [self _convertGLSLSandboxString:rawShaderSource supplementalJSONDictEntries:suppEntries]; + if (convertedShaderSource==nil) { + NSLog(@"\t\terr: couldn't convert shader source, bailing"); + NSLog(@"\t\trawShaderSource was %@",rawShaderSource); + return; + } + // make sure that the user-level ISF folder exists + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *isfFolder = [@"~/Library/Graphics/ISF" stringByExpandingTildeInPath]; + if (![fm fileExistsAtPath:isfFolder]) + [fm createDirectoryAtPath:isfFolder withIntermediateDirectories:YES attributes:nil error:nil]; + + NSString *writeLocation = [VVFMTSTRING(@"~/Library/Graphics/ISF/gs_%@.fs",shaderIDString) stringByExpandingTildeInPath]; + NSLog(@"\t\twriteLocation is %@",writeLocation); + NSError *nsErr = nil; + if (![convertedShaderSource writeToFile:writeLocation atomically:YES encoding:NSUTF8StringEncoding error:&nsErr]) { + NSLog(@"\t\terr: couldn't write converted shader to file %@",writeLocation); + NSLog(@"\t\tnsErr was %@",nsErr); + return; + } + + // close the sheet + [self closeGLSLSheet]; + + // tell the app to select the shader we just created + [appDelegate exportCompleteSelectFileAtPath:writeLocation]; +} +- (IBAction) glslTextFieldUsed:(id)sender { + NSLog(@"%s",__func__); + //[self glslOKClicked:sender]; +} + + +#pragma mark - +#pragma mark Shadertoy UI item methods + + +- (IBAction) shadertoyCancelClicked:(id)sender { + NSLog(@"%s",__func__); + [self closeShadertoySheet]; +} +- (IBAction) shadertoyOKClicked:(id)sender { + //NSLog(@"%s",__func__); + // parse the URL, assemble the URL of the raw file containing the shader source i need to download + //NSString *rawURLString = @"https://www.shadertoy.com/view/XslGRr"; + //NSLog(@"\t\tWARNING: rawURLString is hard-coded in %s to %@",__func__,rawURLString); + NSString *rawURLString = [shadertoyURLField stringValue]; + if (rawURLString==nil || [rawURLString length]<1) { + NSLog(@"\t\terr: bailing, rawURLString empty, %s",__func__); + return; + } + + NSString *shaderIDString = [rawURLString lastPathComponent]; + if (shaderIDString==nil || [shaderIDString length]<1) { + NSLog(@"\t\terr: bailing, shaderIDString epmty, %s",__func__); + return; + } + NSString *sourceBlobURL = @"https://www.shadertoy.com/shadertoy"; + //NSString *sourceBlobURL = VVFMTSTRING(@"https://www.shadertoy.com/api/v1/shaders/%@?key=rt8KwN",shaderIDString); + //NSLog(@"\t\tsourceBlobURL is \"%@\"",sourceBlobURL); + + + + // download the shader source, parse the reply, extract the shader source from it + VVCURLDL *sourceBlobDownloader = [VVCURLDL createWithAddress:sourceBlobURL]; + //[sourceBlobDownloader appendStringToHeader:@"Cookie: sdtd=0lqkh2g9rv9hpiiieb378ih3p6; _gat=1; _ga=GA1.2.1964087794.1443207051"]; + //[sourceBlobDownloader appendStringToHeader:@"Origin: https://www.shadertoy.com"]; + [sourceBlobDownloader setAcceptedEncoding:@"gzip, deflate"]; + [sourceBlobDownloader appendStringToHeader:@"Accept-Language: en-US,en;q=0.8"]; + //[sourceBlobDownloader setUserAgent:@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"]; + [sourceBlobDownloader appendStringToHeader:@"Content-Type: application/x-www-form-urlencoded"]; + //[sourceBlobDownloader appendStringToHeader:@"Cache-Control: max-age=0"]; + [sourceBlobDownloader setReferer:VVFMTSTRING(@"https://www.shadertoy.com/view/%@",shaderIDString)]; + //[sourceBlobDownloader appendStringToHeader:@"Connection: keep-alive"]; + NSDictionary *postDataDict = OBJDICT(OBJARRAY(shaderIDString),@"shaders"); + NSString *postDataString = (postDataDict==nil) ? nil : [[VVFMTSTRING(@"s=%@",[[postDataDict JSONString] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]) copy] autorelease]; + //NSString *postDataString = @"s=%7B%20%22shaders%22%20%3A%20%5B%22Mlj3RR%22%5D%20%7D"; + //if (postDataString==nil || [postDataString length]<1) { + // NSLog(@"\t\terr: postDataString nil in %s, bailing",__func__); + // return; + //} + //NSLog(@"\t\tpostDataString is \"%@\"",postDataString); + + //return; + + + //NSString *postDataString = @"s=%7B%20%22shaders%22%20%3A%20%5B%224df3DS%22%5D%20%7D"; + //NSLog(@"\t\tWARNING: using hard-coded postDataString, is %@",postDataString); + [sourceBlobDownloader appendStringToPOST:postDataString]; + //NSLog(@"\t\tbeginning source blob download..."); + [sourceBlobDownloader perform]; + //NSLog(@"\t\tsource blob download complete"); + NSString *responseString = [sourceBlobDownloader responseString]; + //[responseString writeToFile:[@"~/Desktop/ShaderToyLibCURLDump.txt" stringByExpandingTildeInPath] atomically:YES encoding:NSUTF8StringEncoding error:nil]; + id parsedDownload = [responseString objectFromJSONString]; + + + // uncomment the following line, the comment out the big chunk above it to use a file on disk to test with (instead of repeatedly downloading stuff) + //id parsedDownload = [[NSString stringWithContentsOfFile:[@"~/Desktop/ShaderToyLibCURLDump.txt" stringByExpandingTildeInPath] encoding:NSUTF8StringEncoding error:nil] objectFromJSONString]; + + + + + //NSLog(@"\t\tparsedDownload is %@",parsedDownload); + NSDictionary *parsedDict = nil; + if ([parsedDownload respondsToSelector:@selector(objectAtIndex:)]) + parsedDict = [parsedDownload objectAtIndex:0]; + else + parsedDict = parsedDownload; + //parsedDict = [parsedDict objectForKey:@"Shader"]; + + + //return; + + // get the array of dicts describing render passes + NSArray *renderpassArray = [parsedDict objectForKey:@"renderpass"]; + if (renderpassArray==nil || [renderpassArray count]<1) { + NSLog(@"\t\tERR: can't proceed, renderpass array in received JSON blob empty, bailing, %s",__func__); + //NSLog(@"\t\tpostDataString is %@",postDataString); + NSLog(@"\t\thttpResponseCode was %ld",[sourceBlobDownloader httpResponseCode]); + NSLog(@"\t\tcurl err was %u",[sourceBlobDownloader err]); + NSLog(@"\t\tresponseData is %@",[sourceBlobDownloader responseData]); + NSLog(@"\t\tresponseString is %@",[sourceBlobDownloader responseString]); + NSLog(@"\t\tparsedDownload was %@",parsedDownload); + return; + } + // the renderpass array from shadertoy has a weird order- the first item is the last step. the second and subsequent items are the first and subsequent steps. sort this. + NSMutableArray *sortedRenderpassArray = MUTARRAY; + if ([renderpassArray count]==1) + [sortedRenderpassArray addObject:[renderpassArray objectAtIndex:0]]; + else { + for (int i=1; i<[renderpassArray count]; ++i) + [sortedRenderpassArray addObject:[renderpassArray objectAtIndex:i]]; + [sortedRenderpassArray addObject:[renderpassArray objectAtIndex:0]]; + + // run through the sorted renderpass array, removing any passes that render to audio + NSMutableIndexSet *indexesToRemove = nil; + NSInteger tmpIndex = 0; + for (NSDictionary *renderpassDict in sortedRenderpassArray) { + NSArray *outputs = [renderpassDict objectForKey:@"outputs"]; + NSDictionary *output = (outputs==nil || ![outputs isKindOfClass:[NSArray class]]) ? nil : [outputs objectAtIndex:0]; + NSNumber *tmpNum = (output==nil || ![output isKindOfClass:[NSDictionary class]]) ? nil : [output objectForKey:@"id"]; + if (tmpNum!=nil && [tmpNum isKindOfClass:[NSNumber class]] && [tmpNum intValue]==38) { + if (indexesToRemove == nil) + indexesToRemove = [[[NSMutableIndexSet alloc] init] autorelease]; + [indexesToRemove addIndex:tmpIndex]; + } + ++tmpIndex; + } + if (indexesToRemove != nil) + [sortedRenderpassArray removeObjectsAtIndexes:indexesToRemove]; + + } + //NSLog(@"\t\trenderpassArray is %@",renderpassArray); + NSLog(@"\t\tsortedRenderpassArray is %@",sortedRenderpassArray); + + + /* + NSDictionary *renderpassDict = [sortedRenderpassArray objectAtIndex:0]; + NSString *rawShaderSource = [renderpassDict objectForKey:@"code"]; + if (rawShaderSource==nil) { + NSLog(@"\t\terr: couldn't locate raw shader source in parsed reply"); + //NSLog(@"\t\tpostDataString is %@",postDataString); + NSLog(@"\t\thttpResponseCode was %ld",[sourceBlobDownloader httpResponseCode]); + NSLog(@"\t\tcurl err was %u",[sourceBlobDownloader err]); + NSLog(@"\t\tresponseData is %@",[sourceBlobDownloader responseData]); + NSLog(@"\t\tresponseString is %@",[sourceBlobDownloader responseString]); + NSLog(@"\t\tparsed download was %@",parsedDownload); + return; + } + */ + // after the conversion is finished, i'll want to show an alert if the shader had either a mouse or a keyboard input informing the user that further conversion may be required + BOOL hasMouseOrKeyboardInput = NO; + // i'm going to need an array with all the audio inputs so i can find-and-replace them later with more appropriate names + NSMutableArray *musicInputNames = MUTARRAY; + // the first video-type channel will be renamed to "inputImage" under the assumption that this is a filter, so we need to record that... + NSString *inputImageChannelName = nil; + // assemble a dict of supplemental entries + NSMutableDictionary *suppEntries = MUTDICT; + NSDictionary *infoDict = [parsedDict objectForKey:@"info"]; + NSString *shadertoyUsername = [infoDict objectForKey:@"username"]; + if (shadertoyUsername!=nil && [shadertoyUsername length]<1) + shadertoyUsername = nil; + NSString *shadertoyDescription = [infoDict objectForKey:@"description"]; + if (shadertoyDescription==nil) { + if (shadertoyUsername!=nil) + shadertoyDescription = VVFMTSTRING(@"Automatically converted from %@ by %@",rawURLString, shadertoyUsername); + else + shadertoyDescription = VVFMTSTRING(@"Automatically converted from %@",rawURLString); + } + else { + if (shadertoyUsername!=nil) + shadertoyDescription = VVFMTSTRING(@"Automatically converted from %@ by %@. %@",rawURLString, shadertoyUsername, shadertoyDescription); + else + shadertoyDescription = VVFMTSTRING(@"Automatically converted from %@. %@",rawURLString, shadertoyDescription); + } + [suppEntries setObject:shadertoyDescription forKey:@"DESCRIPTION"]; + + NSMutableArray *categories = MUTARRAY; + [suppEntries setObject:categories forKey:@"CATEGORIES"]; + NSArray *shadertoyTags = [infoDict objectForKey:@"tags"]; + if (shadertoyTags!=nil && [shadertoyTags count]>0) + [categories addObjectsFromArray:shadertoyTags]; + [categories addObject:@"Automatically Converted"]; + [categories addObject:@"Shadertoy"]; + + NSString *shadertoyName = [infoDict objectForKey:@"name"]; + if (shadertoyName!=nil && [shadertoyName length]<1) + shadertoyName = nil; + else { + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@" " withString:@"_"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@"," withString:@"_"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@":" withString:@"-"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@"\t" withString:@"_"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@"_-_" withString:@"-"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@"_-" withString:@"-"]; + shadertoyName = [shadertoyName stringByReplacingOccurrencesOfString:@"-_" withString:@"-"]; + } + + // make a dict containing replacement keys- in shadertoy, "iChannel0" may vary from pass to pass, while ISF needs consistent names spanning passes + NSMutableArray *passVarNameSwapDicts = MUTARRAY; + // if there's more than one renderpass, make the 'passes' array (stores dicts describing passes), and add it to the supplemental entries dict + NSMutableArray *passes = nil; + if ([sortedRenderpassArray count]>1) { + passes = MUTARRAY; + [suppEntries setObject:passes forKey:@"PASSES"]; + } + + // create arrays for inputs and imports, add them to the entries dict + __block NSMutableArray *suppInputs = MUTARRAY; + [suppEntries setObject:suppInputs forKey:@"INPUTS"]; + __block NSMutableArray *suppImports = MUTARRAY; + [suppEntries setObject:suppImports forKey:@"IMPORTED"]; + + // create a block that checks to see if a given name is being used by an input + BOOL (^IsThisInputNameUnique)(NSString *baseName) = ^(NSString *baseName) { + BOOL returnMe = YES; + for (NSDictionary *suppInput in suppInputs) { + if ([[suppInput objectForKey:@"NAME"] isEqualToString:baseName]) { + returnMe = NO; + break; + } + } + return returnMe; + }; + NSString* (^UniqueNameForInput)(NSString *baseName) = ^(NSString *baseName) { + if (IsThisInputNameUnique(baseName)) + return baseName; + NSString *returnMe = nil; + do { + int tmpInt = 2; + NSString *tmpString = VVFMTSTRING(@"%@_%d",baseName,tmpInt); + if (IsThisInputNameUnique(tmpString)) + returnMe = tmpString; + ++tmpInt; + } while (returnMe == nil); + return returnMe; + }; + // create a block that checks to see if a given name is being used by an import + BOOL (^IsThisImportNameUnique)(NSString *baseName) = ^(NSString *baseName) { + //NSLog(@"IsThisImportNameUnique(%@)",baseName); + BOOL returnMe = YES; + for (NSDictionary *suppImport in suppImports) { + if ([[suppImport objectForKey:@"NAME"] isEqualToString:baseName]) { + returnMe = NO; + break; + } + } + return returnMe; + }; + NSString* (^UniqueNameForImport)(NSString *baseName) = ^(NSString *baseName) { + //NSLog(@"UniqueNameForImport(%@)",baseName); + if (IsThisImportNameUnique(baseName)) + return baseName; + NSString *returnMe = nil; + int tmpInt = 2; + do { + NSString *tmpString = VVFMTSTRING(@"%@_%d",baseName,tmpInt); + if (IsThisImportNameUnique(tmpString)) + returnMe = tmpString; + ++tmpInt; + } while (returnMe == nil); + return returnMe; + }; + // create a block that converts a buffer id number to the name of the buffer + NSString* (^NameForBufferID)(int bufferIDNum) = ^(int bufferIDNum) { + switch (bufferIDNum) { + case 257: + return @"BufferA"; + case 258: + return @"BufferB"; + case 259: + return @"BufferC"; + case 260: + return @"BufferD"; + } + return @"UnknownBufferName"; + }; + + + + + // create an array with the source code for each of the passes- we'll need this later when we're find-and-replacing source + NSMutableArray *sortedShaderSourceArray = MUTARRAY; + for (NSDictionary *renderpassDict in sortedRenderpassArray) { + NSString *rawShaderSource = [renderpassDict objectForKey:@"code"]; + if (rawShaderSource==nil) { + NSLog(@"\t\terr: couldn't locate raw shader source in parsed reply"); + return; + } + else + [sortedShaderSourceArray addObject:rawShaderSource]; + } + + + // run through the sorted array of render pass dicts- parse the inputs and outputs + NSInteger passIndex = 0; + for (NSDictionary *renderpassDict in sortedRenderpassArray) { + + // get the array of OUTPUTS for this pass- if there's more or less than one, bail with error + NSArray *renderpassOutputs = [renderpassDict objectForKey:@"outputs"]; + if (renderpassOutputs==nil || [renderpassOutputs count]!=1) { + NSLog(@"\t\terr: renderpass outputs array is of unexpected length, bailing, %s",__func__); + return; + } + // get what i'm presently assuming is the main output + NSDictionary *outputDict = [renderpassOutputs objectAtIndex:0]; + // get the id of the main output- 37 is the last step (draw to screen). 257-260 are output buffers (persistent, floating-point) + id outputNum = [outputDict objectForKey:@"id"]; + if (outputNum==nil || ![outputNum isKindOfClass:[NSNumber class]]) { + NSLog(@"\t\terr: no output id found, bailing, %s",__func__); + return; + } + + + // if there's a 'passes' array, then i need to make a pass dict and add it to the array + NSMutableDictionary *newPassDict = nil; + if (passes != nil) { + newPassDict = MUTDICT; + [passes addObject:newPassDict]; + } + + // 37 is the id of the "main output", we just want to display it to screen- we don't need to make a pass or anything + if ([outputNum intValue] == 37) { + + } + // else the output id isn't 37- we're outputting to a buffer + else { + NSString *targetBufferName = NameForBufferID([outputNum intValue]); + if (targetBufferName != nil) { + [newPassDict setObject:targetBufferName forKey:@"TARGET"]; + [newPassDict setObject:NUMBOOL(YES) forKey:@"PERSISTENT"]; + [newPassDict setObject:NUMBOOL(YES) forKey:@"FLOAT"]; + } + } + + // make a dict that we'll use to store the names we need to swap + NSMutableDictionary *passVarNameSwapDict = MUTDICT; + [passVarNameSwapDicts addObject:passVarNameSwapDict]; + + + + // get the array of INPUTS for this pass + NSArray *renderpassInputs = [renderpassDict objectForKey:@"inputs"]; + // run through the inputs + for (NSDictionary *renderpassInput in renderpassInputs) { + NSNumber *channelNum = [renderpassInput objectForKey:@"channel"]; + NSString *channelType = [renderpassInput objectForKey:@"ctype"]; + NSString *channelSrc = [[renderpassInput objectForKey:@"src"] lastPathComponent]; + NSString *channelName = VVFMTSTRING(@"iChannel%@",channelNum); + + // make sure the channel name is unique (a prior pass may have added an input or something with this name) + NSString *uniqueChannelName = nil; + + if ([channelType isEqualToString:@"texture"]) { + // texture are IMPORTs, so check the supplemental imports array for a dict using this name + uniqueChannelName = UniqueNameForImport(channelName); + // if the unique channel name doesn't match the channel name, we're going to have to replace stuff when we convert the shader source + if (![uniqueChannelName isEqualToString:channelName]) + [passVarNameSwapDict setObject:uniqueChannelName forKey:channelName]; + + + NSMutableDictionary *channelDict = MUTDICT; + //[suppImports setObject:channelDict forKey:channelName]; + [suppImports addObject:channelDict]; + [channelDict setObject:uniqueChannelName forKey:@"NAME"]; + [channelDict setObject:channelSrc forKey:@"PATH"]; + } + else if ([channelType isEqualToString:@"music"] || [channelType isEqualToString:@"mic"] || [channelType isEqualToString:@"musicstream"]) { + // texture are IMPORTs, so check the supplemental imports array for a dict using this name + uniqueChannelName = UniqueNameForInput(channelName); + // if the unique channel name doesn't match the channel name, we're going to have to replace stuff when we convert the shader source + if (![uniqueChannelName isEqualToString:channelName]) + [passVarNameSwapDict setObject:uniqueChannelName forKey:channelName]; + + + [musicInputNames addObject:channelName]; + NSMutableDictionary *channelDict = MUTDICT; + [suppInputs addObject:channelDict]; + [channelDict setObject:uniqueChannelName forKey:@"NAME"]; + //[channelDict setObject:@"image" forKey:@"TYPE"]; + [channelDict setObject:@"audio" forKey:@"TYPE"]; + } + else if ([channelType isEqualToString:@"cubemap"]) { + // texture are IMPORTs, so check the supplemental imports array for a dict using this name + uniqueChannelName = UniqueNameForImport(channelName); + // if the unique channel name doesn't match the channel name, we're going to have to replace stuff when we convert the shader source + if (![uniqueChannelName isEqualToString:channelName]) + [passVarNameSwapDict setObject:uniqueChannelName forKey:channelName]; + + + NSMutableDictionary *channelDict = MUTDICT; + [suppImports addObject:channelDict]; + [channelDict setObject:uniqueChannelName forKey:@"NAME"]; + // cubemaps only list one path even though there are six. so we have to parse the string, then synthesize all the path names from that. weak, right? + NSMutableArray *pathArray = MUTARRAY; + NSString *regex = @"([\\s_-]*)([0-9]+)(\\.((jpg)|(png)))"; + for (int i=0; i<6; ++i) { + NSString *modString = [channelSrc stringByReplacingOccurrencesOfRegex:regex withString:VVFMTSTRING(@"$1%d$3",i)]; + if (modString==nil) { + NSLog(@"\t\tERR: couldn't calculate cubemap file name in %s",__func__); + NSLog(@"\t\tsrc string was %@",channelSrc); + break; + } + [pathArray addObject:modString]; + } + [channelDict setObject:pathArray forKey:@"PATH"]; + [channelDict setObject:@"cube" forKey:@"TYPE"]; + } + else if ([channelType isEqualToString:@"video"]) { + // texture are IMPORTs, so check the supplemental imports array for a dict using this name + uniqueChannelName = UniqueNameForInput(channelName); + // if the unique channel name doesn't match the channel name, we're going to have to replace stuff when we convert the shader source + if (![uniqueChannelName isEqualToString:channelName]) + [passVarNameSwapDict setObject:uniqueChannelName forKey:channelName]; + + + NSMutableDictionary *channelDict = MUTDICT; + [suppInputs addObject:channelDict]; + [channelDict setObject:@"image" forKey:@"TYPE"]; + [channelDict setObject:uniqueChannelName forKey:@"NAME"]; + // if the inputImageChannelName is still nil, then this video-type channel is going to be turned into the default image input for a video filter... + if (inputImageChannelName==nil) + inputImageChannelName = [[channelName copy] autorelease]; + } + // buffers are the results of prior rendering passes + else if ([channelType isEqualToString:@"buffer"]) { + // results of prior rendering passes have unique names (A, B, C, or D) + NSNumber *tmpNum = [renderpassInput objectForKey:@"id"]; + NSString *bufferName = NameForBufferID([tmpNum intValue]); + // since we have a static name, we know we need to replace stuff + [passVarNameSwapDict setObject:bufferName forKey:channelName]; + } + // if i found a keyboard-type input, i want to present the user with an alert informing them that the conversion hasn't been complete + else if ([channelType isEqualToString:@"keyboard"]) { + hasMouseOrKeyboardInput = YES; + } + } + + + ++passIndex; + } + /* + NSLog(@"*****************"); + NSLog(@"\t\tsortedShaderSourceArray is %@",sortedShaderSourceArray); + NSLog(@"*****************"); + NSLog(@"\t\tsuppEntries is %@",suppEntries); + NSLog(@"*****************"); + NSLog(@"\t\tpassVarNameSwapDicts is %@",passVarNameSwapDicts); + NSLog(@"*****************"); + */ + NSString *convertedShaderSource = [self _converShaderToySourceArray:sortedShaderSourceArray supplementalJSONDictEntries:suppEntries varSwapNameDicts:passVarNameSwapDicts]; + //NSLog(@"\t\tconvertedShaderSource is %@",convertedShaderSource); + + // if there's a "mouse" input, then there's a mouse and i need to show an alert (we check now because the conversion method will add an "iMouse" input if appropriate) + if (!IsThisInputNameUnique(@"iMouse")) + hasMouseOrKeyboardInput = YES; + + + // convert the shader source string, export to the user-library ISF folder + //NSString *convertedShaderSource = [self _convertShaderToyString:rawShaderSource supplementalJSONDictEntries:suppEntries]; + + if (convertedShaderSource==nil) { + NSLog(@"\t\terr: couldn't convert shader source, bailing"); + //NSLog(@"\t\trawShaderSource was %@",rawShaderSource); + return; + } + // okay, so i converted the shader source- now i want to rename any music-based image inputs to something better than "iChannel" + /* + if ([musicInputNames count]>0) { + int tmpIndex = 1; + for (NSString *musicInputName in musicInputNames) { + NSString *uniqueName = (tmpIndex==1) ? @"AudioWaveformImage" : VVFMTSTRING(@"AudioWaveformImage%d",tmpIndex); + convertedShaderSource = [convertedShaderSource stringByReplacingOccurrencesOfString:musicInputName withString:uniqueName]; + } + } + */ + // if i have an inputImageChannelName, i want to find-and-replace that as well + if (inputImageChannelName!=nil) { + convertedShaderSource = [convertedShaderSource stringByReplacingOccurrencesOfString:inputImageChannelName withString:@"inputImage"]; + } + + + // make sure that the user-level ISF folder exists + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *isfFolder = [@"~/Library/Graphics/ISF" stringByExpandingTildeInPath]; + if (![fm fileExistsAtPath:isfFolder]) + [fm createDirectoryAtPath:isfFolder withIntermediateDirectories:YES attributes:nil error:nil]; + // now i need to figure out a write location/file name. try to base this off the "name" from shadertoy, appended by the shadertoy username, and then shadertoy ID + NSString *writeFolder = [@"~/Library/Graphics/ISF" stringByExpandingTildeInPath]; + NSString *writeLocation = nil; + if (shadertoyName!=nil) + writeLocation = VVFMTSTRING(@"%@/%@_%@.fs",writeFolder,[shadertoyName stringByReplacingOccurrencesOfString:@"/" withString:@"_"],shaderIDString); + else + writeLocation = VVFMTSTRING(@"%@/shadertoy_%@.fs",writeFolder,shaderIDString); + //NSString *writeLocation = VVFMTSTRING(@"%@/st_%@.fs",writeFolder,shaderIDString); + NSError *nsErr = nil; + if (![convertedShaderSource writeToFile:writeLocation atomically:YES encoding:NSUTF8StringEncoding error:&nsErr]) { + NSLog(@"\t\terr: couldn't write converted shader to file %@",writeLocation); + NSLog(@"\t\tnsErr was %@",nsErr); + return; + } + // if the shader requires any imported assets, make sure they've been copied to the write folder as well + + //NSFileManager *fm = [NSFileManager defaultManager]; + //[suppImports enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + // NSDictionary *importDict = (NSDictionary *)obj; + // NSString *importFileName = [importDict objectForKey:@"PATH"]; + // NSString *importSrcImgPath = VVFMTSTRING(@"%@/%@",[[NSBundle mainBundle] resourcePath],importFileName); + // NSString *importDstImgPath = VVFMTSTRING(@"%@/%@",writeFolder,importFileName); + // if (![fm fileExistsAtPath:importDstImgPath isDirectory:nil]) { + // //NSLog(@"\t\tfile %@ doesn't exist copying from %@",importDstImgPath,importSrcImgPath); + // if (![fm copyItemAtPath:importSrcImgPath toPath:importDstImgPath error:nil]) { + // NSLog(@"\t\tERR: problem copying src image from %@ to %@",importSrcImgPath,importDstImgPath); + // } + // } + //}]; + + + + for (NSDictionary *importDict in suppImports) { + NSString *cubeFlag = [importDict objectForKey:@"TYPE"]; + if (cubeFlag!=nil && ![cubeFlag isEqualToString:@"cube"]) + cubeFlag = nil; + + // if this import describes a cubemap, the PATH is an array + if (cubeFlag!=nil) { + NSArray *importFileNames = [importDict objectForKey:@"PATH"]; + for (NSString *importFileName in importFileNames) { + NSString *importSrcImgPath = VVFMTSTRING(@"%@/%@",[[NSBundle mainBundle] resourcePath],importFileName); + NSString *importDstImgPath = VVFMTSTRING(@"%@/%@",writeFolder,importFileName); + if (![fm fileExistsAtPath:importDstImgPath isDirectory:nil]) { + //NSLog(@"\t\tcubemap file %@ doesn't exist, copying from %@",importDstImgPath,importSrcImgPath); + if (![fm copyItemAtPath:importSrcImgPath toPath:importDstImgPath error:nil]) { + NSLog(@"\t\tERR: problem copying cube src image from %@ to %@",importSrcImgPath,importDstImgPath); + } + } + } + } + // else this import doesn't describe a cubemap- just a plain ol' image file + else { + NSString *importFileName = [importDict objectForKey:@"PATH"]; + NSString *importSrcImgPath = VVFMTSTRING(@"%@/%@",[[NSBundle mainBundle] resourcePath],importFileName); + NSString *importDstImgPath = VVFMTSTRING(@"%@/%@",writeFolder,importFileName); + if (![fm fileExistsAtPath:importDstImgPath isDirectory:nil]) { + //NSLog(@"\t\tfile %@ doesn't exist copying from %@",importDstImgPath,importSrcImgPath); + if (![fm copyItemAtPath:importSrcImgPath toPath:importDstImgPath error:nil]) { + NSLog(@"\t\tERR: problem copying src image from %@ to %@",importSrcImgPath,importDstImgPath); + } + } + } + } + + // close the sheet + [self closeShadertoySheet]; + + // if there was a mouse or keyboard input, i need to show an alert + if (hasMouseOrKeyboardInput) { + VVRunAlertPanel(@"Further conversion may be necessary...", + @"The Shadertoy you're converting has a mouse and/or keyboard input, and may require further conversion to function correctly", + @"OK", + nil, + nil); + } + + // tell the app to select the shader we just created + [appDelegate exportCompleteSelectFileAtPath:writeLocation]; + + +} +- (IBAction) shadertoyTextFieldUsed:(id)sender { + //NSLog(@"%s",__func__); + //[self shadertoyOKClicked:sender]; +} + + +#pragma mark - +#pragma mark actual conversion methods + + +- (NSString *) _convertGLSLSandboxString:(NSString *)rawFragString supplementalJSONDictEntries:(NSDictionary *)suppEntries { + //NSLog(@"******************************"); + //NSLog(@"%s",__func__); + //NSString *rawFragString = [shaderTextView string]; + NSMutableString *tmpMutString = [[NSMutableString stringWithCapacity:0] retain]; + __block BOOL hasAnotherUniform = NO; // set to YES if the script has any other uniforms + __block BOOL declaresBackbuffer = NO; + __block NSString *backbufferName = nil; + __block BOOL backbufferWasRect = NO; + __block BOOL declaresSurfacePosition = NO; + [rawFragString enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // get rid of any 'time', 'mouse', 'resolution', or 'backbuffer' variable declarations + if (![line isMatchedByRegex:@"uniform[\\s]+float[\\s]+time;"]) { + if (![line isMatchedByRegex:@"uniform[\\s]+vec2[\\s]+mouse;"]) { + if (![line isMatchedByRegex:@"uniform[\\s]+vec2[\\s]+resolution;"]) { + if (![line isMatchedByRegex:@"uniform[\\s]+sampler2D(Rect)?[\\s]+[bB]"/*@"uniform[\\s]+sampler2D(Rect)?[\\s]+[bB]ack[bB]uffer"*/]) { + if (![line isMatchedByRegex:@"((varying)|(uniform))[\\s]+vec2[\\s]+surfacePosition"]) { + if (![line isMatchedByRegex:@"uniform[\\s]+vec2[\\s]+((mouse)|(resolution))[\\s]*,[\\s]*((mouse)|(resolution));"]) { + // if there's a "uniform" in this line, log it so i can flag the file as having another uniform (which can potentially be controlled externally) + NSRange tmpRange = [line rangeOfString:@"uniform"]; + if (tmpRange.length == 6) + hasAnotherUniform = YES; + // else there weren't any uniform var declarations on this line... + //else { + // remove any and all texture2D or texture2DRect function calls from this line (there may be more than one!) and replace with the appropriate macro for accessing the texture + NSMutableString *newLine = [NSMutableString stringWithCapacity:0]; + [newLine appendString:line]; + do { + BOOL textureLookupWas2D = NO; + tmpRange = [newLine rangeOfString:@"texture2DRect("]; + if (tmpRange.length!=0) { + --tmpRange.length; // i searched for the string + left parenthesis + } + else { + tmpRange = [newLine rangeOfString:@"texture2D("]; + if (tmpRange.length!=0) { + --tmpRange.length; // i searched for the string + left parenthesis + textureLookupWas2D = YES; + } + } + if (tmpRange.length!=0) { + //NSLog(@"\t\tline matches a texture lookup:\n%@",newLine); + NSRange funcNameRange = tmpRange; + NSMutableArray *tmpVarArray = [NSMutableArray arrayWithCapacity:0]; + NSRange fullFuncRangeToReplace = [newLine lexFunctionCallInRange:funcNameRange addVariablesToArray:tmpVarArray]; + if ([tmpVarArray count]==2) { + NSString *newFuncString = nil; + NSString *samplerName = [tmpVarArray objectAtIndex:0]; + NSString *samplerCoord = [tmpVarArray objectAtIndex:1]; + if (textureLookupWas2D) { + newFuncString = [NSString stringWithFormat:@"IMG_NORM_PIXEL(%@,mod(%@,1.0))",samplerName,samplerCoord]; + } + else { + newFuncString = [NSString stringWithFormat:@"IMG_PIXEL(%@,%@)",samplerName,samplerCoord]; + } + [newLine replaceCharactersInRange:fullFuncRangeToReplace withString:newFuncString]; + } + else if ([tmpVarArray count]==3) { + NSString *newFuncString = nil; + NSString *samplerName = [tmpVarArray objectAtIndex:0]; + NSString *samplerCoord = [tmpVarArray objectAtIndex:1]; + NSString *samplerBias = [tmpVarArray objectAtIndex:2]; + if (textureLookupWas2D) { + newFuncString = [NSString stringWithFormat:@"IMG_NORM_PIXEL(%@,mod(%@,1.0),%@)",samplerName,samplerCoord,samplerBias]; + } + else { + newFuncString = [NSString stringWithFormat:@"IMG_PIXEL(%@,%@,%@)",samplerName,samplerCoord,samplerBias]; + } + [newLine replaceCharactersInRange:fullFuncRangeToReplace withString:newFuncString]; + } + else { + NSLog(@"\t\tERR: variable count wrong searching for texture lookup: %@, %@",newLine,tmpVarArray); + } + } + } while (tmpRange.length>0); + [tmpMutString appendString:@"\n"]; + [tmpMutString appendString:newLine]; + //} + } + } + // else the line is declaring a 'surfacePosition' variable + else { + declaresSurfacePosition = YES; + } + } + else { + // if there's a backbuffer var declaration, figure out what kind of sampler it is (2D or RECT) and pull its exact name + declaresBackbuffer = YES; + NSRange tmpRange = [line rangeOfString:@"sampler2DRect"]; + if (tmpRange.length!=0) + backbufferWasRect = YES; + NSArray *tmpArray = [line captureComponentsMatchedByRegex:@"uniform[\\s]+sampler2D(Rect)?[\\s]+([^;]+);"]; + if (tmpArray!=nil && [tmpArray count]==3) { + backbufferName = [[tmpArray objectAtIndex:2] copy]; + NSLog(@"\t\tbackbufferName discovered to be %@",backbufferName); + } + } + } + } + } + }]; + + // figure out if the source code uses the mouse var and backbuffer + BOOL usesMouseVar = [tmpMutString isMatchedByRegex:@"([^a-zA-Z0-9_])(mouse)([^a-zA-Z0-9_])"]; + //BOOL usesBackbufferVar = (backbufferName==nil) ? NO : [tmpMutString isMatchedByRegex:[NSString stringWithFormat:@"([^a-zA-Z0-9_])(%@)([^a-zA-Z0-9_])",backbufferName]]; + BOOL usesBackbufferVar = NO; + if (backbufferName != nil) { + NSString *regex = [NSString stringWithFormat:@"([^a-zA-Z0-9_])(%@)([^a-zA-Z0-9_])",backbufferName]; + //NSLog(@"\t\tregex is %@",regex); + usesBackbufferVar = [tmpMutString isMatchedByRegex:regex]; + } + BOOL usesSurfacePositionVar = [tmpMutString isMatchedByRegex:@"([^a-zA-Z0-9_])(surfacePosition)([^a-zA-Z0-9_])"]; + + // assemble the JSON dict that describes the filter. make an NSDict, then convert it to a string using JSONKit + NSMutableDictionary *isfDict = [NSMutableDictionary dictionaryWithCapacity:0]; + NSMutableArray *tmpArray = nil; + NSMutableDictionary *tmpDict = nil; + // add any supplemental entries passed in with the method! + [isfDict addEntriesFromDictionary:suppEntries]; + // put it in an "Automatically Converted" category by default + [isfDict setObject:[NSArray arrayWithObjects:@"Automatically Converted",@"GLSLSandbox",nil] forKey:@"CATEGORIES"]; + // make an input (if the mouse is being used) + tmpArray = [NSMutableArray arrayWithCapacity:0]; + [isfDict setObject:tmpArray forKey:@"INPUTS"]; + if (usesMouseVar) { + tmpDict = [NSMutableDictionary dictionaryWithCapacity:0]; + [tmpDict setObject:@"mouse" forKey:@"NAME"]; + [tmpDict setObject:@"point2D" forKey:@"TYPE"]; + NSMutableArray *minArray = [NSMutableArray arrayWithCapacity:0]; + [minArray addObject:[NSNumber numberWithFloat:0.0]]; + [minArray addObject:[NSNumber numberWithFloat:0.0]]; + [tmpDict setObject:minArray forKey:@"MIN"]; + NSMutableArray *maxArray = [NSMutableArray arrayWithCapacity:0]; + [maxArray addObject:[NSNumber numberWithFloat:1.0]]; + [maxArray addObject:[NSNumber numberWithFloat:1.0]]; + [tmpDict setObject:maxArray forKey:@"MAX"]; + [tmpArray addObject:tmpDict]; + } + /* + if (usesSurfacePositionVar) { + tmpDict = [NSMutableDictionary dictionaryWithCapacity:0]; + [tmpDict setObject:@"surfacePosition" forKey:@"NAME"]; + [tmpDict setObject:@"point2D" forKey:@"TYPE"]; + [tmpArray addObject:tmpDict]; + } + */ + // if there's a backbuffer... + if (usesBackbufferVar && backbufferName!=nil) { + // make a persistent buffer for it + tmpArray = [NSMutableArray arrayWithCapacity:0]; + [tmpArray addObject:backbufferName]; + [isfDict setObject:tmpArray forKey:@"PERSISTENT_BUFFERS"]; + + + // make the last render pass target the backbuffer + tmpArray = [NSMutableArray arrayWithCapacity:0]; + [isfDict setObject:tmpArray forKey:@"PASSES"]; + + tmpDict = [NSMutableDictionary dictionaryWithCapacity:0]; + [tmpArray addObject:tmpDict]; + [tmpDict setObject:backbufferName forKey:@"TARGET"]; + [tmpDict setObject:NUMBOOL(YES) forKey:@"PERSISTENT"]; + } + + + // replace the 'time' and 'resolution' vars + NSString *tmpString = [[tmpMutString copy] autorelease]; + NSString *regexString = nil; + + regexString = @"([^a-zA-Z0-9_])(time)([^a-zA-Z0-9_])"; + while ([tmpString isMatchedByRegex:regexString]) { + tmpString = [tmpString stringByReplacingOccurrencesOfRegex:regexString withString:@"$1TIME$3"]; + } + regexString = @"([^a-zA-Z0-9_])(resolution)([^a-zA-Z0-9_])"; + while ([tmpString isMatchedByRegex:regexString]) { + tmpString = [tmpString stringByReplacingOccurrencesOfRegex:regexString withString:@"$1RENDERSIZE$3"]; + } + + if (declaresSurfacePosition && usesSurfacePositionVar) { + regexString = @"([^a-zA-Z0-9_])(surfacePosition)([^a-zA-Z0-9_])"; + while ([tmpString isMatchedByRegex:regexString]) { + tmpString = [tmpString stringByReplacingOccurrencesOfRegex:regexString withString:@"$1vv_FragNormCoord$3"]; + } + } + + + // ...finally assemble the final string + //tmpString = [NSString stringWithFormat:@"/*\n%@\n*/\n\n%@",[isfDict JSONStringWithOptions:JKSerializeOptionPretty error:nil],tmpString]; + tmpString = [NSString stringWithFormat:@"/*\n%@\n*/\n\n%@",[isfDict prettyJSONString],tmpString]; + //NSLog(@"%@",tmpString); + + + + if (backbufferName != nil) { + [backbufferName release]; + backbufferName = nil; + } + if (tmpMutString != nil) { + [tmpMutString release]; + tmpMutString = nil; + } + + return tmpString; +} +- (NSString *) _converShaderToySourceArray:(NSArray *)rawFragStrings supplementalJSONDictEntries:(NSMutableDictionary *)suppEntries varSwapNameDicts:(NSArray *)varSwapNameDicts { + //NSLog(@"%s",__func__); + // while converting, i need to differentiate between texture lookups for image inputs or imported images, and texture lookups in, like, other functions...so i need a list of all the names of the image inputs/imported images + __block NSMutableArray *environmentProvidedSamplers = MUTARRAY; + NSArray *tmpSuppArray = nil; + tmpSuppArray = [suppEntries objectForKey:@"IMPORTED"]; + for (NSDictionary *importDict in tmpSuppArray) { + NSString *tmpString = [importDict objectForKey:@"TYPE"]; + if (tmpString==nil || [tmpString isEqualToString:@"cube"]) + [environmentProvidedSamplers addObject:[importDict objectForKey:@"NAME"]]; + } + tmpSuppArray = [suppEntries objectForKey:@"INPUTS"]; + //NSLog(@"\t\tinputs are %@",tmpSuppArray); + for (NSDictionary *inputDict in tmpSuppArray) { + NSString *tmpString = [inputDict objectForKey:@"TYPE"]; + if ([tmpString isEqualToString:@"image"] || [tmpString isEqualToString:@"cube"] || [tmpString isEqualToString:@"audio"] || [tmpString isEqualToString:@"audioFFT"]) + [environmentProvidedSamplers addObject:[inputDict objectForKey:@"NAME"]]; + } + tmpSuppArray = [suppEntries objectForKey:@"PASSES"]; + for (NSDictionary *passDict in tmpSuppArray) { + NSString *tmpString = [passDict objectForKey:@"TARGET"]; + if (tmpString!=nil) + [environmentProvidedSamplers addObject:tmpString]; + } + //NSLog(@"\t\tenvironmentProvidedSamplers are %@",environmentProvidedSamplers); + //NSLog(@"\t\tvarSwapNameDicts are %@",varSwapNameDicts); + + + /* this is a little complicated. + - i have an array of dictionaries (one dict per pass)- these dicts describe variables that + need to be replaced on a pass-by-pass basis (the key in the dict is the string we have to + replace, the object is the string to replace it with). + - there are a number of standard strings i have to find-and-replace + - the variables passed to shadertoy's "mainImage()" function have to be find-and-replaced + with variable names standard to GLSL 1.2. + - each "renderpass" in shadertoy is a separate GLSL program, possibly with a bunch of + external functions (outside the mainImage() function). because of this, i have to run + through all the shadertoy renderpasses, copying everything *before* mainImage into my ISF + program. then i have to run through the passes a second time, taking the contents of each + pass's mainImage function and putting them in if/else PASSINDEX statements. then i have to + run through the passes a third time, copying everything *after* mainImage from each pass + into my ISF program. + - ...while i'm doing all of the above, i have to do a lot of find-and-replacing. the first + and third passses, i have to find-and-replace the var swap dict and the standard strings. + the second pass i have to find-and-replace the var swap dict, the standard strings, and the + variables passed to the "mainImage()" function. + + */ + + // make a block that accepts a mutable string and a var swap name dict and find-and-replaces + // the string with the contents of the var swap name dict and also the standard strings. + void (^LineFindAndReplaceBlock)(NSMutableString *targetLine, NSDictionary *varSwapNameDict, NSString *rawString, NSRange targetRangeInRaw) = ^(NSMutableString *targetLine, NSDictionary *varSwapNameDict, NSString *rawString, NSRange targetRangeInRaw) { + // we have a dictionary of names that need to be replaced- iterate through it, checking every entry against this line + [varSwapNameDict enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *newKey, BOOL *stop) { + // the key is the string we want to replace, the object is the new value... + + NSString *tmpRegexString = nil; + NSString *tmpReplaceString = nil; + // first replace all instances where the string being replaced is surrounded by non-words + tmpRegexString = VVFMTSTRING(@"([^\\w])(%@)([^\\w])",key); + tmpReplaceString = VVFMTSTRING(@"$1%@$3",newKey); + while ([targetLine isMatchedByRegex:tmpRegexString]) { + [targetLine replaceOccurrencesOfRegex:tmpRegexString withString:tmpReplaceString]; + } + // replace all instances where the string being replaced occurs at the beginning of the line + tmpRegexString = VVFMTSTRING(@"(^%@)([^\\w])",key); + tmpReplaceString = VVFMTSTRING(@"%@$2",newKey); + while ([targetLine isMatchedByRegex:tmpRegexString]) { + [targetLine replaceOccurrencesOfRegex:tmpRegexString withString:tmpReplaceString]; + } + }]; + + + // now do all the standard find-and-replacing + { + // first replace the global uniforms passed by the ISF spec... + + // we supply a dict- the key is the string to replace, the object is the string we want to replace it with + __block NSDictionary *srcStrings = @{ + @"iDate": @"DATE", + @"iGlobalTime": @"TIME", + @"iChannelTime\\[[0-9]\\]": @"TIME", + @"iTimeDelta": @"TIMEDELTA", + @"iResolution": @"RENDERSIZE", + @"iFrame": @"FRAMEINDEX" + }; + // the key is the regex string, the value is the replace string. using a dict simply to keep the association. + __block NSDictionary *regexReplaceStrings = @{ + @"([^\\w_])(%@)([^\\w_])": @"$1%@$3", + @"(^%@)([^\\w_])": @"%@$2", + @"([^\\w_])(%@$)": @"$1%@" + }; + // enumerate the keys and values in the dict of strings describing what i want to replace and what i want to replace it with + [srcStrings enumerateKeysAndObjectsUsingBlock:^(NSString *replaceMe, NSString *replacement, BOOL *stop) { + // ...for each pair of strings (replace me/replacement), construct a number of different regex/replace string pairs and apply them. do this by enumerating the dict of regex/replacement strings. + [regexReplaceStrings enumerateKeysAndObjectsUsingBlock:^(NSString *regexFmtString, NSString *replaceFmtString, BOOL *stop) { + NSString *regexString = [NSString stringWithFormat:regexFmtString,replaceMe]; + NSString *replaceString = [NSString stringWithFormat:replaceFmtString,replacement]; + while ([targetLine isMatchedByRegex:regexString]) + [targetLine replaceOccurrencesOfRegex:regexString withString:replaceString]; + }]; + }]; + + + NSString *regexString = nil; + NSString *replaceString = nil; + // replace the "channel resolution" var instances with calls to IMG_SIZE + regexString = @"iChannelResolution\\[([0-9]+)\\]"; + while ([targetLine isMatchedByRegex:regexString]) { + NSArray *channelResCaptures = [targetLine captureComponentsMatchedByRegex:regexString]; + if (channelResCaptures!=nil && [channelResCaptures count]>=2) { + NSString *channelNumberString = [channelResCaptures objectAtIndex:1]; + NSString *channelStringToCheck = VVFMTSTRING(@"iChannel%d",[channelNumberString intValue]); + NSString *uniqueChannelName = [varSwapNameDict objectForKey:channelStringToCheck]; + if (uniqueChannelName == nil) + uniqueChannelName = channelStringToCheck; + replaceString = VVFMTSTRING(@"IMG_SIZE(%@)",uniqueChannelName); + [targetLine replaceOccurrencesOfRegex:regexString withString:replaceString]; + } + else + break; + } + + + // now remove any and all texture2D or texture2DRect function calls (there may be more than one!) and replace with the appropriate macro for accessing the texture + NSRange tmpRange; + do { + BOOL textureLookupWas2D = NO; + //tmpRange = [targetLine rangeOfString:@"texture2DRect("]; + tmpRange = [targetLine rangeOfRegex:@"texture2DRect[\\s]*\\("]; + if (tmpRange.length!=0) { + --tmpRange.length; // i searched for the string + left parenthesis + } + else { + //tmpRange = [targetLine rangeOfString:@"texture2D("]; + tmpRange = [targetLine rangeOfRegex:@"texture2D[\\s]*\\("]; + if (tmpRange.length!=0) { + --tmpRange.length; // i searched for the string + left parenthesis + textureLookupWas2D = YES; + } + } + if (tmpRange.length!=0) { + NSLog(@"\t\tline matches a texture lookup:\n%@",targetLine); + NSRange funcNameRange = tmpRange; + NSMutableArray *tmpVarArray = [NSMutableArray arrayWithCapacity:0]; + NSRange fullFuncRangeToReplace = [targetLine lexFunctionCallInRange:funcNameRange addVariablesToArray:tmpVarArray]; + //NSRange absoluteFuncNameRange = NSMakeRange(funcNameRange.location+targetRangeInRaw.location, funcNameRange.length); + //NSRange fullFuncRangeToReplace = [rawString lexFunctionCallInRange:absoluteFuncNameRange addVariablesToArray:tmpVarArray]; + NSLog(@"\t\tfullFuncRangeToReplace is %@, variables are %@",NSStringFromRange(fullFuncRangeToReplace),tmpVarArray); + // i only want to replace this function if the sampler is one of the samplers i'm converting/replacing + if ([tmpVarArray count]>0 && [environmentProvidedSamplers containsObject:[tmpVarArray objectAtIndex:0]]) { + if ([tmpVarArray count]==2) { + NSString *newFuncString = nil; + NSString *samplerName = [tmpVarArray objectAtIndex:0]; + NSString *samplerCoord = [tmpVarArray objectAtIndex:1]; + if (textureLookupWas2D) { + newFuncString = [NSString stringWithFormat:@"IMG_NORM_PIXEL(%@,mod(%@,1.0))",samplerName,samplerCoord]; + } + else { + newFuncString = [NSString stringWithFormat:@"IMG_PIXEL(%@,%@)",samplerName,samplerCoord]; + } + [targetLine replaceCharactersInRange:fullFuncRangeToReplace withString:newFuncString]; + } + else if ([tmpVarArray count]==3) { + NSString *newFuncString = nil; + NSString *samplerName = [tmpVarArray objectAtIndex:0]; + NSString *samplerCoord = [tmpVarArray objectAtIndex:1]; + NSString *samplerBias = [tmpVarArray objectAtIndex:2]; + if (textureLookupWas2D) { + newFuncString = [NSString stringWithFormat:@"IMG_NORM_PIXEL(%@,mod(%@,1.0),%@)",samplerName,samplerCoord,samplerBias]; + } + else { + newFuncString = [NSString stringWithFormat:@"IMG_PIXEL(%@,%@,%@)",samplerName,samplerCoord,samplerBias]; + } + [targetLine replaceCharactersInRange:fullFuncRangeToReplace withString:newFuncString]; + } + else { + NSLog(@"\t\tERR: variable count wrong searching for texture lookup: %@, %@",targetLine,tmpVarArray); + } + //NSLog(@"\t\tafter replacing, targetLine is %@",targetLine); + } + // else the sampler in this texture lookup isn't a sampler being controlled by the ISF environment... + else { + tmpRange.length = 0; + } + } + } while (tmpRange.length>0); + } + + + + }; + + + + + + + + + + + + + + + + + + // make a mutable string- this is what we're building the results for the source code in + NSMutableString *tmpMutString = [[NSMutableString stringWithCapacity:0] retain]; + [tmpMutString appendString:@"\n"]; + + + + int passIndex = 0; + // run through the array of frag shader sources- the goal is to copy everything BEFORE the mainImage() function into the string. + for (NSString *rawFragString in rawFragStrings) { + // get the variable swap dict, i'll need it for find-and-replacing... + NSMutableDictionary *varSwapNameDict = [varSwapNameDicts objectAtIndex:passIndex]; + // run through the frag shader source, line by line + __block NSRange thisLineRange = NSMakeRange(0,0); + [rawFragString enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // update the range of this line within the raw frag string (we need to know the range because we're going to need to lex function calls that may span multiple lines) + thisLineRange.location = thisLineRange.location + thisLineRange.length; + thisLineRange.length = [line length]+1; + // make sure that the range is within the bounds of the raw frag string! + if (thisLineRange.location+thisLineRange.length>=[rawFragString length]) + thisLineRange.length = [rawFragString length]-thisLineRange.location; + + // if this is the mainImage function, stop- we're done, this pass we're only copying the stuff before the mainImage function + if ([line isMatchedByRegex:@"[\\r\\n\\s]*void[\\s]+mainImage"]) { + *stop = YES; + } + // else we're still before the mainImage function- we have to do some find-and-replacing while copying stuff... + else { + __block NSMutableString *newLine = [NSMutableString stringWithCapacity:0]; + [newLine appendString:line]; + + LineFindAndReplaceBlock(newLine,varSwapNameDict,rawFragString,NSMakeRange(thisLineRange.location,[newLine length])); + + [tmpMutString appendString:newLine]; + [tmpMutString appendString:@"\n"]; + } + }]; + + ++passIndex; + } + + + + + // make the "main" function entry + [tmpMutString appendString:@"void main() {"]; + [tmpMutString appendString:@"\n"]; + + + + + // this next bit here goes through every pass and replaces the contents of the mainImage functions + + // we need to know if there are multiple passes, and the index of the pass we're parsing + BOOL multiplePasses = ([rawFragStrings count]>1) ? YES : NO; + passIndex = 0; + // run through the array of frag shader sources again- this time we're going to find "mainImage" and convert all the code within it + for (NSString *rawFragString in rawFragStrings) { + // if there are multiple passes, we have to start off by adding a bracket with an if/else defining the PASSINDEX + if (multiplePasses) { + if (passIndex == 0) + [tmpMutString appendFormat:@"\tif (PASSINDEX == %d)\t{",passIndex]; + else + [tmpMutString appendFormat:@"\telse if (PASSINDEX == %d)\t{",passIndex]; + } + + // get the variable swap dict + NSMutableDictionary *varSwapNameDict = [varSwapNameDicts objectAtIndex:passIndex]; + // now we have to do all the conversion! + __block BOOL beforeMainImage = YES; + __block BOOL afterMainImage = NO; + __block int mainImageFunctionBracketCount = 0; // ...in order to determine when i'm parsing text within the mainImage() function i need to keep a count of the brackets- when it hits 0, i've left the function! + __block NSString *fragColorVarNameString = [@"fragColor" retain]; // RETAINED because the pool will drain before we're done converting and it crashes if you don't. the 'mainImage' function in a shadertoy passes in a 4-element vec named 'fragColor' by default (gl_FragColor in "old school" GLSL) and a 2-element vec named 'fragCoord' by default. the variable names (fragColor and fragCoord) may be different, so we parse them here + __block NSString *fragCoordVarNameString = [@"fragCoord" retain]; // see above + __block NSRange thisLineRange = NSMakeRange(0,0); + __block NSRange mainImageFunctionRange = NSMakeRange(0,0); // the range of the full "mainImage" function (and all its vars and stuff) in the raw frag string + __block NSRange firstBracketOfMainImageFunction = NSMakeRange(0,0); + [rawFragString enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // update the range of this line within the raw frag string (we need to know the range because we're going to need to lex function calls that may span multiple lines) + thisLineRange.location = thisLineRange.location + thisLineRange.length; + thisLineRange.length = [line length]+1; + // make sure that the range is within the bounds of the raw frag string! + if (thisLineRange.location+thisLineRange.length>=[rawFragString length]) + thisLineRange.length = [rawFragString length]-thisLineRange.location; + + // shadertoy shaders don't have a main() function- instead they have a mainImage() function, which isn't really compatible with the GLSL 1.2 environment i'm writing this for right now. + NSString *mainImageRegex = @"[\\r\\n\\s]*void[\\s]+(mainImage)"; + if ([line isMatchedByRegex:mainImageRegex]) { + // first of all, reset the mainImage function bracket count stuff, then increment it (if appropriate) + mainImageFunctionBracketCount = 0; + + // the default variable names passed to mainImage (fragColor and fragCoord) may be different in this shader- we have to capture them to find out + NSRange mainImageStringRange = [line rangeOfRegex:mainImageRegex capture:1]; + mainImageStringRange.location += thisLineRange.location; + NSMutableArray *mainImageVars = MUTARRAY; + mainImageFunctionRange = [rawFragString lexFunctionCallInRange:mainImageStringRange addVariablesToArray:mainImageVars]; + if ([mainImageVars count]>=1) { + VVRELEASE(fragColorVarNameString); + //fragColorVarNameString = [[mainImageVars objectAtIndex:0] copy]; + NSArray *tmpArray = [[mainImageVars objectAtIndex:0] componentsSeparatedByRegex:@"[^\\w_]"]; + if (tmpArray!=nil) + fragColorVarNameString = [[tmpArray lastObject] copy]; + } + if ([mainImageVars count]>=2) { + VVRELEASE(fragCoordVarNameString); + //fragCoordVarNameString = [[mainImageVars objectAtIndex:1] copy]; + NSArray *tmpArray = [[mainImageVars objectAtIndex:1] componentsSeparatedByRegex:@"[^\\w_]"]; + if (tmpArray!=nil) + fragCoordVarNameString = [[tmpArray lastObject] copy]; + } + //NSLog(@"\t\tfragColorVarNameString is %@, fragCoordVarNameString is %@",fragColorVarNameString,fragCoordVarNameString); + // i still need to know where the first bracket of the mainImage() function is (it may be on another line, so i have to find it now) + NSRange tmpRange = NSMakeRange(mainImageFunctionRange.location+mainImageFunctionRange.length, 1); + while (firstBracketOfMainImageFunction.length<1) { + if ([[rawFragString substringWithRange:tmpRange] isEqualToString:@"{"]) { + firstBracketOfMainImageFunction = tmpRange; + } + ++tmpRange.location; + } + + + // if this line contains the bracket after the mainImage function... + if ((firstBracketOfMainImageFunction.length>0) && + ((firstBracketOfMainImageFunction.location+firstBracketOfMainImageFunction.length)<=(thisLineRange.location+thisLineRange.length))) { + // update the bracket count (only update the count if this line contains the first bracket after the mainImage function!) + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + // we're not longer before the mainImage function... + beforeMainImage = NO; + } + } + // else this line isn't the mainImage function + else { + //NSRange tmpRange; + // create a mutable string, populate it initially with the line i'm enumerating + __block NSMutableString *newLine = [NSMutableString stringWithCapacity:0]; + [newLine appendString:line]; + + // if i'm before the mainImage function, empty it- we already handled this content in the previous pass + if (beforeMainImage && !afterMainImage) { + // if this line contains the bracket after the mainImage function... + if ((firstBracketOfMainImageFunction.length>0) && + ((firstBracketOfMainImageFunction.location+firstBracketOfMainImageFunction.length)<=(thisLineRange.location+thisLineRange.length))) { + // update the bracket count (only update the count if this line contains the first bracket after the mainImage function!) + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + // we're not longer before the mainImage function... + beforeMainImage = NO; + // empty the line, then copy everything after the first bracket of the main function (which is in this line!) to it + [newLine setString:@""]; + NSRange tmpRange; + tmpRange.location = firstBracketOfMainImageFunction.location + 1; + tmpRange.length = thisLineRange.location + thisLineRange.length - tmpRange.location; + if (tmpRange.length>0) + [newLine appendString:[rawFragString substringWithRange:tmpRange]]; + } + // else this line doesn't contain the bracket after the mainImage function + else { + // empty the string- we're "before the main image", but also before the first bracket of the mainImage function- we are most likely somewhere before or within the mainImage function declaration + [newLine setString:@""]; + } + } + // if i'm still within the mainImage function, replace occurrences of fragCoord and fragColor with their GLSL 1.2 equivalents + else if (!beforeMainImage && !afterMainImage) { + NSString *regexString = nil; + regexString = VVFMTSTRING(@"([^\\w])(%@)([^\\w])",fragColorVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"$1gl_FragColor$3"]; + } + // now i want to replace "fragCoord" with "gl_FragCoord", but "fragCoord" is vec2, and "gl_FragCoord" is vec4. + // first try to replace "fragCoord." (fragCoord-period) with "gl_FragColor." + regexString = VVFMTSTRING(@"([^\\w])(%@\\.)([a-z])",fragCoordVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"$1gl_FragCoord.$3"]; + } + // now try to just replace "fragCoord" with "gl_FragColor.xy" + regexString = VVFMTSTRING(@"([^\\w])(%@)([^\\w])",fragCoordVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"$1gl_FragCoord.xy$3"]; + } + + + // this does the replacing on lines that start with the values i'm replacing... + regexString = VVFMTSTRING(@"(^%@)([^\\w])",fragColorVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"gl_FragColor$2"]; + } + // now i want to replace "fragCoord" with "gl_FragCoord", but "fragCoord" is vec2, and "gl_FragCoord" is vec4. + // first try to replace "fragCoord." (fragCoord-period) with "gl_FragColor." + regexString = VVFMTSTRING(@"(^%@\\.)([^\\w])",fragCoordVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"gl_FragCoord$2"]; + } + // now try to just replace "fragCoord" with "gl_FragColor.xy" + regexString = VVFMTSTRING(@"(^%@)([^\\w])",fragCoordVarNameString); + while ([newLine isMatchedByRegex:regexString]) { + [newLine replaceOccurrencesOfRegex:regexString withString:@"gl_FragCoord$2"]; + } + + + // now do all the find-and-replacing + LineFindAndReplaceBlock(newLine,varSwapNameDict,rawFragString,NSMakeRange(thisLineRange.location,[newLine length])); + + + + // update the count of mainImage function brackets in both directions + mainImageFunctionBracketCount += [[newLine componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[newLine componentsSeparatedByString:@"}"] count]; + // if the mainImage bracket count hits 0, then i'm no longer within the mainImage function! + if (mainImageFunctionBracketCount<=0) { + afterMainImage = YES; + *stop = YES; + } + + // if there are multiple passes, everything is indented- add a tab + if (multiplePasses) + [newLine insertString:@"\t" atIndex:0]; + } + + + + if ([newLine length]>0) { + [tmpMutString appendString:@"\n"]; + [tmpMutString appendString:newLine]; + } + } + }]; + + + // if there are multiple passes, don't forget to close the PASSINDEX bracket! + if (multiplePasses) { + //[tmpMutString appendString:@"}\n"]; + [tmpMutString appendString:@"\n"]; + } + + + // we have to release these (we explicitly retained them earlier) + VVAUTORELEASE(fragColorVarNameString); + VVAUTORELEASE(fragCoordVarNameString); + + // increment the pass index! + ++passIndex; + } + + // close our main function + if (multiplePasses) + [tmpMutString appendString:@"}"]; + [tmpMutString appendString:@"\n"]; + + + + + // run through the array of frag shader sources again- this time we're going to copy everything after "mainImage"... + passIndex = 0; + for (NSString *rawFragString in rawFragStrings) { + // get the variable swap dict, i'll need it for find-and-replacing... + __block NSMutableDictionary *varSwapNameDict = [varSwapNameDicts objectAtIndex:passIndex]; + // set up a bunch of other vars used to track where i am within the main image + __block BOOL beforeMainImage = YES; + __block BOOL afterMainImage = NO; + __block int mainImageFunctionBracketCount = 0; // ...in order to determine when i'm parsing text within the mainImage() function i need to keep a count of the brackets- when it hits 0, i've left the function! + __block NSRange thisLineRange = NSMakeRange(0,0); + __block NSRange mainImageFunctionRange = NSMakeRange(0,0); // the range of the full "mainImage" function (and all its vars and stuff) in the raw frag string + __block NSRange firstBracketOfMainImageFunction = NSMakeRange(0,0); + [rawFragString enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // update the range of this line within the raw frag string (we need to know the range because we're going to need to lex function calls that may span multiple lines) + thisLineRange.location = thisLineRange.location + thisLineRange.length; + thisLineRange.length = [line length]+1; + // make sure that the range is within the bounds of the raw frag string! + if (thisLineRange.location+thisLineRange.length>=[rawFragString length]) + thisLineRange.length = [rawFragString length]-thisLineRange.location; + + NSString *mainImageRegex = @"[\\r\\n\\s]*void[\\s]+(mainImage)"; + if ([line isMatchedByRegex:mainImageRegex]) { + // first of all, reset the mainImage function bracket count stuff, then increment it (if appropriate) + mainImageFunctionBracketCount = 0; + // the default variable names passed to mainImage (fragColor and fragCoord) may be different in this shader- we have to capture them to find out + NSRange mainImageStringRange = [line rangeOfRegex:mainImageRegex capture:1]; + mainImageStringRange.location += thisLineRange.location; + NSMutableArray *mainImageVars = MUTARRAY; + mainImageFunctionRange = [rawFragString lexFunctionCallInRange:mainImageStringRange addVariablesToArray:mainImageVars]; + // i still need to know where the first bracket of the mainImage() function is (it may be on another line, so i have to find it now) + NSRange tmpRange = NSMakeRange(mainImageFunctionRange.location+mainImageFunctionRange.length, 1); + while (firstBracketOfMainImageFunction.length<1) { + if ([[rawFragString substringWithRange:tmpRange] isEqualToString:@"{"]) { + firstBracketOfMainImageFunction = tmpRange; + } + ++tmpRange.location; + } + + + // if this line contains the bracket after the mainImage function... + if ((firstBracketOfMainImageFunction.length>0) && + ((firstBracketOfMainImageFunction.location+firstBracketOfMainImageFunction.length)<=(thisLineRange.location+thisLineRange.length))) { + // update the bracket count (only update the count if this line contains the first bracket after the mainImage function!) + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + // we're not longer before the mainImage function... + beforeMainImage = NO; + } + } + // else this line isn't the mainImage function + else { + //NSRange tmpRange; + + // if i'm before the mainImage function, do nothing + if (beforeMainImage && !afterMainImage) { + // if this line contains the bracket after the mainImage function... + if ((firstBracketOfMainImageFunction.length>0) && + ((firstBracketOfMainImageFunction.location+firstBracketOfMainImageFunction.length)<=(thisLineRange.location+thisLineRange.length))) { + // update the bracket count (only update the count if this line contains the first bracket after the mainImage function!) + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + // we're not longer before the mainImage function... + beforeMainImage = NO; + } + // else this line doesn't contain the bracket after the mainImage function + else { + // do nothing- we're "before the main image", but also before the first bracket of the mainImage function- we are most likely somewhere before or within the mainImage function declaration + } + } + // if i'm still within the mainImage function, replace occurrences of fragCoord and fragColor with their GLSL 1.2 equivalents + else if (!beforeMainImage && !afterMainImage) { + // update the count of mainImage function brackets in both directions + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + // if the mainImage bracket count hits 0, then i'm no longer within the mainImage function! + if (mainImageFunctionBracketCount<=0) + afterMainImage = YES; + } + // if i'm after the mainImage function... + else if (!beforeMainImage && afterMainImage) { + __block NSMutableString *newLine = [[NSMutableString stringWithCapacity:0] retain]; + [newLine appendString:line]; + //NSLog(@"\t\tbefore, newLine is %@",newLine); + LineFindAndReplaceBlock(newLine,varSwapNameDict,rawFragString,NSMakeRange(thisLineRange.location,[newLine length])); + //NSLog(@"\t\tafter, newLine is %@",newLine); + + + + [tmpMutString appendString:[newLine copy]]; + [tmpMutString appendString:@"\n"]; + + [newLine autorelease]; + } + } + + + /* + if (beforeMainImage) { + if ([line isMatchedByRegex:@"[\\r\\n\\s]*void[\\s]+mainImage"]) { + beforeMainImage = NO; + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + } + } + else if (!beforeMainImage && !afterMainImage) { + mainImageFunctionBracketCount += [[line componentsSeparatedByString:@"{"] count]; + mainImageFunctionBracketCount -= [[line componentsSeparatedByString:@"}"] count]; + if (mainImageFunctionBracketCount <= 0) + afterMainImage = YES; + } + else if (!beforeMainImage && afterMainImage) { + [tmpMutString appendString:line]; + [tmpMutString appendString:@"\n"]; + } + */ + }]; + + // increment the pass index + ++passIndex; + } + + + + // figure out if the source code uses the mouse var + BOOL usesMouseVar = [tmpMutString isMatchedByRegex:@"([^\\w_])(iMouse)([^\\w_])"]; + // if i'm using the mouse var, make 2d input for it + if (usesMouseVar) { + NSMutableArray *tmpInputs = [suppEntries objectForKey:@"INPUTS"]; + if (tmpInputs == nil) { + tmpInputs = MUTARRAY; + [suppEntries setObject:tmpInputs forKey:@"INPUTS"]; + } + + NSMutableDictionary *tmpInput = MUTDICT; + [tmpInputs addObject:tmpInput]; + [tmpInput setObject:@"iMouse" forKey:@"NAME"]; + [tmpInput setObject:@"point2D" forKey:@"TYPE"]; + // ...no min/max array, we want to pass in raw pixel coords + } + + + + // we're pretty much done, we just have to turn the supplemental entries dict into a JSON string and return it along with the modified source code + return VVFMTSTRING(@"/*\n%@\n*/\n\n%@",[suppEntries prettyJSONString],tmpMutString); +} + + +@end diff --git a/ISF Editor/ISFEditorAppDelegate.h b/ISF Editor/ISFEditorAppDelegate.h new file mode 100644 index 00000000..cdac4f5d --- /dev/null +++ b/ISF Editor/ISFEditorAppDelegate.h @@ -0,0 +1,106 @@ +// +// ISFEditorAppDelegate.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import +#import +#import +#import +#import +#import "ISFController.h" +#import "VVKQueueCenter.h" +//#import "RecOptsController.h" +#import "DynamicVideoSource.h" +#import +//#import +#import "DocController.h" +#import "ISFConverter.h" +#import "ISFPDownloader.h" +#import +#import "MouseView.h" + + + + +@interface ISFEditorAppDelegate : NSObject { + IBOutlet NSWindow *mainWindow; + + NSOpenGLContext *sharedContext; + + SyphonServer *syphonServer; + NSOpenGLContext *syphonServerContext; + + CVDisplayLinkRef displayLink; + VVBuffer *lastSourceBuffer; + int outputSource; // -1 if the post-ISF-filter output. if between 0 and 99, it's the index of the rendering pass to display. if it's between 100 and 199, it's the index of the image input to display (minus 100). if it's between 200 and 299, it's the index of the audio input to display (minus 200) + BOOL outputFreeze; + NSMutableDictionary *outputDict; + IBOutlet NSPopUpButton *outputSourcePUB; + IBOutlet NSButton *outputFreezeToggle; + IBOutlet MouseView *outputView; + IBOutlet NSTextField *outputResLabel; + + IBOutlet NSPopUpButton *videoSourcePUB; + DynamicVideoSource *videoSource; + + MutLockArray *filterList; + IBOutlet NSTableView *filterTV; + + //IBOutlet NSButton *textureToggle; + IBOutlet NSMatrix *textureMatrix; + + IBOutlet ISFController *isfController; + BOOL fetchShaders; + BOOL respondToTableSelectionChanges; + BOOL respondToFileChanges; + + IBOutlet DocController *docController; + IBOutlet ISFConverter *isfConverter; + IBOutlet ISFPDownloader *downloader; +} + +- (IBAction) importFromISFSite:(id)sender; +- (IBAction) importFromGLSLSandbox:(id)sender; +- (IBAction) importFromShadertoy:(id)sender; + +- (IBAction) openSystemISFFolderClicked:(id)sender; +- (IBAction) loadUserISFsClicked:(id)sender; +- (IBAction) loadSystemISFsClicked:(id)sender; + +- (IBAction) outputSourcePUBUsed:(id)sender; +- (IBAction) outputFreezeToggleUsed:(id)sender; +- (IBAction) outputShowAlphaToggleUsed:(id)sender; +- (IBAction) videoSourcePUBUsed:(id)sender; + +- (IBAction) installISFMediaFilesUsed:(id)sender; +- (IBAction) installISFQuickLookUsed:(id)sender; + +- (void) reloadFileFromTableView; + +// called by the isf converter- when it's done converting a file, it wants to display the converted shader +- (void) exportCompleteSelectFileAtPath:(NSString *)p; + +- (void) _isfFileReloaded; +- (void) _loadFilterList; + +- (void) _renderCallback; + +- (void) renderIntoBuffer:(VVBuffer *)b atTime:(double)t; // used to render for recording +- (void) reloadSelectedISF; +- (NSString *) targetFile; + +@property (assign,readwrite) BOOL fetchShaders; +@property (assign,readwrite) BOOL respondToTableSelectionChanges; +@property (assign,readwrite) BOOL respondToFileChanges; +- (NSMutableArray *) createSyntaxErrorsForForbiddenTermsInRawISFFile; + +@end + + + + +CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext); diff --git a/ISF Editor/ISFEditorAppDelegate.m b/ISF Editor/ISFEditorAppDelegate.m new file mode 100644 index 00000000..390f4e8f --- /dev/null +++ b/ISF Editor/ISFEditorAppDelegate.m @@ -0,0 +1,1450 @@ +// +// ISFEditorAppDelegate.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import "ISFEditorAppDelegate.h" +#import "VVMetadataItem.h" +#import +#import "MGSPreferencesController.h" +#import "AudioController.h" + + + + +@implementation ISFEditorAppDelegate + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + /* + // enable the professional video workflow + if ([VVSysVersion majorSysVersion] >= VVMavericks) { + NSLog(@"\t\trunning mavericks or better, enabling decoders"); + VTRegisterProfessionalVideoWorkflowVideoDecoders(); + if ([VVSysVersion majorSysVersion] >= VVYosemite) { + NSLog(@"\t\trunning yosemite or better, enabling encoders"); + VTRegisterProfessionalVideoWorkflowVideoEncoders(); + } + } + */ + + sharedContext = nil; + syphonServer = nil; + syphonServerContext = nil; + lastSourceBuffer = nil; + outputSource = -1; + outputFreeze = NO; + outputDict = nil; + + videoSource = nil; + filterList = [[MutLockArray alloc] init]; + //NSLog(@"\t\tfetchShaders is YES in %s",__func__); + fetchShaders = YES; + respondToTableSelectionChanges = YES; + respondToFileChanges = YES; + + // create the shared context and a buffer pool, set them up + sharedContext = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:nil]; + VVBufferPool *bp = [[VVBufferPool alloc] initWithSharedContext:sharedContext pixelFormat:[GLScene defaultPixelFormat] sized:NSMakeSize(640,480)]; + [VVBufferPool setGlobalVVBufferPool:bp]; + + [QCGLScene prepCommonQCBackendToRenderOnContext:sharedContext pixelFormat:[GLScene defaultPixelFormat]]; + + syphonServerContext = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:sharedContext]; + syphonServer = [[SyphonServer alloc] + initWithName:@"ISF Test App" + context:[syphonServerContext CGLContextObj] + options:nil]; + + videoSource = [[DynamicVideoSource alloc] init]; + [videoSource setDelegate:self]; + return self; + } + [self release]; + return nil; +} +- (void)dealloc { + VVRELEASE(lastSourceBuffer); + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- launch setup/teardown +/*------------------------------------*/ + + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + + // the buffer view, glsl controller, and copy thing need to use the shared context! + [outputView setSharedGLContext:sharedContext]; + [isfController setSharedGLContext:sharedContext]; + [VVBufferCopier createGlobalVVBufferCopierWithSharedContext:sharedContext]; + + lastSourceBuffer = [_globalVVBufferPool allocBGRTexSized:NSMakeSize(800,600)]; + [VVBufferCopier class]; + [_globalVVBufferCopier copyBlackFrameToThisBuffer:lastSourceBuffer]; + + //NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + /* + // load the syphon stuff, fake a click on the syphon PUB + syphonClient = nil; + syphonLastSelectedName = [def objectForKey:@"syphonLastSelectedName"]; + if (syphonLastSelectedName != nil) + [syphonLastSelectedName retain]; + [self _reloadSyphonPUB]; + */ + [self listOfStaticSourcesUpdated:nil]; + + // register the table view to receive file drops + [filterTV registerForDraggedTypes:[NSArray arrayWithObjects: NSFilenamesPboardType,NSURLPboardType,nil]]; + // if there's a folder from last time in the prefs, restore it now + [self _loadFilterList]; + // reload the table view + [filterTV reloadData]; + + /* + // register for notifications when syphon servers change + for (NSString *notificationName in [NSArray arrayWithObjects:SyphonServerAnnounceNotification, SyphonServerUpdateNotification, SyphonServerRetireNotification,nil]) { + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(_syphonServerChangeNotification:) + name:notificationName + object:nil]; + } + */ + // i want a quit notification so i can save stuff + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(_appAboutToQuitNotification:) + name:NSApplicationWillTerminateNotification + object:nil]; + + + // make the displaylink, which will drive rendering + CVReturn err = kCVReturnSuccess; + CGOpenGLDisplayMask totalDisplayMask = 0; + GLint virtualScreen = 0; + GLint displayMask = 0; + NSOpenGLPixelFormat *format = [GLScene defaultPixelFormat]; + + for (virtualScreen=0; virtualScreen<[format numberOfVirtualScreens]; ++virtualScreen) { + [format getValues:&displayMask forAttribute:NSOpenGLPFAScreenMask forVirtualScreen:virtualScreen]; + totalDisplayMask |= displayMask; + } + err = CVDisplayLinkCreateWithOpenGLDisplayMask(totalDisplayMask, &displayLink); + if (err) { + NSLog(@"\t\terr %d creating display link in %s",err,__func__); + displayLink = NULL; + } + else { + CVDisplayLinkSetOutputCallback(displayLink, displayLinkCallback, self); + CVDisplayLinkStart(displayLink); + } + + + // load the cube array QTZ included with the app so we have a default video source to work with + [videoSourcePUB selectItemWithTitle:@"Cube Array"]; + [self videoSourcePUBUsed:videoSourcePUB]; + //NSString *compPath = [[NSBundle mainBundle] pathForResource:@"Cube Array" ofType:@"qtz"]; + //[videoSource loadQCCompAtPath:compPath]; + + // we want to check and see if an ISF folder exists at /Library/Graphics/ISF- if it doesn't, we want to run the installer! + NSFileManager *fm = [NSFileManager defaultManager]; + BOOL isDirectory = NO; + if (![fm fileExistsAtPath:@"/Library/Graphics/ISF" isDirectory:&isDirectory] || !isDirectory) { + NSInteger alertRet = 0; + alertRet = VVRunAlertPanel(@"Install ISF files?", @"Do you want to install some standard ISF resources on your machine?\n\nYou can install them later from the \"Help\" menu if you decline.", @"Yes", @"No",nil); + if (alertRet == NSAlertFirstButtonReturn) + [self installISFMediaFilesUsed:nil]; + } + + // has the ISF editor been updated since it was last launched/is this a "new" vsn of the ISF editor? + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + NSString *lastVersString = [def objectForKey:@"lastLaunchVersion"]; + NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; + NSString *thisVersString = [infoDict objectForKey:@"CFBundleGetInfoString"]; + if (lastVersString==nil || + (lastVersString!=nil && thisVersString!=nil && ![lastVersString isEqualToString:thisVersString])) { + // if the ISF quicklook plugin doesn't exist + if (![fm fileExistsAtPath:@"/Library/QuickLook/ISFQL"]) { + // show an alert asking if the user would like to install the ISF quicklook plugin + NSInteger alertRet = 0; + alertRet = VVRunAlertPanel(@"Install ISF QuickLook plugin?", @"Do you want to install a QuickLook plugin that will let you preview ISF files in the Finder?\n\nYou can install it later from the \"Help\" menu if you decline.", @"Yes", @"No", nil); + if (alertRet == NSAlertFirstButtonReturn) + [self installISFQuickLookUsed:nil]; + } + [def setObject:thisVersString forKey:@"lastLaunchVersion"]; + [def synchronize]; + } +} +- (void) _appAboutToQuitNotification:(NSNotification *)note { + /* + NSString *tmpString = nil; + @synchronized (self) { + tmpString = (syphonLastSelectedName==nil) ? nil : [syphonLastSelectedName copy]; + } + if (tmpString==nil) + return; + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + [def setObject:tmpString forKey:@"syphonLastSelectedName"]; + */ +} + + +/*===================================================================================*/ +#pragma mark --------------------- callbacks in response to changes +/*------------------------------------*/ + + +- (void) listOfStaticSourcesUpdated:(id)ds { + //NSLog(@"%s",__func__); + // get the title of the currently-selected item + NSString *lastTitle = [videoSourcePUB titleOfSelectedItem]; + // reload the contents of the pop-up button + NSMenu *newMenu = [videoSource allocStaticSourcesMenu]; + [videoSourcePUB setMenu:newMenu]; + [newMenu release]; + newMenu = nil; + // try to select an item with the same title as the last-selected item- if i can't, select nil and stop the source + NSMenuItem *newLastItem = (lastTitle==nil) ? nil : [videoSourcePUB itemWithTitle:lastTitle]; + if (newLastItem != nil) + [videoSourcePUB selectItem:newLastItem]; + else { + [videoSourcePUB selectItem:nil]; + [videoSource eject]; + } +} +- (void) file:(NSString *)p changed:(u_int)fflag { + //NSLog(@"%s ... %@",__func__,p); + [self _loadFilterList]; + [filterTV reloadData]; + //[self setFetchShaders:YES]; + + if (![self respondToFileChanges]) + return; + + // if the scene's file is nil, but the controller's target file isn't, tell the scene to reload + if ([[isfController scene] filePath]==nil && [isfController targetFile]!=nil) { + [isfController reloadTargetFile]; + //NSLog(@"\t\tfetchShaders is YES in %s",__func__); + fetchShaders = YES; + } +} +- (void) _isfFileReloaded { + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self _isfFileReloaded]; + }); + return; + } + //NSLog(@"%s",__func__); + NSNumber *oldRepObj = [[outputSourcePUB selectedItem] representedObject]; + NSMenu *theMenu = [outputSourcePUB menu]; + NSMenuItem *tmpItem = nil; + int maxPassCount = [[isfController scene] passCount]; + int imageInputsCount = [[isfController scene] imageInputsCount]; + int audioInputsCount = [[isfController scene] audioInputsCount]; + // remove all the items from the existing pop-up button + [outputSourcePUB removeAllItems]; + // add an item for the main output + tmpItem = [[NSMenuItem alloc] + initWithTitle:@"Main Output" + action:nil + keyEquivalent:@""]; + [tmpItem setRepresentedObject:NUMINT(-1)]; + [theMenu addItem:tmpItem]; + [tmpItem release]; + + if (maxPassCount > 1) { + // add a separator + [theMenu addItem:[NSMenuItem separatorItem]]; + // add menu items for the passes + for (int i=0; i 0) { + // add a separator + [theMenu addItem:[NSMenuItem separatorItem]]; + // add menu items for the image inputs + for (int i=0; i 0) { + // add a separator + [theMenu addItem:[NSMenuItem separatorItem]]; + // add menu items for the audio inputs + for (int i=0; i0) { + if ([typeTree containsObject:@"org.khronos.glsl.fragment-shader"]) { + //[docController listDirectoryAndLoadFile:urlPath]; + [[NSUserDefaults standardUserDefaults] setObject:[urlPath stringByDeletingLastPathComponent] forKey:@"fxPath"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + // reload the filter list (loads the files from "fxPath" from the user defaults) + [self _loadFilterList]; + // reload the table view + [filterTV reloadData]; + + NSInteger fileIndex = [filterList lockIndexOfObject:urlPath]; + if (fileIndex>=0 && fileIndex!=NSNotFound) { + [filterTV selectRowIndexes:[NSIndexSet indexSetWithIndex:fileIndex] byExtendingSelection:NO]; + } + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; + } + else if ([typeTree containsObject:@"public.folder"]) { + //[docController listDirectory:urlPath]; + [[NSUserDefaults standardUserDefaults] setObject:urlPath forKey:@"fxPath"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + // reload the filter list (loads the files from "fxPath" from the user defaults) + [self _loadFilterList]; + // reload the table view + [filterTV reloadData]; + + // tell the table view to select the item at the dst index + [filterTV deselectAll:nil]; + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; + } + else + NSLog(@"\t\terr: unrecognized type tree in %s for item \"%@\": %@",__func__,urlPath,typeTree); + } + + // update the defaults so i know where the law directory i browsed was + NSString *directoryString = [urlPath stringByDeletingLastPathComponent]; + [[NSUserDefaults standardUserDefaults] setObject:directoryString forKey:@"lastOpenDocumentFolder"]; + [[NSUserDefaults standardUserDefaults] setObject:urlPath forKey:@"lastOpenDocumentFile"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + }]; + VVRELEASE(op); +} +- (IBAction) openMediaDocument:(id)sender { + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + NSString *importDir = [def objectForKey:@"lastOpenMediaDocumentFolder"]; + if (importDir == nil) + importDir = [@"~/Desktop" stringByExpandingTildeInPath]; + NSString *importFile = [def objectForKey:@"lastOpenMediaDocumentFile"]; + NSOpenPanel *op = [[NSOpenPanel openPanel] retain]; + [op setAllowsMultipleSelection:NO]; + [op setCanChooseDirectories:NO]; + [op setResolvesAliases:YES]; + [op setMessage:@"Select a movie, image file, or QC composition to open"]; + [op setTitle:@"Open file"]; + //[op setAllowedFileTypes:OBJSARRAY(@"mov",@"mp4",@"mpg",@"qtz","tiff","jpg","jpeg","png")]; + //[op setDirectoryURL:[NSURL fileURLWithPath:importDir]]; + if (importFile != nil) + [op setDirectoryURL:[NSURL fileURLWithPath:importFile]]; + else + [op setDirectoryURL:[NSURL fileURLWithPath:importDir]]; + + [op + beginSheetModalForWindow:mainWindow + completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + // get the inspected object + NSArray *fileURLs = [op URLs]; + NSURL *urlPtr = (fileURLs==nil) ? nil : [fileURLs objectAtIndex:0]; + NSString *urlPath = (urlPtr==nil) ? nil : [urlPtr path]; + VVMetadataItem *mdItem = (urlPath==nil) ? nil : [VVMetadataItem createWithPath:urlPath]; + NSArray *typeTree = (mdItem==nil) ? nil : [mdItem valueForAttribute:(id)kMDItemContentTypeTree]; + if (typeTree!=nil && [typeTree count]>0) { + if ([typeTree containsObject:@"public.movie"]) + [videoSource loadMovieAtPath:urlPath]; + else if ([typeTree containsObject:@"com.apple.quartz-composer-composition"]) + [videoSource loadQCCompAtPath:urlPath]; + else if ([typeTree containsObject:@"public.image"]) + [videoSource loadImgAtPath:urlPath]; + else + NSLog(@"\t\terr: unrecognized type tree in %s for item \"%@\": %@",__func__,urlPath,typeTree); + } + + // update the defaults so i know where the law directory i browsed was + NSString *directoryString = [urlPath stringByDeletingLastPathComponent]; + [[NSUserDefaults standardUserDefaults] setObject:directoryString forKey:@"lastOpenMediaDocumentFolder"]; + [[NSUserDefaults standardUserDefaults] setObject:urlPath forKey:@"lastOpenMediaDocumentFile"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + }]; + VVRELEASE(op); +} +- (IBAction) saveDocument:(id)sender { + //NSLog(@"%s",__func__); + [docController saveOpenFile]; +} +- (IBAction) newDocument:(id)sender { + //NSLog(@"%s",__func__); + [docController createNewFile]; + [isfController loadFile:@"/tmp/ISFTesterTmpFile.fs"]; +} +- (IBAction)showPreferencesWindow:(id)sender { + [[MGSPreferencesController sharedPrefsWindowController] showWindow:self]; +} +- (IBAction) openSystemISFFolderClicked:(id)sender { + NSFileManager *fm = [NSFileManager defaultManager]; + NSURL *fileURL = [NSURL fileURLWithPath:@"/Library/Graphics/ISF/"]; + if (![fm fileExistsAtPath:[fileURL path] isDirectory:nil]) { + [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:OBJARRAY(fileURL)]; + } +} +- (IBAction) loadUserISFsClicked:(id)sender { + + NSString *tmpPath = [@"~/Library/Graphics/ISF/" stringByExpandingTildeInPath]; + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + [def setObject:tmpPath forKey:@"fxPath"]; + [def synchronize]; + + // if the path doesn't exist, create it + NSFileManager *fm = [NSFileManager defaultManager]; + if (![fm fileExistsAtPath:tmpPath isDirectory:nil]) { + //NSLog(@"\t\tfolder %@ doesn't exist yet, needs to be created...",tmpPath); + NSError *nsErr = nil; + if (![fm createDirectoryAtPath:tmpPath withIntermediateDirectories:YES attributes:nil error:&nsErr]) { + NSLog(@"\t\terr creating directory for path %@",tmpPath); + NSLog(@"\t\terr was %@",nsErr); + } + //else + // NSLog(@"\t\tfolder %@ successfully created",tmpPath); + } + + // reload the filter list (loads the files from "fxPath" from the user defaults) + [self _loadFilterList]; + + // reload the table view + [filterTV reloadData]; + // tell the table view to select the item at the dst index + [filterTV deselectAll:nil]; + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; +} +- (IBAction) loadSystemISFsClicked:(id)sender { + NSString *tmpPath = @"/Library/Graphics/ISF/"; + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + [def setObject:tmpPath forKey:@"fxPath"]; + [def synchronize]; + + // reload the filter list (loads the files from "fxPath" from the user defaults) + [self _loadFilterList]; + + // reload the table view + [filterTV reloadData]; + // tell the table view to select the item at the dst index + [filterTV deselectAll:nil]; + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; +} +- (IBAction) outputSourcePUBUsed:(id)sender { + NSMenuItem *selectedItem = [outputSourcePUB selectedItem]; + id repObj = [selectedItem representedObject]; + @synchronized (self) { + if (repObj != nil) { + if ([repObj isKindOfClass:[NSNumber class]]) { + outputSource = [(NSNumber *)repObj intValue]; + //NSLog(@"\t\toutputSource is %d",outputSource); + } + /* + else if ([repObj isKindOfClass:[NSString class]]) { + ISFAttrib *attrib = [[isfController scene] attribForInputWithKey:repObj]; + outputSource = 100+[[[isfController scene] imageInputs] lockIndexOfIdenticalPtr:attrib]; + } + */ + } + } + + + /* + NSMenuItem *selectedItem = [outputSourcePUB selectedItem]; + NSNumber *representedNum = [selectedItem representedObject]; + @synchronized (self) { + if (representedNum!=nil && [representedNum isKindOfClass:[NSNumber class]]) { + outputSource = [representedNum intValue]; + //NSLog(@"\t\toutputSource is now %ld",outputSource); + } + } + */ +} +- (IBAction) outputFreezeToggleUsed:(id)sender { + @synchronized (self) { + outputFreeze = ([sender intValue]!=NSOnState) ? NO : YES; + } +} +- (IBAction) outputShowAlphaToggleUsed:(id)sender { + @synchronized (self) { + ISFGLScene *scene = [outputView localISFScene]; + if (scene != nil) { + [scene + setNSObjectVal:([sender intValue]==NSOnState) ? NUMBOOL(YES) : NUMBOOL(NO) + forInputKey:@"viewAlpha"]; + } + } +} +/* +- (IBAction) syphonPUBUsed:(id)sender { + //NSLog(@"%s",__func__); + + + int selectedIndex = [syphonPUB indexOfSelectedItem]; + NSMenuItem *selectedItem = [syphonPUB selectedItem]; + if (selectedItem!=nil && selectedIndex>0 && selectedIndex!=NSNotFound) { + @synchronized (self) { + if (syphonLastSelectedName!=nil) + [syphonLastSelectedName release]; + syphonLastSelectedName = [[selectedItem title] retain]; + } + + NSDictionary *serverDict = [selectedItem representedObject]; + @synchronized (self) { + if (syphonClient != nil) + [syphonClient release]; + syphonClient = nil; + if (serverDict != nil) { + syphonClient = [[SyphonClient alloc] + initWithServerDescription:serverDict + options:nil + newFrameHandler:nil]; + } + } + } + else { + if (syphonClient != nil) { + [syphonClient release]; + syphonClient = nil; + } + } +} +*/ +- (IBAction) videoSourcePUBUsed:(id)sender { + //NSLog(@"%s",__func__); + NSMenuItem *selectedItem = [videoSourcePUB selectedItem]; + id repObj = [selectedItem representedObject]; + @synchronized (self) { + if (repObj != nil) { + //NSLog(@"\t\trepresentedObject is \"%@\"",(id)repObj); + if ([repObj isKindOfClass:[NSURL class]]) { + [videoSource loadQCCompAtPath:(NSString *)[repObj path]]; + } + else if ([repObj isKindOfClass:[NSString class]]) { + [videoSource loadVidInWithUniqueID:repObj]; + } + else if ([repObj isKindOfClass:[NSDictionary class]]) { + [videoSource loadSyphonServerWithDescription:repObj]; + } + } + } +} +- (IBAction) installISFMediaFilesUsed:(id)sender { + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath:@"/usr/bin/open"]; + NSString *installerPath = [[NSBundle mainBundle] pathForResource:@"Vidvox ISF resources" ofType:@"pkg"]; + if (installerPath != nil) { + [task setArguments:[NSArray arrayWithObject:installerPath]]; + [task launch]; + } + [task autorelease]; +} +- (IBAction) installISFQuickLookUsed:(id)sender { + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath:@"/usr/bin/open"]; + NSString *installerPath = [[NSBundle mainBundle] pathForResource:@"ISF QuickLook Plugin" ofType:@"pkg"]; + if (installerPath != nil) { + [task setArguments:[NSArray arrayWithObject:installerPath]]; + [task launch]; + } + [task autorelease]; +} + + +/* +- (void) _syphonServerChangeNotification:(NSNotification *)note { + //NSLog(@"%s",__func__); + [self _reloadSyphonPUB]; +} +- (void) _reloadSyphonPUB { + //NSLog(@"%s",__func__); + // first reload the pop up button + SyphonServerDirectory *sd = [SyphonServerDirectory sharedDirectory]; + NSArray *servers = (sd==nil) ? nil : [sd servers]; + if (servers!=nil) { + NSMenu *pubMenu = [syphonPUB menu]; + [pubMenu removeAllItems]; + [pubMenu addItemWithTitle:@"-" action:nil keyEquivalent:@""]; + for (NSDictionary *serverDict in servers) { + NSString *serverName = [NSString stringWithFormat:@"%@-%@",[serverDict objectForKey:SyphonServerDescriptionAppNameKey],[serverDict objectForKey:SyphonServerDescriptionNameKey]]; + NSMenuItem *serverItem = [[NSMenuItem alloc] + initWithTitle:serverName + action:nil + keyEquivalent:@""]; + [serverItem setEnabled:YES]; + [serverItem setRepresentedObject:[[serverDict copy] autorelease]]; + [pubMenu addItem:serverItem]; + } + } + // try to select the last-selected syphon server + NSString *tmpString = nil; + @synchronized (self) { + tmpString = (syphonLastSelectedName==nil) ? nil : [syphonLastSelectedName retain]; + } + if (tmpString==nil) + [syphonPUB selectItemAtIndex:0]; + else { + [syphonPUB selectItemWithTitle:tmpString]; + [tmpString release]; + tmpString = nil; + } + [self syphonPUBUsed:syphonPUB]; +} +*/ + + +/*===================================================================================*/ +#pragma mark --------------------- rendering +/*------------------------------------*/ + + +- (void) _renderCallback { + //NSLog(@"%s",__func__); + + // tell the audio controller to task + [_globalAudioController updateAudioResults]; + + // get a frame from syphon + //VVBuffer *syphonBuffer = nil; + VVBuffer *buffer2d = nil; + VVBuffer *outBuffer = nil; + //BOOL use2D = ([textureToggle intValue]==NSOnState) ? YES : NO; + NSUInteger textureMatrixVal = (textureMatrix==nil) ? 0 : [textureMatrix selectedRow]; + NSMutableDictionary *newOutDict = MUTDICT; + int localOutputSource = -1; + BOOL localOutputFreeze = NO; + + @synchronized (self) { + if (videoSource!=nil) { + VVRELEASE(lastSourceBuffer); + lastSourceBuffer = [videoSource allocBuffer]; + } + /* + if (syphonClient!=nil && [syphonClient hasNewFrame]) { + syphonBuffer = [_globalVVBufferPool allocBufferForSyphonClient:syphonClient]; + VVRELEASE(lastSourceBuffer); + lastSourceBuffer = [syphonBuffer retain]; + } + */ + localOutputSource = outputSource; + localOutputFreeze = outputFreeze; + } + + if (lastSourceBuffer != nil) { + @try { + // this bit here makes a GL_TEXTURE_2D-based buffer and copies the syphon image into it + /* + if (use2D) { + buffer2d = [_globalVVBufferPool allocBGR2DPOTTexSized:[lastSourceBuffer srcRect].size]; + [_globalVVBufferCopier ignoreSizeCopyThisBuffer:lastSourceBuffer toThisBuffer:buffer2d]; + [buffer2d setSrcRect:[lastSourceBuffer srcRect]]; + } + */ + //NSLog(@"\t\tlastSourceBuffer is %@",lastSourceBuffer); + VVBuffer *srcBuffer = nil; + if (lastSourceBuffer!=nil) { + switch (textureMatrixVal) { + case 0: // nothing specified/rect + //NSLog(@"\t\ttexture mode is rect"); + if ([lastSourceBuffer target]!=GL_TEXTURE_RECTANGLE_EXT) { + srcBuffer = [_globalVVBufferPool allocBGRTexSized:[lastSourceBuffer srcRect].size]; + [_globalVVBufferCopier ignoreSizeCopyThisBuffer:lastSourceBuffer toThisBuffer:srcBuffer]; + [srcBuffer setSrcRect:[lastSourceBuffer srcRect]]; + //NSLog(@"\t\tsrcBuffer is %@",srcBuffer); + } + else + srcBuffer = [lastSourceBuffer retain]; + break; + case 1: // 2D + //NSLog(@"\t\ttexture mode is 2D"); + if (![lastSourceBuffer isPOT2DTex]) { + srcBuffer = [_globalVVBufferPool allocBGR2DPOTTexSized:[lastSourceBuffer srcRect].size]; + [_globalVVBufferCopier ignoreSizeCopyThisBuffer:lastSourceBuffer toThisBuffer:srcBuffer]; + [srcBuffer setSrcRect:[lastSourceBuffer srcRect]]; + //NSLog(@"\t\tsrcBuffer is %@",srcBuffer); + } + else + srcBuffer = [lastSourceBuffer retain]; + break; + case 2: // NPOT 2D + //NSLog(@"\t\ttexture mode is NPOT 2D"); + if (![lastSourceBuffer isNPOT2DTex]) { + srcBuffer = [_globalVVBufferPool allocBGR2DTexSized:[lastSourceBuffer srcRect].size]; + [_globalVVBufferCopier ignoreSizeCopyThisBuffer:lastSourceBuffer toThisBuffer:srcBuffer]; + [srcBuffer setSrcRect:[lastSourceBuffer srcRect]]; + //NSLog(@"\t\tsrcBuffer is %@",srcBuffer); + } + else + srcBuffer = [lastSourceBuffer retain]; + break; + } + } + + outBuffer = [isfController renderFXOnThisBuffer:srcBuffer passDict:newOutDict]; + + @synchronized (self) { + if (fetchShaders) { + NSString *tmpString = nil; + NSMutableDictionary *contentDict = MUTDICT; + + tmpString = [[isfController scene] jsonString]; + if (tmpString!=nil) + [contentDict setObject:tmpString forKey:@"json"]; + tmpString = [[isfController scene] vertexShaderString]; + if (tmpString!=nil) + [contentDict setObject:tmpString forKey:@"vertex"]; + tmpString = [[isfController scene] fragmentShaderString]; + if (tmpString!=nil) + [contentDict setObject:tmpString forKey:@"fragment"]; + + // we only want to proceed if we have a json/vert/frag shader (if we don't, we need to try again later) + if ([contentDict count]==3) { + NSMutableArray *syntaxErrArray = [self createSyntaxErrorsForForbiddenTermsInRawISFFile]; + NSArray *origSyntaxErrArray = [contentDict objectForKey:@"syntaxErr"]; + if (origSyntaxErrArray!=nil && [origSyntaxErrArray count]>0) { + if (syntaxErrArray == nil) + syntaxErrArray = MUTARRAY; + [syntaxErrArray addObjectsFromArray:origSyntaxErrArray]; + } + NSLog(@"\t\tsyntaxErrArray is %@",syntaxErrArray); + if (syntaxErrArray != nil && [syntaxErrArray count]>0) + [contentDict setObject:syntaxErrArray forKey:@"syntaxErr"]; + + /* + // run through the raw frag shader string, looking for "forbidden" terms (texture2D, texture2DRect, sampler2D, sampler2DRect), and creating errors for them + NSArray *forbiddenTerms = @[@"texture2DRectProjLod",@"texture2DRectProj",@"texture2DRect",@"texture2DProjLod",@"texture2DProj",@"texture2D",@"sampler2DRect",@"sampler2D"]; + NSString *forbiddenTermsRegex = @"((texture2D(Rect)?(Proj)?(Lod)?)|(sampler2D(Rect)?))"; + NSString *precompiledFragSrc = [[isfController scene] fragShaderSource]; + NSString *jsonSrc = [[isfController scene] jsonSource]; + //NSInteger lineDelta = [jsonSrc numberOfLines]; + __block NSInteger lineIndex = [jsonSrc numberOfLines] + 1; + NSMutableArray *syntaxErrArray = MUTARRAY; + // run through all the lines in the precompiled shader + [precompiledFragSrc enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // if the line matches the 'forbidden terms' regex... + if ([line isMatchedByRegex:forbiddenTermsRegex]) { + // run through all the forbidden terms to figure out which one is in the line + for (NSString *forbiddenTerm in forbiddenTerms) { + if ([line containsString:forbiddenTerm]) { + // make a syntax error, add it to the array + SMLSyntaxError *err = [[[SMLSyntaxError alloc] init] autorelease]; + [err setLine:(int)lineIndex]; + [err setCharacter:0]; + [err setCode:forbiddenTerm]; + [err setDescription:VVFMTSTRING(@"Warning: \'%@\' may not always work!",forbiddenTerm)]; + [err setLength:1]; + [syntaxErrArray addObject:err]; + + break; + } + } + } + ++lineIndex; + }]; + // if there are syntax errors, add the array of errors to the content dict + if ([syntaxErrArray count]>0) + [contentDict setObject:syntaxErrArray forKey:@"syntaxErr"]; + */ + + + //NSLog(@"\t\tfetching shaders- loading non-file content dict %p in %s",contentDict,__func__); + dispatch_async(dispatch_get_main_queue(), ^{ + [docController loadNonFileContentDict:contentDict]; + }); + + //NSLog(@"\t\tfetchShaders is NO in %s",__func__); + fetchShaders = NO; + } + } + + // if the local output isn't frozen, update the output dict + if (!localOutputFreeze) { + VVRELEASE(outputDict); + outputDict = [newOutDict retain]; + } + // else the output's frozen- get rid of the new output dict, use the old one + else { + [newOutDict removeAllObjects]; + newOutDict = outputDict; + } + } + + + //NSLog(@"\t\tlocalOutputSource is %d",localOutputSource); + //NSLog(@"\t\tnewOutDict is %@",newOutDict); + VVBuffer *displayBuffer = [newOutDict objectForKey:NUMINT(localOutputSource)]; + //NSLog(@"\t\tdisplayBuffer is %@",displayBuffer); + if (displayBuffer==nil) { + //NSLog(@"\t\terr: displayBuffer was nil, localOutputSource was %d dict was %@",localOutputSource,newOutDict); + displayBuffer = srcBuffer; + } + [outputView drawBuffer:displayBuffer]; + /* + [outputView drawBuffer:(outBuffer!=nil) ? outBuffer : ((use2D) ? buffer2d : lastSourceBuffer)]; + */ + NSSize bufferSize = [displayBuffer srcRect].size; + NSString *resString = VVFMTSTRING(@"%d x %d",(int)bufferSize.width,(int)bufferSize.height); + NSString *currentResString = [outputResLabel stringValue]; + if (currentResString==nil || ![currentResString isEqualToString:resString]) { + //dispatch_async(dispatch_get_main_queue(), ^{ + [outputResLabel setStringValue:resString]; + //}); + } + + // pass the rendered frame to the syphon server + if (syphonServer!=nil) { + VVBuffer *preFXBuffer = srcBuffer; + if (outBuffer!=nil) { + [syphonServer + publishFrameTexture:[outBuffer name] + textureTarget:[outBuffer target] + imageRegion:[outBuffer srcRect] + textureDimensions:[outBuffer size] + flipped:[outBuffer flipped]]; + } + else if (preFXBuffer!=nil) { + [syphonServer + publishFrameTexture:[preFXBuffer name] + textureTarget:[preFXBuffer target] + imageRegion:[preFXBuffer srcRect] + textureDimensions:[preFXBuffer size] + flipped:[preFXBuffer flipped]]; + } + } + + VVRELEASE(srcBuffer); + } + @catch (NSException *err) { + NSLog(@"\t\t%scaught exception %@",__func__,err); + @synchronized (self) { + //NSLog(@"\t\tfetchShaders is NO in %s",__func__); + fetchShaders = NO; + } + //dispatch_async(dispatch_get_main_queue(), ^{ + // assemble a dictionary (contentDict) that describes the error + NSMutableDictionary *contentDict = MUTDICT; + NSString *reason = [err name]; + NSMutableString *errString = [NSMutableString stringWithCapacity:0]; + __block NSMutableArray *syntaxErrorArray = MUTARRAY; + [errString appendString:@""]; + if ([reason isEqualToString:@"Shader Problem"]) { + NSDictionary *userInfo = [err userInfo]; + NSString *tmpLog = nil; + tmpLog = (userInfo==nil) ? nil : [userInfo objectForKey:@"linkErrLog"]; + if (tmpLog!=nil) + [errString appendFormat:@"OpenGL link error:\n%@",tmpLog]; + + + // this block parses a passed string, locates a specific number value, and adds to it the passed "_lineDelta" value. used to locate and change GLSL error logs. if _syntaxErrArray is non-nil, SMLSyntaxErrors will be created and added to it. + NSString* (^glslErrLogLineNumberChanger)(NSString *_lineIn, NSInteger _lineDelta, NSMutableArray *_syntaxErrArray) = ^(NSString *_lineIn, NSInteger _lineDelta, NSMutableArray *_syntaxErrArray) { + NSString *returnMe = nil; + NSString *regexString = @"([0-9]+[\\W])([0-9]+)"; + NSRange regexRange = [_lineIn rangeOfRegex:regexString]; + // if this line doesn't match the regex string, just append it + if (regexRange.location==NSNotFound || regexRange.length<1) { + returnMe = _lineIn; + } + // else this line contains the numbers i want to modify, replace them + else { + // capture the vals i want + NSArray *capturedValsArray = [_lineIn captureComponentsMatchedByRegex:regexString]; + //NSLog(@"\t\tcapturedValsArray is %@",capturedValsArray); + // if i couldn't capture the numbers i want, just append the whole line + if (capturedValsArray==nil || [capturedValsArray count]!=3) { + NSLog(@"\t\terr: capturedValsArray didn't have the correct number of elements, unable to correct line numbers in %s",__func__); + returnMe = _lineIn; + } + // else i captured vals- time to put together the new line! + else { + // first, copy everything in the line *before* the regex + //[errString appendString:[_lineIn substringToIndex:regexRange.location]]; + // now copy the first thing i captured (index 1 in the array)- this is presumably the file number + //[errString appendString:[capturedValsArray objectAtIndex:1]]; + // the second thing i captured (index 2 in the array) is the line number- modify it, then add it to the string + //[errString appendFormat:@"%d",[[[capturedValsArray objectAtIndex:2] numberByEvaluatingString] intValue] + _lineDelta]; + // copy everything in the line *after* the regex + //[errString appendString:[_lineIn substringFromIndex:regexRange.location+regexRange.length]]; + + // ...this is all of the above in one line + returnMe = VVFMTSTRING(@"%@%@%ld%@",[_lineIn substringToIndex:regexRange.location],[capturedValsArray objectAtIndex:1],([[[capturedValsArray objectAtIndex:2] numberByEvaluatingString] intValue] + _lineDelta),[_lineIn substringFromIndex:regexRange.location+regexRange.length]); + + // if i was passed a syntax error array to populate, create a syntax error and add it to the array + if (_syntaxErrArray!=nil) { + SMLSyntaxError *err = [[[SMLSyntaxError alloc] init] autorelease]; + [err setLine:[[[capturedValsArray objectAtIndex:2] numberByEvaluatingString] intValue] + (int)_lineDelta]; + [err setCharacter:0]; + //[err setCode:@"CodeString"]; + [err setCode:[_lineIn substringFromIndex:regexRange.location+regexRange.length]]; + [err setDescription:[_lineIn substringFromIndex:regexRange.location+regexRange.length]]; + [err setLength:1]; + [_syntaxErrArray addObject:err]; + } + } + } + return returnMe; + }; + + + + // if there's a vertex error log, parse it line-by-line, adjusting the line numbers to compensate for changes to the shader + tmpLog = (userInfo==nil) ? nil : [userInfo objectForKey:@"vertErrLog"]; + if (tmpLog!=nil) { + [errString appendString:@"OpenGL vertex shader error:\n"]; + // figure out the difference in line numbers between the compiled vert shader and the raw ISF file + NSInteger lineDelta = 0; + NSString *compiledVertSrc = [userInfo objectForKey:@"vertSrc"]; + NSString *precompiledVertSrc = [[isfController scene] vertShaderSource]; + if (compiledVertSrc!=nil && precompiledVertSrc!=nil) { + // the compiled vertex shader has stuff added to both the beginning and the end- the first line added to the end of the raw vertex shader source is: + NSString *firstLineAppendedToVS = @"\nvoid vv_vertShaderInit(void)\t{"; + NSRange rangeOfEndOfVS = [compiledVertSrc rangeOfString:firstLineAppendedToVS]; + if (rangeOfEndOfVS.location==NSNotFound || rangeOfEndOfVS.length!=[firstLineAppendedToVS length]) { + NSLog(@"\t\tERR: couldn't locate end of precompiled shader in compiled vertex shader, %s",__func__); + lineDelta = 0; + } + else { + NSInteger numberOfLinesAppendedToVS = [[compiledVertSrc substringFromIndex:rangeOfEndOfVS.location] numberOfLines]; + lineDelta = [precompiledVertSrc numberOfLines] - ([compiledVertSrc numberOfLines]-numberOfLinesAppendedToVS); + } + } + // if there's no difference in line numbers, just copy the error log in its entirety + if (lineDelta==0) { + [errString appendString:tmpLog]; + } + // else there's a difference in line numbers, run through each line of the log- i'm looking for line numbers to replace + else { + [tmpLog enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // run the block that changes the line numbers for the glsl error log + [errString appendString:glslErrLogLineNumberChanger(line, lineDelta, nil)]; + // always append a newline! + [errString appendString:@"\n"]; + }]; + } + + /* + [errString appendFormat:@"OpenGL vertex shader error:\n%@",tmpLog]; + */ + } + + // if there's a fragment error log, parse it line-by-line, adjusting the line numbers to compensate for changes to the shader + tmpLog = (userInfo==nil) ? nil : [userInfo objectForKey:@"fragErrLog"]; + if (tmpLog!=nil) { + [errString appendString:@"OpenGL fragment shader error:\n"]; + // figure out the difference in line numbers between the compiled frag shader and the raw ISF file + NSInteger lineDelta = 0; + NSString *compiledFragSrc = [userInfo objectForKey:@"fragSrc"]; + NSString *precompiledFragSrc = [[isfController scene] fragShaderSource]; + NSString *jsonSrc = [[isfController scene] jsonSource]; + if (compiledFragSrc!=nil && precompiledFragSrc!=nil && jsonSrc!=nil) { + lineDelta = ([precompiledFragSrc numberOfLines]+[jsonSrc numberOfLines]) - [compiledFragSrc numberOfLines]; + } + // if there's no difference in line numbers, just copy the error log in its entirety + if (lineDelta==0) { + [errString appendString:tmpLog]; + } + // else there's a difference in line numbers, run through each line of the log- i'm looking for line numbers to replace + else { + [tmpLog enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // run the block that changes the line numbers for the glsl error log + [errString appendString:glslErrLogLineNumberChanger(line, lineDelta, syntaxErrorArray)]; + // always append a newline! + [errString appendString:@"\n"]; + }]; + } + } + } + else { + [errString appendFormat:@"%@-%@",[err name],[err reason]]; + } + [contentDict setObject:errString forKey:@"error"]; + + //[contentDict setObject:syntaxErrorArray forKey:@"syntaxErr"]; + NSArray *origSyntaxErrArray = [contentDict objectForKey:@"syntaxErr"]; + if (origSyntaxErrArray!=nil && [origSyntaxErrArray count]>0) { + [syntaxErrorArray addObjectsFromArray:origSyntaxErrArray]; + } + if (syntaxErrorArray != nil) + [contentDict setObject:syntaxErrorArray forKey:@"syntaxErr"]; + + + // populate contentDict with the source code compiled and in use by the GL scene + NSString *tmpString = nil; + + tmpString = [[isfController scene] jsonString]; + if (tmpString==nil) + tmpString = @""; + [contentDict setObject:tmpString forKey:@"json"]; + + tmpString = [[isfController scene] vertexShaderString]; + if (tmpString == nil) + tmpString = @""; + [contentDict setObject:tmpString forKey:@"vertex"]; + + tmpString = [[isfController scene] fragmentShaderString]; + if (tmpString == nil) + tmpString = @""; + [contentDict setObject:tmpString forKey:@"fragment"]; + + + // kill stuff so i don't keep displaying the error... + [isfController loadFile:nil]; + + + NSLog(@"\t\tcaught exception: loading non-file content dict %p in %s",contentDict,__func__); + // tell the doc controller to load the dict of error stuff i assembled + dispatch_async(dispatch_get_main_queue(), ^{ + [docController loadNonFileContentDict:contentDict]; + }); + + + //}); + + } + + + + + + + VVRELEASE(outBuffer); + VVRELEASE(buffer2d); + //VVRELEASE(syphonCopy); + //VVRELEASE(syphonBuffer); + + } + [_globalVVBufferPool housekeeping]; +} +// used to render for recording +- (void) renderIntoBuffer:(VVBuffer *)b atTime:(double)t { + if (b==nil) + return; + [isfController renderIntoBuffer:b atTime:t]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- misc +/*------------------------------------*/ + + +- (void) exportCompleteSelectFileAtPath:(NSString *)p { + //NSLog(@"%s ... %@",__func__,p); + if (p==nil) + return; + NSFileManager *fm = [NSFileManager defaultManager]; + if (![fm fileExistsAtPath:p isDirectory:nil]) { + NSLog(@"\t\terr: bailing in %s, file doesn't exist at path %@",__func__,p); + return; + } + // i don't want the table selection to change anything during this + [self setRespondToTableSelectionChanges:NO]; + [self setRespondToFileChanges:NO]; + + // i need to figure out if selecting this file requires me to change the "fxPath" (the list of files displayed), and reload the list of filters + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + NSString *currentFXPath = [def objectForKey:@"fxPath"]; + NSString *newFXPath = [p stringByDeletingLastPathComponent]; + BOOL fxPathNeedsChanging = NO; + if (currentFXPath==nil || ![currentFXPath isEqualToString:newFXPath]) { + fxPathNeedsChanging = YES; + [def setObject:newFXPath forKey:@"fxPath"]; + [def synchronize]; + [self _loadFilterList]; + [filterTV reloadData]; + } + // figure out which filter i want to select, then select it + NSInteger filterIndex = [filterList lockIndexOfObject:p]; + if (filterIndex<0 || filterIndex==NSNotFound) { + NSLog(@"\t\terr: %s, souldn't find filter %@ in filterList %@",__func__,p,filterList); + [self setRespondToTableSelectionChanges:YES]; + [self setRespondToFileChanges:YES]; + return; + } + [filterTV selectRowIndexes:[NSIndexSet indexSetWithIndex:filterIndex] byExtendingSelection:NO]; + [self setRespondToTableSelectionChanges:YES]; + [self setRespondToFileChanges:YES]; + [self tableViewSelectionDidChange:nil]; +} +- (void) reloadSelectedISF { + //NSLog(@"%s",__func__); + [isfController reloadTargetFile]; +} +- (NSString *) targetFile { + NSString *returnMe = nil; + returnMe = [isfController targetFile]; + return returnMe; +} +- (void) setFetchShaders:(BOOL)n { + @synchronized (self) { + fetchShaders = n; + //if (fetchShaders) + // NSLog(@"\t\tfetchShaders is YES in %s",__func__); + //else + // NSLog(@"\t\tfetchShaders is NO in %s",__func__); + } +} +- (BOOL) fetchShaders { + BOOL returnMe = NO; + @synchronized (self) { + returnMe = fetchShaders; + } + return returnMe; +} +- (void) reloadFileFromTableView { + NSUInteger selectedIndex = [[filterTV selectedRowIndexes] firstIndex]; + if (selectedIndex == NSNotFound) { + [isfController loadFile:nil]; + [docController loadFile:nil]; + } + else { + NSString *newFilterPath = [filterList lockObjectAtIndex:selectedIndex]; + [isfController loadFile:newFilterPath]; + [docController loadFile:newFilterPath]; + } + + @synchronized (self) { + //NSLog(@"\t\tfetchShaders is YES in %s",__func__); + //fetchShaders = YES; + } +} +@synthesize respondToTableSelectionChanges; +@synthesize respondToFileChanges; +- (NSMutableArray *) createSyntaxErrorsForForbiddenTermsInRawISFFile { + __block NSMutableArray *syntaxErrArray = MUTARRAY; + // run through the raw frag shader string, looking for "forbidden" terms (texture2D, texture2DRect, sampler2D, sampler2DRect), and creating errors for them + NSArray *forbiddenTerms = @[@"texture2DRectProjLod",@"texture2DRectProj",@"texture2DRect",@"texture2DProjLod",@"texture2DProj",@"texture2D",@"sampler2DRect",@"sampler2D"]; + NSString *forbiddenTermsRegex = @"((texture2D(Rect)?(Proj)?(Lod)?)|(sampler2D(Rect)?))"; + NSString *precompiledFragSrc = [[isfController scene] fragShaderSource]; + NSString *jsonSrc = [[isfController scene] jsonSource]; + //NSInteger lineDelta = [jsonSrc numberOfLines]; + __block NSInteger lineIndex = [jsonSrc numberOfLines] + 1; + //NSMutableArray *syntaxErrArray = MUTARRAY; + // run through all the lines in the precompiled shader + [precompiledFragSrc enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + // if the line matches the 'forbidden terms' regex... + if ([line isMatchedByRegex:forbiddenTermsRegex]) { + // run through all the forbidden terms to figure out which one is in the line + for (NSString *forbiddenTerm in forbiddenTerms) { + if ([line containsString:forbiddenTerm]) { + // make a syntax error, add it to the array + SMLSyntaxError *err = [[[SMLSyntaxError alloc] init] autorelease]; + [err setLine:(int)lineIndex]; + [err setCharacter:0]; + [err setCode:forbiddenTerm]; + [err setDescription:VVFMTSTRING(@"Warning: \'%@\' may not always work!",forbiddenTerm)]; + [err setLength:1]; + [syntaxErrArray addObject:err]; + + break; + } + } + } + ++lineIndex; + }]; + + NSMutableArray *returnMe = nil; + if ([syntaxErrArray count]>0) { + returnMe = MUTARRAY; + [returnMe addObjectsFromArray:syntaxErrArray]; + } + return returnMe; +} + + + +/*===================================================================================*/ +#pragma mark --------------------- table view data source/delegate +/*------------------------------------*/ + + +- (NSUInteger) numberOfRowsInTableView:(NSTableView *)tv { + //NSLog(@"%s",__func__); + return [filterList lockCount]; +} +- (id) tableView:(NSTableView *)tv objectValueForTableColumn:(NSTableColumn *)tc row:(int)row { + NSString *fileName = [[filterList lockObjectAtIndex:row] lastPathComponent]; + return fileName; +} +- (BOOL) tableView:(NSTableView *)tv shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)col row:(int)row { + //NSLog(@"%s",__func__); + return YES; +} +- (BOOL)tableView:(NSTableView *)tv shouldSelectRow:(NSInteger)row { + // if the doc controller's contents need to be saved, throw up an alert + if ([docController contentsNeedToBeSaved]) { + NSInteger saveResult = VVRunAlertPanel(@"Unsaved Changes!", + @"The ISF file you were editing has unsaved changes- do you want to save your changes before closing it?", + @"Save", + @"Don't Save", + @"Cancel"); + if (saveResult == NSAlertFirstButtonReturn) { + // save the file, then select the row + [docController saveOpenFile]; + return YES; + } + else if (saveResult == NSAlertSecondButtonReturn) { + // don't save the file- just select the row + return YES; + } + else if (saveResult == NSAlertThirdButtonReturn) { + // don't save the file, don't select the row + return NO; + } + else + return YES; + } + // else just select it + else + return YES; + return YES; +} +- (void) tableViewSelectionDidChange:(NSNotification *)aNotification { + //NSLog(@"%s",__func__); + if (![self respondToTableSelectionChanges]) + return; + [self reloadFileFromTableView]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- table view drag & drop +/*------------------------------------*/ + + +- (unsigned int) tableView:(NSTableView *)tv validateDrop:(id )info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op { + //NSLog(@"%s",__func__); + if (op == NSTableViewDropOn) + [tv setDropRow:row dropOperation:NSTableViewDropAbove]; + + return op; +} +- (BOOL) tableView:(NSTableView *)tv acceptDrop:(id )info row:(int)row dropOperation:(NSTableViewDropOperation)op { + //NSLog(@"%s",__func__); + NSPasteboard *pboard = [info draggingPasteboard]; + NSString *tmpPath = nil; + //NSFileManager *fm = [NSFileManager defaultManager]; + //BOOL isDirectory = NO; + if ([[pboard types] containsObject:NSFilenamesPboardType]) { + // Load the files + NSArray *pathsArray = [pboard propertyListForType:NSFilenamesPboardType]; + tmpPath = (pathsArray==nil) ? nil : [pathsArray objectAtIndex:0]; + } + else if ([[pboard types] containsObject:NSURLPboardType]) { + NSURL *fileURL = [NSURL URLFromPasteboard:pboard]; + tmpPath = (fileURL==nil) ? nil : [fileURL absoluteString]; + } + + NSString *folderPath = nil; + NSString *filePath = nil; + // if there's a tmp path + if (tmpPath != nil) { + NSFileManager *fm = [NSFileManager defaultManager]; + BOOL isDir = NO; + [fm fileExistsAtPath:tmpPath isDirectory:&isDir]; + // is it a folder? if it's a folder, just load that + if (isDir) { + folderPath = tmpPath; + } + // else it's not a folder + else { + filePath = tmpPath; + folderPath = [tmpPath stringByDeletingLastPathComponent]; + } + // get the path to the folder, load that + if (folderPath != nil) { + [[NSUserDefaults standardUserDefaults] setObject:folderPath forKey:@"fxPath"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [self _loadFilterList]; + [filterTV reloadData]; + } + // get the index of the file in the array, select it in the table view + if (filePath != nil) { + NSInteger fileIndex = [filterList lockIndexOfObject:filePath]; + if (fileIndex>=0 && fileIndex!=NSNotFound) { + [filterTV selectRowIndexes:[NSIndexSet indexSetWithIndex:fileIndex] byExtendingSelection:NO]; + } + } + else + [filterTV deselectAll:nil]; + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; + } + /* + // if there's a tmp path, store it in the user defaults + if (tmpPath != nil) { + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + [def setObject:tmpPath forKey:@"fxPath"]; + [def synchronize]; + } + + // reload the filter list (loads the files from "fxPath" from the user defaults) + [self _loadFilterList]; + + + // reload the table view + [filterTV reloadData]; + // tell the table view to select the item at the dst index + [filterTV deselectAll:nil]; + // make sure that the change in selection is reflected by the backend! + [self tableViewSelectionDidChange:nil]; + */ + return YES; +} + + +@end + + + + +CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, + const CVTimeStamp *inNow, + const CVTimeStamp *inOutputTime, + CVOptionFlags flagsIn, + CVOptionFlags *flagsOut, + void *displayLinkContext) +{ + //NSLog(@"%s",__func__); + NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init]; + [(ISFEditorAppDelegate *)displayLinkContext _renderCallback]; + [pool release]; + return kCVReturnSuccess; +} diff --git a/ISF Editor/ISFPDownload.h b/ISF Editor/ISFPDownload.h new file mode 100644 index 00000000..3a22ff7d --- /dev/null +++ b/ISF Editor/ISFPDownload.h @@ -0,0 +1,24 @@ +#import + + + + +@interface ISFPDownload : NSObject { + NSString *fragPath; + NSString *thumbURL; + NSImage *thumb; + NSDate *updateDate; + NSNumber *uniqueID; +} + ++ (id) create; + +@property (retain,readwrite) NSString *fragPath; +@property (retain,readwrite) NSString *thumbURL; +@property (retain,readwrite) NSImage *thumb; +@property (retain,readwrite) NSDate *updateDate; +@property (retain,readwrite) NSNumber *uniqueID; + +- (NSString *) updateDateString; + +@end diff --git a/ISF Editor/ISFPDownload.m b/ISF Editor/ISFPDownload.m new file mode 100644 index 00000000..a38938c6 --- /dev/null +++ b/ISF Editor/ISFPDownload.m @@ -0,0 +1,61 @@ +#import "ISFPDownload.h" +#import + + + + +@implementation ISFPDownload + + ++ (id) create { + return [[[ISFPDownload alloc] init] autorelease]; +} +- (id) init { + self = [super init]; + if (self != nil) { + fragPath = nil; + thumbURL = nil; + thumb = nil; + updateDate = nil; + uniqueID = nil; + } + return self; +} +- (void) dealloc { + [self setFragPath:nil]; + [self setThumbURL:nil]; + [self setThumb:nil]; + [self setUpdateDate:nil]; + [self setUniqueID:nil]; + [super dealloc]; +} +- (NSString *) description { + return [fragPath lastPathComponent]; +} + + +@synthesize fragPath; +@synthesize thumbURL; +@synthesize thumb; +@synthesize updateDate; +@synthesize uniqueID; + + +- (NSString *) updateDateString { + NSString *returnMe = nil; + NSDate *localDate = [self updateDate]; + if (localDate!=nil) { + NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; + //[fmt setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"]; + [fmt setDateFormat:@"dd/MM, HH:mm"]; + returnMe = [fmt stringFromDate:localDate]; + [fmt release]; + fmt = nil; + } + if (returnMe==nil) + returnMe = @""; + return returnMe; +} + + +@end diff --git a/ISF Editor/ISFPDownloadTableCellView.h b/ISF Editor/ISFPDownloadTableCellView.h new file mode 100644 index 00000000..c4a5f650 --- /dev/null +++ b/ISF Editor/ISFPDownloadTableCellView.h @@ -0,0 +1,23 @@ +#import +#import "ISFPDownload.h" + + + + +@interface ISFPDownloadTableCellView : NSTableCellView { + IBOutlet NSImageView *thumbView; + IBOutlet NSTextField *titleField; + IBOutlet NSTextField *updateDateField; + + IBOutlet NSButton *openInBrowserButton; + + ISFPDownload *download; +} + +- (void) refreshWithDownload:(ISFPDownload *)n; + +@property (retain,readwrite) ISFPDownload *download; + +- (IBAction) openInBrowserButtonUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPDownloadTableCellView.m b/ISF Editor/ISFPDownloadTableCellView.m new file mode 100644 index 00000000..25bd310a --- /dev/null +++ b/ISF Editor/ISFPDownloadTableCellView.m @@ -0,0 +1,59 @@ +#import "ISFPDownloadTableCellView.h" +#import + + + + +@implementation ISFPDownloadTableCellView + + +- (id) initWithFrame:(NSRect)n { + self = [super initWithFrame:n]; + if (self != nil) { + download = nil; + } + return self; +} +- (id) initWithCoder:(NSCoder *)c { + self = [super initWithCoder:c]; + if (self != nil) { + download = nil; + } + return self; +} +- (void) dealloc { + [self setDownload:nil]; + [super dealloc]; +} +- (void) refreshWithDownload:(ISFPDownload *)n { + //NSLog(@"%s ... %@",__func__,n); + if (n==nil) + return; + [self setDownload:n]; + + [openInBrowserButton setImage:[NSImage imageNamed:NSImageNameShareTemplate]]; + + NSImage *thumbImg = [n thumb]; + NSString *title = [[[n fragPath] lastPathComponent] stringByDeletingPathExtension]; + NSString *updateString = [n updateDateString]; + + [thumbView setImage:thumbImg]; + [titleField setStringValue:title]; + [updateDateField setStringValue:updateString]; +} + + +@synthesize download; + + +- (IBAction) openInBrowserButtonUsed:(id)sender { + ISFPDownload *_download = [self download]; + if (_download==nil) + return; + NSString *urlString = [NSString stringWithFormat:@"http://www.interactiveshaderformat.com/sketches/%d",[[_download uniqueID] intValue]]; + NSURL *url = [NSURL URLWithString:urlString]; + [[NSWorkspace sharedWorkspace] openURL:url]; +} + + +@end diff --git a/ISF Editor/ISFPDownloader.h b/ISF Editor/ISFPDownloader.h new file mode 100644 index 00000000..5d832c04 --- /dev/null +++ b/ISF Editor/ISFPDownloader.h @@ -0,0 +1,81 @@ +#import +#import +#import +#import "ISFController.h" +#import "DocController.h" +#import "ISFPDownload.h" + + + + +typedef enum { + ISFPDownloaderBrowseType_MostStars = 1, + ISFPDownloaderBrowseType_Latest = 2 +} ISFPDownloaderBrowseType; + + + + +@interface ISFPDownloader : NSObject { + BOOL alreadyAwake; // when we make table cell views, awakeFromNib gets called repeatedly + + IBOutlet NSWindow *appWindow; // the main app window- we appear as a modal view over this + IBOutlet NSWindow *myWindow; + + IBOutlet id appController; + IBOutlet ISFController *isfController; + IBOutlet DocController *docController; + + IBOutlet NSSearchField *searchField; + IBOutlet NSPopUpButton *browseTypePUB; + + IBOutlet NSTableView *tableView; + + ISFGLScene *isfScene; + + NSInteger pageStartIndex; // we view X results at a time- this is the index (on the server) of the first result in 'completedDownloads' + NSInteger maxPageStartIndex; // NSNotFound by default, set to a value if the # of results downloaded doesn't match the # of results we tried to download. check this when calling "next page". + //NSString *pageBaseURL; + NSArray *pageQueryTerms; + ISFPDownloaderBrowseType browseType; + + MutLockArray *completedDownloads; // array of ISFPDownload instances + MutLockArray *imagesToDownload; + dispatch_queue_t downloadQueue; + + NSTimer *reloadTableTimer; // used to throttle table view reloading (throttle necessary because of completedDownloads) +} + +- (IBAction) searchFieldUsed:(id)sender; +- (IBAction) browseTypePUBUsed:(id)sender; + +- (IBAction) nextPageClicked:(id)sender; +- (IBAction) prevPageClicked:(id)sender; + +- (IBAction) importClicked:(id)sender; +- (IBAction) importAllClicked:(id)sender; +- (void) _importDownload:(ISFPDownload *)dl; +- (IBAction) closeClicked:(id)sender; + +//- (NSString *) createBrowseQueryURL; +//- (NSString *) createSearchQueryURL; +- (NSString *) createQueryURL; +- (void) downloadResultsForURLString:(NSString *)address; +- (void) clearResults; +- (void) openModalWindow; +- (void) closeModalWindow; + +@property (assign, readwrite) NSInteger pageStartIndex; +@property (assign, readwrite) NSInteger maxPageStartIndex; +//@property (retain, readwrite) NSString *pageBaseURL; +@property (retain,readwrite) NSArray *pageQueryTerms; +@property (assign,readwrite) ISFPDownloaderBrowseType browseType; +- (void) parsedNewDownloads:(NSMutableArray *)n; +- (void) startDownloadingImage; +- (void) downloadedImage:(NSImage *)img fromURL:(NSString *)urlString; + +- (void) reloadTableButThrottleThisMethod; +//- (void) _resetReloadTableTimer; +- (void) timerThrottledTableReloader:(NSTimer *)t; + +@end diff --git a/ISF Editor/ISFPDownloader.m b/ISF Editor/ISFPDownloader.m new file mode 100644 index 00000000..48cf002e --- /dev/null +++ b/ISF Editor/ISFPDownloader.m @@ -0,0 +1,644 @@ +#import "ISFPDownloader.h" +#import +#import "ISFPDownload.h" +#import "ISFPDownloadTableCellView.h" +#import "RegexKitLite.h" +#import "ISFEditorAppDelegate.h" + + + + +#define LOCK OSSpinLockLock +#define UNLOCK OSSpinLockUnlock +#define DOWNLOADCOUNT 20 +#define SIMULTANEOUSDOWNLOADS 5 + + + + +@implementation ISFPDownloader + + +- (id) init { + //NSLog(@"%s",__func__); + self = [super init]; + if (self != nil) { + alreadyAwake = NO; + isfScene = [[ISFGLScene alloc] initWithSharedContext:[_globalVVBufferPool sharedContext] pixelFormat:[GLScene defaultPixelFormat] sized:NSMakeSize(810,432)]; + pageStartIndex = 0; + //pageBaseURL = nil; + pageQueryTerms = nil; + browseType = ISFPDownloaderBrowseType_MostStars; + completedDownloads = [[MutLockArray alloc] init]; + imagesToDownload = [[MutLockArray alloc] init]; + downloadQueue = dispatch_queue_create("IMIDownloader", DISPATCH_QUEUE_SERIAL); + reloadTableTimer = nil; + } + return self; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + VVRELEASE(completedDownloads); + VVRELEASE(imagesToDownload); + dispatch_release(downloadQueue); + downloadQueue = NULL; + [super dealloc]; +} +- (void) awakeFromNib { + //NSLog(@"%s",__func__); + // this method gets called every time a new ISFPDownloadTableCellView is instantiated, which is just....fucking awful. + + if (!alreadyAwake) { + //[self browseTypePUBUsed:browseTypePUB]; + } + + alreadyAwake = YES; +} + + +#pragma mark - + + +- (IBAction) searchFieldUsed:(id)sender { + //NSLog(@"%s",__func__); + // deselect everything in the categories PUB + //[browseTypePUB selectItem:nil]; + + // parse the string from the search field, generate an array of terms + NSString *rawString = [searchField stringValue]; + NSArray *rawTerms = [rawString componentsSeparatedByRegex:@"[^\\w]+"]; + NSMutableArray *terms = MUTARRAY; + for (NSString *rawTerm in rawTerms) { + if ([rawTerm length]>0) { + [terms addObject:rawTerm]; + } + } + //NSLog(@"\t\trefined terms are %@",terms); + + // create and set a page base URL using the terms + if (terms==nil || [terms count]<1) { + [searchField setStringValue:@""]; + //[self setPageBaseURL:nil]; + [self setPageQueryTerms:nil]; + } + /* + else if ([terms count]==1) { + //[self setPageBaseURL:[terms objectAtIndex:0]]; + XXX; + } + */ + else { + [searchField setStringValue:[terms componentsJoinedByString:@" "]]; + //[self setPageBaseURL:[terms objectAtIndex:0]]; + [self setPageQueryTerms:terms]; + } + + // reset the page start indexes + [self setPageStartIndex:0]; + [self setMaxPageStartIndex:NSNotFound]; + + // create the query URL (which is based on the page base URL and the page start index) + //NSString *queryURL = [self createSearchQueryURL]; + NSString *queryURL = [self createQueryURL]; + [self downloadResultsForURLString:queryURL]; +} +- (IBAction) browseTypePUBUsed:(id)sender { + //NSLog(@"%s",__func__); + NSString *selectedTitle = [browseTypePUB titleOfSelectedItem]; + if (selectedTitle==nil) + return; + + /* + // clear the search field + [searchField setStringValue:@""]; + */ + + // set the page base URL + if ([selectedTitle isEqualToString:@"Latest"]) { + //[self setPageBaseURL:@"https://www.interactiveshaderformat.com/api/v1/shaders?sort=newest"]; + + //[self setPageBaseURL:@"?sort=newest"]; + [self setBrowseType:ISFPDownloaderBrowseType_Latest]; + } + else if ([selectedTitle isEqualToString:@"Most Stars"]) { + //[self setPageBaseURL:@"https://www.interactiveshaderformat.com/api/v1/shaders?"]; + + //[self setPageBaseURL:nil]; + [self setBrowseType:ISFPDownloaderBrowseType_MostStars]; + } + + // reset the page start indexes + [self setPageStartIndex:0]; + [self setMaxPageStartIndex:NSNotFound]; + + // create the query URL (which is based on the page base URL and the page start index) + //NSString *queryURL = [self createBrowseQueryURL]; + NSString *queryURL = [self createQueryURL]; + [self downloadResultsForURLString:queryURL]; +} + + +- (IBAction) nextPageClicked:(id)sender { + //NSLog(@"%s",__func__); + // calculate a new page start index + NSInteger newPageStartIndex = [self pageStartIndex] + DOWNLOADCOUNT; + // make sure that the new page start index isn't bigger than the max page start index + NSInteger _maxPageStartIndex = [self maxPageStartIndex]; + if (_maxPageStartIndex != NSNotFound) + newPageStartIndex = fminl(newPageStartIndex, _maxPageStartIndex); + // if we aren't actually changing the page start index, bail now + if (newPageStartIndex == [self pageStartIndex]) + return; + + // set the page start index + [self setPageStartIndex:newPageStartIndex]; + // create a query URL (which uses the page start index and the page base url) + //NSString *queryURL = [self createBrowseQueryURL]; + NSString *queryURL = [self createQueryURL]; + // begin downloading the results + [self downloadResultsForURLString:queryURL]; +} +- (IBAction) prevPageClicked:(id)sender { + //NSLog(@"%s",__func__); + // calculate a new page start index + NSInteger newPageStartIndex = [self pageStartIndex] - DOWNLOADCOUNT; + // make sure that the new page start index isn't bigger than the max page start index + if (newPageStartIndex < 0) + newPageStartIndex = 0; + // if we aren't actually changing the page start index, bail now + if (newPageStartIndex == [self pageStartIndex]) + return; + + // actually set the page start index + [self setPageStartIndex:newPageStartIndex]; + // create a query URL (which uses the page start index and the page base url) + //NSString *queryURL = [self createBrowseQueryURL]; + NSString *queryURL = [self createQueryURL]; + // begin downloading the results + [self downloadResultsForURLString:queryURL]; +} +- (IBAction) importClicked:(id)sender { + // get the index of the selected item + NSInteger selRow = [tableView selectedRow]; + if (selRow<0 || selRow==NSNotFound) + return; + ISFPDownload *dl = [[[completedDownloads lockObjectAtIndex:selRow] retain] autorelease]; + if (dl == nil) + return; + [self _importDownload:dl]; + +} +- (IBAction) importAllClicked:(id)sender { + NSArray *copiedDLs = [completedDownloads lockCreateArrayCopy]; + for (ISFPDownload *dl in copiedDLs) { + [self _importDownload:dl]; + } +} +- (void) _importDownload:(ISFPDownload *)dl { + if (dl==nil) + return; + // calculate the destination directory, make sure it exists (create it if it doesn't) + NSString *dstDir = [@"~/Library/Graphics/ISF" stringByExpandingTildeInPath]; + NSFileManager *fm = [NSFileManager defaultManager]; + if (![fm fileExistsAtPath:dstDir]) + [fm createDirectoryAtPath:dstDir withIntermediateDirectories:YES attributes:nil error:nil]; + // run through the src files (get the frag path, enumerate the contents of the directory it's within) + NSString *fragPath = [dl fragPath]; + NSString *srcDir = [fragPath stringByDeletingLastPathComponent]; + NSArray *srcDirContents = [fm contentsOfDirectoryAtPath:srcDir error:nil]; + for (NSString *fileName in srcDirContents) { + NSString *srcPath = VVFMTSTRING(@"%@/%@",srcDir,fileName); + NSString *dstPath = VVFMTSTRING(@"%@/%@",dstDir,fileName); + // if there's a file at the "dstPath", move it to the trash + if ([fm fileExistsAtPath:dstPath]) + [fm trashItemAtURL:[NSURL fileURLWithPath:dstPath] resultingItemURL:nil error:nil]; + // copy the src to the dst + [fm copyItemAtPath:srcPath toPath:dstPath error:nil]; + } +} +- (IBAction) closeClicked:(id)sender { + // close the modal window + [self closeModalWindow]; + // reload the file from the table view (so we aren't viewing something in a tmp directory) + [appController reloadFileFromTableView]; +} + + +#pragma mark - + +/* +- (NSString *) createBrowseQueryURL { + NSLog(@"%s",__func__); + NSString *returnMe = nil; + NSString *_pageBaseURL = [self pageBaseURL]; + NSLog(@"\t\tpageBaseURL is %@",_pageBaseURL); + NSInteger _pageStartIndex = [self pageStartIndex]; + if (_pageBaseURL == nil) + returnMe = VVFMTSTRING(@"https://www.interactiveshaderformat.com/api/v1/shaders?offset=%ld&limit=%d",(long)_pageStartIndex,DOWNLOADCOUNT); + else + returnMe = VVFMTSTRING(@"https://www.interactiveshaderformat.com/api/v1/shaders%@&offset=%ld&limit=%d",_pageBaseURL,(long)_pageStartIndex,DOWNLOADCOUNT); + return returnMe; +} +- (NSString *) createSearchQueryURL { + NSLog(@"%s",__func__); + NSString *returnMe = nil; + NSString *_pageBaseURL = [self pageBaseURL]; + NSLog(@"\t\tpageBaseURL is %@",_pageBaseURL); + NSInteger _pageStartIndex = [self pageStartIndex]; + if (_pageBaseURL == nil) + returnMe = VVFMTSTRING(@"https://www.interactiveshaderformat.com/api/v1/shaders?offset=%ld&limit=%d",(long)_pageStartIndex,DOWNLOADCOUNT); + else + returnMe = VVFMTSTRING(@"https://www.interactiveshaderformat.com/api/v1/shaders/query/%@?offset=%ld&limit=%d",_pageBaseURL,(long)_pageStartIndex,DOWNLOADCOUNT); + return returnMe; +} +*/ +- (NSString *) createQueryURL { + NSLog(@"%s",__func__); + NSString *returnMe = nil; + NSString *baseString = @"https://www.interactiveshaderformat.com/api/v1/shaders"; + NSArray *searchTermsArray = [self pageQueryTerms]; + NSString *searchTermsString = (searchTermsArray==nil || [searchTermsArray count]<1) ? nil : VVFMTSTRING(@"query=%@",[searchTermsArray componentsJoinedByString:@","]); + NSString *sortString = ([self browseType]==ISFPDownloaderBrowseType_Latest) ? @"sort=newest" : nil; + NSString *offsetString = VVFMTSTRING(@"offset=%ld&limit=%d",(long)[self pageStartIndex],DOWNLOADCOUNT); + + NSMutableArray *queryArray = [NSMutableArray arrayWithCapacity:0]; + if (searchTermsString != nil) + [queryArray addObject:searchTermsString]; + if (sortString != nil) + [queryArray addObject:sortString]; + if (offsetString != nil) + [queryArray addObject:offsetString]; + + returnMe = VVFMTSTRING(@"%@?%@",baseString,[queryArray componentsJoinedByString:@"&"]); + + return returnMe; +} +- (void) downloadResultsForURLString:(NSString *)address { + NSLog(@"%s ... %@",__func__,address); + VVCURLDL *dl = [[VVCURLDL alloc] initWithAddress:address]; + [dl setDNSCacheTimeout:10]; + [dl setConnectTimeout:10]; + [dl appendStringToHeader:@"Accept: application/json"]; + [dl performAsync:YES withBlock:^(VVCURLDL *finished) { + //NSLog(@"\t\tdownloaded string %@",[finished responseString]); + //NSLog(@"\t\tdownloaded JSON object %@",[[finished responseString] objectFromJSONString]); + NSString *responseString = [finished responseString]; + NSArray *topLevelJSONObj = [responseString objectFromJSONString]; + if (topLevelJSONObj==nil || ![topLevelJSONObj isKindOfClass:[NSArray class]]) { + if (topLevelJSONObj==nil) + NSLog(@"\t\terr: %s, topLevelJSONObj nil, string was %@",__func__,responseString); + else + NSLog(@"\t\terr: %s, topLevelJSONObj was a %@ instead of an array",__func__,NSStringFromClass([topLevelJSONObj class])); + } + else { + // if i'm here then we've got a JSON array to work with, so we most likely have some results... + + // before we go further, make sure that the # of results in this array matches the # of results we tried to download. if it doesn't, there aren't any more results, and we should set the maxPageStartIndex. + if ([(NSArray *)topLevelJSONObj count] != DOWNLOADCOUNT) { + [self setMaxPageStartIndex:[self pageStartIndex]]; + } + + // the goal here is to assemble an array of ISFPDownload instances we'll pass back to ourself (so we can start downloading them) + NSMutableArray *newDownloads = MUTARRAY; + // delete then re-create the folder we'll be downloading to + NSString *baseDir = @"/tmp/ISFEditor/Downloads"; + NSFileManager *fm = [NSFileManager defaultManager]; + if ([fm fileExistsAtPath:baseDir]) { + NSError *nsErr = nil; + if (![fm removeItemAtURL:[NSURL fileURLWithPath:baseDir isDirectory:YES] error:&nsErr]) + NSLog(@"\t\terr: %s, couldn't trash path \"%@\", %@",__func__,baseDir,nsErr); + //if (![fm trashItemAtURL:[NSURL fileURLWithPath:baseDir isDirectory:YES] resultingItemURL:nil error:&nsErr]) + // NSLog(@"\t\terr: %s, couldn't trash path \"%@\", %@",__func__,baseDir,nsErr); + } + [fm createDirectoryAtPath:baseDir withIntermediateDirectories:YES attributes:nil error:nil]; + // run through dicts we parsed from the JSON blob (each dict describes a shader) + for (NSDictionary * shaderDict in (NSArray *)topLevelJSONObj) { + if (![shaderDict isKindOfClass:[NSDictionary class]]) { + NSLog(@"\t\terr: %s, shaderDict was a %@ instead of a dict",__func__,NSStringFromClass([shaderDict class])); + continue; + } + // pull the vals we want from the dict, make sure they exist and are of the correct type + NSNumber *idNum = [shaderDict objectForKey:@"id"]; + NSString *fragString = [shaderDict objectForKey:@"raw_fragment_source"]; + NSString *vertString = [shaderDict objectForKey:@"raw_vertex_source"]; + NSString *thumbnailString = [shaderDict objectForKey:@"thumbnail_url"]; + NSString *title = [shaderDict objectForKey:@"title"]; + NSString *updateDateString = [shaderDict objectForKey:@"updated_at"]; + + if ([idNum isKindOfClass:[NSNull class]]) + idNum = nil; + if ([fragString isKindOfClass:[NSNull class]]) + fragString = nil; + if ([vertString isKindOfClass:[NSNull class]]) + vertString = nil; + if ([thumbnailString isKindOfClass:[NSNull class]]) + thumbnailString = nil; + if ([title isKindOfClass:[NSNull class]]) + title = nil; + if ([updateDateString isKindOfClass:[NSNull class]]) + updateDateString = nil; + + if ((idNum==nil || ![idNum isKindOfClass:[NSNumber class]]) || + (fragString==nil || ![fragString isKindOfClass:[NSString class]]) || + (vertString==nil || ![vertString isKindOfClass:[NSString class]]) || + //(thumbnailString==nil || ![thumbnailString isKindOfClass:[NSString class]]) || + (title==nil || ![title isKindOfClass:[NSString class]]) || + (updateDateString==nil || ![updateDateString isKindOfClass:[NSString class]])) { + NSLog(@"\t\terr: %s, obj from shader dict is missing or wrong type",__func__); + //NSLog(@"\t\tid is %@, is class %@",idNum,NSStringFromClass([idNum class])); + //NSLog(@"\t\tfrag/vert strings are %@/%@",NSStringFromClass([fragString class]),NSStringFromClass([vertString class])); + //NSLog(@"\t\tthumb string is %@/%@",thumbnailString,NSStringFromClass([thumbnailString class])); + //NSLog(@"\t\ttitle is %@/%@",title,NSStringFromClass([title class])); + //NSLog(@"\t\tupdateDateString is %@/%@",updateDateString,NSStringFromClass([updateDateString class])); + continue; + } + + // if the vertString is the default vertString, we can skip it + if ([vertString isEqualToString:@"void main() {\n\tvv_vertShaderInit();\n}"]) + vertString = nil; + + // if the folder doesn't already exist + NSString *shaderDir = VVFMTSTRING(@"%@/%d",baseDir,[idNum intValue]); + if (![fm fileExistsAtPath:shaderDir]) { + // create the folder + if (![fm createDirectoryAtPath:shaderDir withIntermediateDirectories:YES attributes:nil error:nil]) + NSLog(@"\t\terr: couldn't create directory %@, can't save shader",shaderDir); + else { + // dump the frag/vert files to disk + NSString *fragPath = VVFMTSTRING(@"%@/%@.fs",shaderDir,title); + NSString *vertPath = VVFMTSTRING(@"%@/%@.vs",shaderDir,title); + [fragString writeToFile:fragPath atomically:YES encoding:NSUTF8StringEncoding error:nil]; + if (vertString != nil) + [vertString writeToFile:vertPath atomically:YES encoding:NSUTF8StringEncoding error:nil]; + // make an ISFPDownload object, populate it + ISFPDownload *newDownload = [ISFPDownload create]; + [newDownload setFragPath:fragPath]; + [newDownload setThumbURL:thumbnailString]; + [newDownload setUniqueID:idNum]; + // convert the date string to an NSDate instance, add it to the download object + NSDate *updateDate = nil; + if (updateDateString!=nil) { + NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; + //[fmt setLocale:enUSPOSIXLocale]; + [fmt setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; + [fmt setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"]; + updateDate = [fmt dateFromString:updateDateString]; + if (updateDate==nil) { + [fmt setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"]; + updateDate = [fmt dateFromString:updateDateString]; + if (updateDate==nil) { + [fmt setDateFormat:@"yyyy-MM-dd'T'HH:mm"]; + updateDate = [fmt dateFromString:updateDateString]; + if (updateDate==nil) { + [fmt setDateFormat:@"yyyy-MM-dd HH:mm:ss ZZZ"]; + updateDate = [fmt dateFromString:updateDateString]; + } + } + } + [fmt release]; + } + if (updateDate != nil) + [newDownload setUpdateDate:updateDate]; + else + NSLog(@"\t\tERR: couldn't parse update string \"%@\", %s",updateDateString,__func__); + + // add the download object to the array of completedDownloads i'm assembling + [newDownloads addObject:newDownload]; + } + } + } + + // at this point we should have populated 'newDownloads' with instances of ISFPDownload + + // pass them back to self, we'll update the array and the table and begin downloading in a new method on the main thread + dispatch_async(dispatch_get_main_queue(), ^{ + //[self setPageStartIndex:p]; + [self parsedNewDownloads:newDownloads]; + }); + } + + [dl autorelease]; + }]; +} +- (void) clearResults { + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self clearResults]; + }); + return; + } + + [self setPageStartIndex:0]; + [self setMaxPageStartIndex:NSNotFound]; + //[self setPageBaseURL:nil]; + [self setPageQueryTerms:nil]; + [searchField setStringValue:@""]; + [completedDownloads lockRemoveAllObjects]; + [imagesToDownload lockRemoveAllObjects]; + @synchronized (self) { + if (reloadTableTimer != nil) { + [reloadTableTimer invalidate]; + reloadTableTimer = nil; + } + } + [tableView reloadData]; +} +- (void) openModalWindow { + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self openModalWindow]; + }); + return; + } + + //[view removeFromSuperview]; + [appWindow beginSheet:myWindow completionHandler:^(NSModalResponse returnCode) { + dispatch_async(dispatch_get_main_queue(), ^{ + //[view removeFromSuperview]; + }); + }]; + + [searchField setStringValue:@""]; + [browseTypePUB selectItemAtIndex:1]; + [self browseTypePUBUsed:browseTypePUB]; +} +- (void) closeModalWindow { + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self closeModalWindow]; + }); + return; + } + + NSWindow *sheetParent = [myWindow sheetParent]; + if (sheetParent == nil) + return; + [self clearResults]; + [sheetParent endSheet:myWindow returnCode:NSModalResponseStop]; + + // tell the app controller to reload the list of files- we may have imported stuff while the modal window was open + [appController _loadFilterList]; +} + + +#pragma mark - + + +@synthesize pageStartIndex; +@synthesize maxPageStartIndex; +//@synthesize pageBaseURL; +@synthesize pageQueryTerms; +@synthesize browseType; +- (void) parsedNewDownloads:(NSMutableArray *)n { + //NSLog(@"%s",__func__); + // empty the array of images to download + [imagesToDownload lockRemoveAllObjects]; + // empty my completedDownloads folder + [completedDownloads wrlock]; + [completedDownloads removeAllObjects]; + [completedDownloads addObjectsFromArray:n]; + [completedDownloads unlock]; + // reload the table view + [tableView reloadData]; + + // run through the array, adding the URLs i need to download to the array + for (ISFPDownload *download in n) { + NSString *url = [download thumbURL]; + if (url==nil) + continue; + + [imagesToDownload lockAddObject:url]; + } + + // start downloading XXX things at a time + for (int i=0; i0) { + imageToDownload = [[[imagesToDownload objectAtIndex:0] retain] autorelease]; + [imagesToDownload removeObjectAtIndex:0]; + } + [imagesToDownload unlock]; + + // if there's nothing to download, bail here + if (imageToDownload == nil) { + //NSLog(@"\t\tbailing, no more images to download, %s",__func__); + return; + } + + // make a downloader for the thumbnail- run it on another queue + VVCURLDL *newDL = [[VVCURLDL alloc] initWithAddress:imageToDownload]; + [newDL setDNSCacheTimeout:10]; + [newDL setConnectTimeout:10]; + [newDL + performOnQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0) + //performOnQueue:dispatch_get_main_queue() + block:^(VVCURLDL *finished) { + // this block runs after the download is complete- make an image, pass it back to the downloader + NSData *data = [finished responseData]; + NSImage *thumb = [[NSImage alloc] initWithData:data]; + + [self downloadedImage:thumb fromURL:[finished urlString]]; + + [thumb autorelease]; + [finished autorelease]; + }]; +} +- (void) downloadedImage:(NSImage *)img fromURL:(NSString *)urlString { + //NSLog(@"%s ... %@",__func__,urlString); + if (urlString==nil) + return; + // run through my completedDownloads, pass the image to any completedDownloads that need it + BOOL updatedSomething = NO; + [completedDownloads rdlock]; + for (ISFPDownload *download in [completedDownloads array]) { + if ([[download thumbURL] isEqualToString:urlString]) { + [download setThumb:img]; + updatedSomething = YES; + } + } + [completedDownloads unlock]; + + // if i updated something, i have to reload the table view... + if (updatedSomething) { + //NSLog(@"\t\tupdated something, should be setting up table redraw timer..."); + // use a timer to throttle table view redraws (the table won't redraw until there's a pause of 1 sec either between completedDownloads or after completedDownloads) + // have to do this on the main queue, can't do it here- this method is called from a low-priority GCD queue, which doesn't have a runloop so you can't attach a timer to it + dispatch_async(dispatch_get_main_queue(), ^{ + //[self _resetReloadTableTimer]; + [self reloadTableButThrottleThisMethod]; + }); + } + + // i downloaded an image, start downloading another + [self startDownloadingImage]; +} +- (void) reloadTableButThrottleThisMethod { + BOOL needToReloadNow = NO; + @synchronized (self) { + // if there's no timer, we need to reload now, and start a timer to reload it again in a short while + if (reloadTableTimer == nil) { + needToReloadNow = YES; + reloadTableTimer = [NSTimer + scheduledTimerWithTimeInterval:0.75 + target:self + selector:@selector(timerThrottledTableReloader:) + userInfo:nil + repeats:NO]; + } + // else there's a timer- don't do anything, just wait for it to run out + else { + + } + } +} +- (void) timerThrottledTableReloader:(NSTimer *)t { + //NSLog(@"%s",__func__); + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self timerThrottledTableReloader:t]; + }); + return; + } + + @synchronized (self) { + reloadTableTimer = nil; + } + NSInteger selRow = [tableView selectedRow]; + [tableView reloadData]; + if (selRow>=0 && selRow!=NSNotFound) + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selRow] byExtendingSelection:NO]; +} + + +#pragma mark - + + +- (NSInteger) numberOfRowsInTableView:(NSTableView *)tv { + return [completedDownloads lockCount]; +} +- (NSView *) tableView:(NSTableView *)tv viewForTableColumn:(NSTableColumn *)tc row:(NSInteger)row { + NSView *returnMe = nil; + returnMe = [tv makeViewWithIdentifier:@"MainCell" owner:self]; + ISFPDownload *download = [completedDownloads lockObjectAtIndex:row]; + [(ISFPDownloadTableCellView *)returnMe refreshWithDownload:download]; + return returnMe; +} +- (void) tableViewSelectionDidChange:(NSNotification *)note { + //NSLog(@"%s",__func__); + // get the download corresponding to the selected row + NSInteger selectedRow = [tableView selectedRow]; + ISFPDownload *dl = (selectedRow==NSNotFound) ? nil : [completedDownloads lockObjectAtIndex:selectedRow]; + NSString *fragPath = (dl==nil) ? nil : [dl fragPath]; + [isfController loadFile:fragPath]; + [docController loadFile:fragPath]; +} + + +@end diff --git a/ISF Editor/ISFPropAudioFFTTableCellView.h b/ISF Editor/ISFPropAudioFFTTableCellView.h new file mode 100644 index 00000000..4d536853 --- /dev/null +++ b/ISF Editor/ISFPropAudioFFTTableCellView.h @@ -0,0 +1,14 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropAudioFFTTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *maxField; + //IBOutlet NSButton *floatToggle; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropAudioFFTTableCellView.m b/ISF Editor/ISFPropAudioFFTTableCellView.m new file mode 100644 index 00000000..bbcfb3c7 --- /dev/null +++ b/ISF Editor/ISFPropAudioFFTTableCellView.m @@ -0,0 +1,81 @@ +#import "ISFPropAudioFFTTableCellView.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropAudioFFTTableCellView + + +- (void) dealloc { + [maxField setTarget:nil]; + //[floatToggle setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + + tmpString = [n objectForKey:@"MAX"]; + tmpNum = [self parseNumberFromString:tmpString]; + tmpString = (tmpNum==nil) ? @"" : VVFMTSTRING(@"%d",[tmpNum intValue]); + [maxField setStringValue:tmpString]; + + /* + tmpString = [n objectForKey:@"FLOAT"]; + tmpNum = [self parseBooleanFromString:tmpString]; + if (tmpNum == nil) + tmpNum = [self parseNumberFromString:tmpString]; + if (tmpNum == nil) + tmpNum = NUMINT(0); + [floatToggle setIntValue:([tmpNum intValue]>0) ? NSOnState : NSOffState]; + */ + + /* + tmpString = [n objectForKey:@"MAX"]; + if (tmpString==nil) + tmpString = @""; + else if ([tmpString isKindOfClass:[NSNumber class]]) + tmpString = VVFMTSTRING(@"%d",[(NSNumber *)tmpString intValue]); + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [maxField setStringValue:tmpString]; + */ + +} + + +- (IBAction) uiItemUsed:(id)sender { + NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + NSNumber *tmpNum = nil; + NSString *tmpString = nil; + // parse the string into a number value + if (sender == maxField) { + tmpString = [sender stringValue]; + if (tmpString!=nil) + tmpNum = [self parseNumberFromString:tmpString]; + [myInput setObject:tmpNum forKey:@"MAX"]; + } + /* + else if (sender == floatToggle) { + if ([floatToggle intValue]==NSOnState) + [myInput setObject:NUMBOOL(YES) forKey:@"FLOAT"]; + else + [myInput setObject:nil forKey:@"FLOAT"]; + } + */ + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropAudioTableCellView.h b/ISF Editor/ISFPropAudioTableCellView.h new file mode 100644 index 00000000..b8dddcc4 --- /dev/null +++ b/ISF Editor/ISFPropAudioTableCellView.h @@ -0,0 +1,13 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropAudioTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *maxField; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropAudioTableCellView.m b/ISF Editor/ISFPropAudioTableCellView.m new file mode 100644 index 00000000..0a8444dd --- /dev/null +++ b/ISF Editor/ISFPropAudioTableCellView.m @@ -0,0 +1,61 @@ +#import "ISFPropAudioTableCellView.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropAudioTableCellView + + +- (void) dealloc { + [maxField setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + + tmpString = [n objectForKey:@"MAX"]; + tmpNum = [self parseNumberFromString:tmpString]; + tmpString = (tmpNum==nil) ? @"" : VVFMTSTRING(@"%d",[tmpNum intValue]); + [maxField setStringValue:tmpString]; + /* + NSString *tmpString = nil; + + tmpString = [n objectForKey:@"MAX"]; + if (tmpString==nil) + tmpString = @""; + else if ([tmpString isKindOfClass:[NSNumber class]]) + tmpString = VVFMTSTRING(@"%d",[(NSNumber *)tmpString intValue]); + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [maxField setStringValue:tmpString]; + */ +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + + NSString *tmpString = [sender stringValue]; + + // 'default' and 'identity' need to each contain a single long from a string + if (sender == maxField) { + NSNumber *tmpNum = [self parseNumberFromString:tmpString]; + [myInput setObject:tmpNum forKey:@"MAX"]; + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropBoolTableCellView.h b/ISF Editor/ISFPropBoolTableCellView.h new file mode 100644 index 00000000..db7a7e8d --- /dev/null +++ b/ISF Editor/ISFPropBoolTableCellView.h @@ -0,0 +1,14 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropBoolTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *defaultField; + IBOutlet NSTextField *identityField; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropBoolTableCellView.m b/ISF Editor/ISFPropBoolTableCellView.m new file mode 100644 index 00000000..901b36f3 --- /dev/null +++ b/ISF Editor/ISFPropBoolTableCellView.m @@ -0,0 +1,82 @@ +#import "ISFPropBoolTableCellView.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropBoolTableCellView + + +- (void) dealloc { + [defaultField setTarget:nil]; + [identityField setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + + tmpString = [n objectForKey:@"DEFAULT"]; + tmpNum = [self parseBooleanFromString:tmpString]; + if (tmpNum == nil) + tmpNum = [self parseNumberFromString:tmpString]; + if (tmpNum == nil) + tmpNum = NUMINT(0); + [defaultField setStringValue:VVFMTSTRING(@"%d",[tmpNum intValue])]; + + tmpString = [n objectForKey:@"IDENTITY"]; + tmpNum = [self parseBooleanFromString:tmpString]; + if (tmpNum == nil) + tmpNum = [self parseNumberFromString:tmpString]; + if (tmpNum == nil) + tmpNum = NUMINT(0); + [identityField setStringValue:VVFMTSTRING(@"%d",[tmpNum intValue])]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + // parse the string into a number value + NSNumber *newNum = nil; + NSString *tmpString = [sender stringValue]; + if (tmpString!=nil) { + newNum = [self parseBooleanFromString:tmpString]; + if (newNum == nil) + newNum = [self parseNumberFromString:tmpString]; + /* + if ([tmpString localizedCaseInsensitiveCompare:@"YES"]==NSOrderedSame || + [tmpString localizedCaseInsensitiveCompare:@"TRUE"]==NSOrderedSame) { + newNum = NUMBOOL(YES); + } + else if ([tmpString localizedCaseInsensitiveCompare:@"NO"]==NSOrderedSame || + [tmpString localizedCaseInsensitiveCompare:@"FALSE"]==NSOrderedSame) { + newNum = NUMBOOL(NO); + } + else { + newNum = [self parseNumberFromString:[sender stringValue]]; + } + */ + } + //NSLog(@"\t\tnewNum is %@",newNum); + + if (sender == defaultField) { + [myInput setObject:newNum forKey:@"DEFAULT"]; + } + else if (sender == identityField) { + [myInput setObject:newNum forKey:@"IDENTITY"]; + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropColorTableCellView.h b/ISF Editor/ISFPropColorTableCellView.h new file mode 100644 index 00000000..c7e0df3b --- /dev/null +++ b/ISF Editor/ISFPropColorTableCellView.h @@ -0,0 +1,21 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropColorTableCellView : ISFPropInputTableCellView { + IBOutlet NSColorWell *defaultCWell; + IBOutlet NSColorWell *minCWell; + IBOutlet NSColorWell *maxCWell; + IBOutlet NSColorWell *identityCWell; + + IBOutlet NSButton *defaultCWellButton; + IBOutlet NSButton *minCWellButton; + IBOutlet NSButton *maxCWellButton; + IBOutlet NSButton *identityCWellButton; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropColorTableCellView.m b/ISF Editor/ISFPropColorTableCellView.m new file mode 100644 index 00000000..adae9338 --- /dev/null +++ b/ISF Editor/ISFPropColorTableCellView.m @@ -0,0 +1,177 @@ +#import "ISFPropColorTableCellView.h" +#import +#import "JSONGUIController.h" +#import "NSColorAdditions.h" + + + + +@implementation ISFPropColorTableCellView + + +- (void) dealloc { + //NSLog(@"%s",__func__); + // we have to set the targets to nil here or the color wells may be deactivated after self has been freed (which crashes) + [defaultCWell setTarget:nil]; + [minCWell setTarget:nil]; + [maxCWell setTarget:nil]; + [identityCWell setTarget:nil]; + [defaultCWellButton setTarget:nil]; + [minCWellButton setTarget:nil]; + [maxCWellButton setTarget:nil]; + [identityCWellButton setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSColor *tmpColor = nil; + + tmpColor = [NSColor devColorFromValArray:[n objectForKey:@"DEFAULT"]]; + [defaultCWellButton setIntValue:(tmpColor==nil) ? NSOffState : NSOnState]; + if (tmpColor != nil) + [defaultCWell setColor:tmpColor]; + + tmpColor = [NSColor devColorFromValArray:[n objectForKey:@"MIN"]]; + [minCWellButton setIntValue:(tmpColor==nil) ? NSOffState : NSOnState]; + if (tmpColor != nil) + [minCWell setColor:tmpColor]; + + tmpColor = [NSColor devColorFromValArray:[n objectForKey:@"MAX"]]; + [maxCWellButton setIntValue:(tmpColor==nil) ? NSOffState : NSOnState]; + if (tmpColor != nil) + [maxCWell setColor:tmpColor]; + + tmpColor = [NSColor devColorFromValArray:[n objectForKey:@"IDENTITY"]]; + [identityCWellButton setIntValue:(tmpColor==nil) ? NSOffState : NSOnState]; + if (tmpColor != nil) + [identityCWell setColor:tmpColor]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + + + + if (sender == defaultCWell) { + // if the corresponding button is disabled, bail immediately b/c we aren't saving the value + if ([defaultCWellButton intValue]==NSOffState) + return; + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [(NSColorWell *)sender color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"DEFAULT"]; + } + else if (sender == minCWell) { + // if the corresponding button is disabled, bail immediately b/c we aren't saving the value + if ([minCWellButton intValue]==NSOffState) + return; + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [(NSColorWell *)sender color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"MIN"]; + } + else if (sender == maxCWell) { + // if the corresponding button is disabled, bail immediately b/c we aren't saving the value + if ([maxCWellButton intValue]==NSOffState) + return; + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [(NSColorWell *)sender color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"MAX"]; + } + else if (sender == identityCWell) { + // if the corresponding button is disabled, bail immediately b/c we aren't saving the value + if ([identityCWellButton intValue]==NSOffState) + return; + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [(NSColorWell *)sender color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"IDENTITY"]; + } + else if (sender == defaultCWellButton) { + if ([sender intValue] == NSOffState) + [myInput setObject:nil forKey:@"DEFAULT"]; + else { + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [defaultCWell color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"DEFAULT"]; + } + } + else if (sender == minCWellButton) { + if ([sender intValue] == NSOffState) + [myInput setObject:nil forKey:@"MIN"]; + else { + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [minCWell color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"MIN"]; + } + } + else if (sender == maxCWellButton) { + if ([sender intValue] == NSOffState) + [myInput setObject:nil forKey:@"MAX"]; + else { + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [maxCWell color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"MAX"]; + } + } + else if (sender == identityCWellButton) { + if ([sender intValue] == NSOffState) + [myInput setObject:nil forKey:@"IDENTITY"]; + else { + // get the color, convert it to an array of values, store them in my dict + NSMutableArray *newColorArray = MUTARRAY; + NSColor *newColor = [identityCWell color]; + CGFloat colorComps[4]; + [newColor getComponents:colorComps]; + for (int i=0; i<4; ++i) + [newColorArray addObject:NUMDOUBLE(colorComps[i])]; + [myInput setObject:newColorArray forKey:@"IDENTITY"]; + } + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropErrTableCellView.h b/ISF Editor/ISFPropErrTableCellView.h new file mode 100644 index 00000000..a9453558 --- /dev/null +++ b/ISF Editor/ISFPropErrTableCellView.h @@ -0,0 +1,11 @@ +#import +#import "JSONGUIController.h" + + + + +@interface ISFPropErrTableCellView : NSTableCellView { + +} + +@end diff --git a/ISF Editor/ISFPropErrTableCellView.m b/ISF Editor/ISFPropErrTableCellView.m new file mode 100644 index 00000000..cbc4ed16 --- /dev/null +++ b/ISF Editor/ISFPropErrTableCellView.m @@ -0,0 +1,5 @@ +#import "ISFPropErrTableCellView.h" + +@implementation ISFPropErrTableCellView + +@end diff --git a/ISF Editor/ISFPropEventTableCellView.h b/ISF Editor/ISFPropEventTableCellView.h new file mode 100644 index 00000000..d19cba6d --- /dev/null +++ b/ISF Editor/ISFPropEventTableCellView.h @@ -0,0 +1,13 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropEventTableCellView : ISFPropInputTableCellView { + +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropEventTableCellView.m b/ISF Editor/ISFPropEventTableCellView.m new file mode 100644 index 00000000..869b587d --- /dev/null +++ b/ISF Editor/ISFPropEventTableCellView.m @@ -0,0 +1,24 @@ +#import "ISFPropEventTableCellView.h" + + + + +@implementation ISFPropEventTableCellView + + +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); +} + + +@end diff --git a/ISF Editor/ISFPropFloatTableCellView.h b/ISF Editor/ISFPropFloatTableCellView.h new file mode 100644 index 00000000..1b52af3f --- /dev/null +++ b/ISF Editor/ISFPropFloatTableCellView.h @@ -0,0 +1,16 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropFloatTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *defaultField; + IBOutlet NSTextField *minField; + IBOutlet NSTextField *maxField; + IBOutlet NSTextField *identityField; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropFloatTableCellView.m b/ISF Editor/ISFPropFloatTableCellView.m new file mode 100644 index 00000000..045435d1 --- /dev/null +++ b/ISF Editor/ISFPropFloatTableCellView.m @@ -0,0 +1,71 @@ +#import "ISFPropFloatTableCellView.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropFloatTableCellView + + +- (void) dealloc { + [defaultField setTarget:nil]; + [minField setTarget:nil]; + [maxField setTarget:nil]; + [identityField setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + + tmpString = [n objectForKey:@"DEFAULT"]; + tmpNum = [self parseNumberFromString:tmpString]; + [defaultField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%f",[tmpNum doubleValue])]; + + tmpString = [n objectForKey:@"MIN"]; + tmpNum = [self parseNumberFromString:tmpString]; + [minField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%f",[tmpNum doubleValue])]; + + tmpString = [n objectForKey:@"MAX"]; + tmpNum = [self parseNumberFromString:tmpString]; + [maxField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%f",[tmpNum doubleValue])]; + + tmpString = [n objectForKey:@"IDENTITY"]; + tmpNum = [self parseNumberFromString:tmpString]; + [identityField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%f",[tmpNum doubleValue])]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + // parse the string into a number value + NSNumber *newNum = [self parseNumberFromString:[sender stringValue]]; + + + if (sender == defaultField) { + [myInput setObject:newNum forKey:@"DEFAULT"]; + } + else if (sender == minField) { + [myInput setObject:newNum forKey:@"MIN"]; + } + else if (sender == maxField) { + [myInput setObject:newNum forKey:@"MAX"]; + } + else if (sender == identityField) { + [myInput setObject:newNum forKey:@"IDENTITY"]; + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropGroupTableCellView.h b/ISF Editor/ISFPropGroupTableCellView.h new file mode 100644 index 00000000..a80c7553 --- /dev/null +++ b/ISF Editor/ISFPropGroupTableCellView.h @@ -0,0 +1,19 @@ +#import +#import "JSONGUIController.h" + + + + +@interface ISFPropGroupTableCellView : NSTableCellView { + IBOutlet NSTextField *groupNameField; + + ObjectHolder *group; // JSONGUIArrayGroup +} + +- (IBAction) addButtonUsed:(id)sender; + +- (void) refreshWithGroup:(JSONGUIArrayGroup *)n; + +- (JSONGUIArrayGroup *) group; + +@end diff --git a/ISF Editor/ISFPropGroupTableCellView.m b/ISF Editor/ISFPropGroupTableCellView.m new file mode 100644 index 00000000..067126e4 --- /dev/null +++ b/ISF Editor/ISFPropGroupTableCellView.m @@ -0,0 +1,114 @@ +#import "ISFPropGroupTableCellView.h" +#import "JSONGUIInput.h" + + + + +@implementation ISFPropGroupTableCellView + + +- (id) initWithFrame:(NSRect)f { + self = [super initWithFrame:f]; + @synchronized (self) { + group = nil; + } + return self; +} +- (id) initWithCoder:(NSCoder *)c { + self = [super initWithCoder:c]; + @synchronized (self) { + group = nil; + } + return self; +} +- (void) dealloc { + [groupNameField setTarget:nil]; + [super dealloc]; + @synchronized (self) { + VVRELEASE(group); + } +} +- (void) drawRect:(NSRect)r { + NSColor *bgColor = [[self window] backgroundColor]; + if (bgColor == nil) + return; + [bgColor set]; + NSRectFill([self bounds]); + [super drawRect:r]; +} + + +- (IBAction) addButtonUsed:(id)sender { + //NSLog(@"%s",__func__); + // get my group + JSONGUIArrayGroup *myGroup = [self group]; + if (myGroup==nil) + return; + JSONGUITop *top = [myGroup top]; + if (top==nil) + return; + // depending on what kind of group, i need to make a new...thing + switch ([myGroup groupType]) { + case ISFArrayClassType_Input: + { + // tell the top to create a new input name + NSString *newInputName = [top createNewInputName]; + // make a dict that describes the new input (we'll go with a simple float for the default) + NSMutableDictionary *newInputDict = MUTDICT; + [newInputDict setObject:newInputName forKey:@"NAME"]; + [newInputDict setObject:@"float" forKey:@"TYPE"]; + // make a new input from the dict + JSONGUIInput *newInput = [[[JSONGUIInput alloc] initWithDict:newInputDict top:top] autorelease]; + if (newInput == nil) + NSLog(@"\t\terr: couldn't make new input, %s. dict was %@",__func__,newInputDict); + else { + // add the input to the array! + [[myGroup contents] lockAddObject:newInput]; + } + break; + } + case ISFArrayClassType_Pass: + { + // make a new pass + JSONGUIPass *newPass = [[[JSONGUIPass alloc] initWithDict:nil top:top] autorelease]; + if (newPass==nil) + NSLog(@"\t\terr: couldn't make new pass, %s",__func__); + else { + // add the new pass to the array of passes + [[myGroup contents] lockAddObject:newPass]; + } + break; + } + } + + // recreate the JSON blob, export the file, and have everybody reload it! + [_globalJSONGUIController recreateJSONAndExport]; +} +- (void) refreshWithGroup:(JSONGUIArrayGroup *)n { + //NSLog(@"%s ... %@",__func__,n); + @synchronized (self) { + VVRELEASE(group); + group = (n==nil) ? nil : [[ObjectHolder alloc] initWithZWRObject:n]; + } + + switch ([n groupType]) { + case ISFArrayClassType_Input: + [groupNameField setStringValue:[NSString stringWithFormat:@"INPUTS (%ld)",[[n contents] lockCount]]]; + break; + case ISFArrayClassType_Pass: + [groupNameField setStringValue:[NSString stringWithFormat:@"PASSES (%ld)",[[n contents] lockCount]]]; + break; + } +} + + +- (JSONGUIArrayGroup *) group { + JSONGUIArrayGroup *returnMe = nil; + @synchronized (self) { + returnMe = (group==nil) ? nil : [group object]; + } + return returnMe; +} + + +@end diff --git a/ISF Editor/ISFPropImageTableCellView.h b/ISF Editor/ISFPropImageTableCellView.h new file mode 100644 index 00000000..3e4ed9a7 --- /dev/null +++ b/ISF Editor/ISFPropImageTableCellView.h @@ -0,0 +1,12 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropImageTableCellView : ISFPropInputTableCellView { +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropImageTableCellView.m b/ISF Editor/ISFPropImageTableCellView.m new file mode 100644 index 00000000..bb714a7f --- /dev/null +++ b/ISF Editor/ISFPropImageTableCellView.m @@ -0,0 +1,24 @@ +#import "ISFPropImageTableCellView.h" + + + + +@implementation ISFPropImageTableCellView + + +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); +} + + +@end diff --git a/ISF Editor/ISFPropInputTableCellView.h b/ISF Editor/ISFPropInputTableCellView.h new file mode 100644 index 00000000..34cd73fe --- /dev/null +++ b/ISF Editor/ISFPropInputTableCellView.h @@ -0,0 +1,31 @@ +#import +#import "JSONGUIInput.h" +#import "JSONGUIDragBarView.h" + + + + +@interface ISFPropInputTableCellView : NSTableCellView { + IBOutlet NSTextField *inputNameField; + + IBOutlet NSTextField *labelField; + IBOutlet NSPopUpButton *typePUB; + + ObjectHolder *input; // retained + + IBOutlet JSONGUIDragBarView *dragBar; +} + +- (IBAction) baseUIItemUsed:(id)sender; +- (IBAction) deleteClicked:(id)sender; + +- (void) refreshWithInput:(JSONGUIInput *)n; + +- (JSONGUIInput *) input; + +- (NSNumber *) parseBooleanFromString:(NSString *)n; +- (NSNumber *) parseNumberFromString:(NSString *)n; +- (NSArray *) parseValArrayFromString:(NSString *)n; +- (NSArray *) parseStringArrayFromString:(NSString *)n; + +@end diff --git a/ISF Editor/ISFPropInputTableCellView.m b/ISF Editor/ISFPropInputTableCellView.m new file mode 100644 index 00000000..993aed4a --- /dev/null +++ b/ISF Editor/ISFPropInputTableCellView.m @@ -0,0 +1,233 @@ +#import "ISFPropInputTableCellView.h" +#import +#import +#import "JSONGUIController.h" +#import +#import "RegexKitLite.h" + + + + +@implementation ISFPropInputTableCellView + + +- (id) initWithFrame:(NSRect)f { + self = [super initWithFrame:f]; + @synchronized (self) { + input = nil; + } + return self; +} +- (id) initWithCoder:(NSCoder *)c { + self = [super initWithCoder:c]; + @synchronized (self) { + input = nil; + } + return self; +} +- (void) dealloc { + [inputNameField setTarget:nil]; + [labelField setTarget:nil]; + [typePUB setTarget:nil]; + @synchronized (self) { + VVRELEASE(input); + } + [super dealloc]; +} +- (IBAction) baseUIItemUsed:(id)sender { + //NSLog(@"%s",__func__); + BOOL needsSaveAndReload = NO; + if (sender == inputNameField) { + // first of all, get my input- only proceed if we can find the input... + JSONGUIInput *myInput = [self input]; + if (myInput != nil) { + // get the new val + NSString *newVal = [[inputNameField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + // get the old val + NSString *oldVal = [myInput objectForKey:@"NAME"]; + // if the old val and new val are identical, don't do anything + if ((newVal==nil && oldVal==nil) || + (newVal!=nil && oldVal!=nil && [newVal isEqualToString:oldVal])) { + // ...do nothing here + } + // else the new and old vals are different- we're trying to change the name + else { + // get the top, ask it for any inputs using the new val- only proceed if there's no collision... + JSONGUITop *myTop = [myInput top]; + JSONGUIInput *nameCollisionInput = [myTop getInputNamed:newVal]; + if (nameCollisionInput == nil) { + // update my name in my dict to the new name! + [myInput setObject:newVal forKey:@"NAME"]; + + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + // something was FUBAR, reload anyway + else + needsSaveAndReload = YES; + } + } + // something was FUBAR, reload anyway + else + needsSaveAndReload = YES; + } + else if (sender == labelField) { + JSONGUIInput *myInput = [self input]; + if (myInput != nil) { + // get the new & old vals + NSString *newVal = [[labelField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + NSString *oldVal = [myInput objectForKey:@"LABEL"]; + // if there's no change, don't do anything + if ((newVal==nil && oldVal==nil) || + (newVal!=nil && oldVal!=nil && [newVal isEqualToString:oldVal])) { + // ...do nothing here + } + // else the val changed, and must be applied + else { + if ([newVal length]<1) + newVal = nil; + [myInput setObject:newVal forKey:@"LABEL"]; + + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + } + // something was FUBAR, reload anyway + else + needsSaveAndReload = YES; + } + else if (sender == typePUB) { + // first of all, get my input- only proceed if we can find the input... + JSONGUIInput *myInput = [self input]; + if (myInput != nil) { + // get the new val + NSString *newVal = [typePUB titleOfSelectedItem]; + // get the old val + NSString *oldVal = [myInput objectForKey:@"TYPE"]; + // if the old val & new val are the same, we don't have to do anything + if (newVal!=nil && oldVal!=nil && [newVal isEqualToString:oldVal]) { + // ...do nothing here + } + // else the new and old vals are different- we're trying to change the type + else { + // delete any properties that might have been relevant to the old type + [myInput setObject:nil forKey:@"MIN"]; + [myInput setObject:nil forKey:@"MAX"]; + [myInput setObject:nil forKey:@"DEFAULT"]; + [myInput setObject:nil forKey:@"IDENTITY"]; + [myInput setObject:nil forKey:@"VALUES"]; + [myInput setObject:nil forKey:@"LABELS"]; + // set the new type + [myInput setObject:newVal forKey:@"TYPE"]; + + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + } + // something was FUBAR, reload anyway + else + needsSaveAndReload = YES; + } + + // if i've made changes and need to save/reload stuff, do so now! + if (needsSaveAndReload) { + [_globalJSONGUIController recreateJSONAndExport]; + } +} +- (IBAction) deleteClicked:(id)sender { + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + JSONGUITop *top = [myInput top]; + [[[top inputsGroup] contents] lockRemoveObject:myInput]; + + [_globalJSONGUIController recreateJSONAndExport]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + if (n==nil) + return; + + @synchronized (self) { + VVRELEASE(input); + input = [[ObjectHolder alloc] initWithZWRObject:n]; + } + + NSString *tmpString = nil; + + tmpString = [n objectForKey:@"NAME"]; + if (tmpString == nil) + tmpString = @"???"; + [inputNameField setStringValue:tmpString]; + + tmpString = [n objectForKey:@"LABEL"]; + if (tmpString == nil) + tmpString = @""; + [labelField setStringValue:tmpString]; + + tmpString = [n objectForKey:@"TYPE"]; + [typePUB selectItem:nil]; + if (tmpString != nil) + [typePUB selectItemWithTitle:tmpString]; +} +- (JSONGUIInput *) input { + JSONGUIInput *returnMe = nil; + @synchronized (self) { + returnMe = (input==nil) ? nil : [input object]; + } + return returnMe; +} +- (NSNumber *) parseBooleanFromString:(NSString *)n { + if (n==nil) + return nil; + if ([n isKindOfClass:[NSNumber class]]) + return [[(NSNumber *)n retain] autorelease]; + return [n parseAsBoolean]; +} +- (NSNumber *) parseNumberFromString:(NSString *)n { + if (n==nil) + return nil; + if ([n isKindOfClass:[NSNumber class]]) + return [[(NSNumber *)n retain] autorelease]; + if (![n isKindOfClass:[NSString class]]) + return nil; + if ([n length]<1) + return nil; + return [n numberByEvaluatingString]; +} +- (NSArray *) parseValArrayFromString:(NSString *)n { + //NSLog(@"%s",__func__); + if (n==nil || [n length]<1) + return nil; + NSMutableArray *returnMe = nil; + //NSArray *components = [n componentsSeparatedByRegex:@"[^\\w]"]; + NSArray *components = [n componentsSeparatedByRegex:@"[^0-9\\.]"]; + for (NSString *tmpString in components) { + if ([tmpString length]>0) { + NSNumber *tmpNum = [tmpString numberByEvaluatingString]; + if (tmpNum != nil) { + if (returnMe == nil) + returnMe = MUTARRAY; + [returnMe addObject:tmpNum]; + } + } + } + return returnMe; +} +- (NSArray *) parseStringArrayFromString:(NSString *)n { + if (n==nil) + return nil; + NSMutableArray *returnMe = nil; + NSArray *components = [n componentsSeparatedByRegex:@"[^\\w]"]; + for (NSString *tmpString in components) { + if ([tmpString length]>0) { + if (returnMe == nil) + returnMe = MUTARRAY; + [returnMe addObject:tmpString]; + } + } + return returnMe; +} + + +@end diff --git a/ISF Editor/ISFPropLongTableCellView.h b/ISF Editor/ISFPropLongTableCellView.h new file mode 100644 index 00000000..f197a53f --- /dev/null +++ b/ISF Editor/ISFPropLongTableCellView.h @@ -0,0 +1,17 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropLongTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *defaultField; + IBOutlet NSTextField *identityField; + + IBOutlet NSTextField *valuesField; + IBOutlet NSTextField *labelsField; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropLongTableCellView.m b/ISF Editor/ISFPropLongTableCellView.m new file mode 100644 index 00000000..13445567 --- /dev/null +++ b/ISF Editor/ISFPropLongTableCellView.m @@ -0,0 +1,106 @@ +#import "ISFPropLongTableCellView.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropLongTableCellView + + +- (void) dealloc { + [defaultField setTarget:nil]; + [identityField setTarget:nil]; + [valuesField setTarget:nil]; + [labelsField setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSArray *tmpArray = nil; + NSMutableString *mutString = nil; + NSInteger tmpIndex = 0; + + tmpArray = [n objectForKey:@"VALUES"]; + mutString = [NSMutableString stringWithCapacity:0]; + tmpIndex = 0; + for (NSString *tmpString in tmpArray) { + if ([tmpString isKindOfClass:[NSString class]]) { + if (tmpIndex > 0) + [mutString appendFormat:@", %@",tmpString]; + else + [mutString appendString:tmpString]; + } + else if ([tmpString isKindOfClass:[NSNumber class]]) { + if (tmpIndex > 0) + [mutString appendFormat:@", %d",[(NSNumber *)tmpString intValue]]; + else + [mutString appendFormat:@"%d",[(NSNumber *)tmpString intValue]]; + } + ++tmpIndex; + } + [valuesField setStringValue:mutString]; + + tmpArray = [n objectForKey:@"LABELS"]; + mutString = [NSMutableString stringWithCapacity:0]; + tmpIndex = 0; + for (NSString *tmpString in tmpArray) { + if (tmpIndex > 0) + [mutString appendFormat:@", %@",tmpString]; + else + [mutString appendString:tmpString]; + ++tmpIndex; + } + [labelsField setStringValue:mutString]; + + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + + tmpString = [n objectForKey:@"DEFAULT"]; + tmpNum = [self parseNumberFromString:tmpString]; + [defaultField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%d",[tmpNum intValue])]; + + tmpString = [n objectForKey:@"IDENTITY"]; + tmpNum = [self parseNumberFromString:tmpString]; + [identityField setStringValue:(tmpNum==nil) ? @"" : VVFMTSTRING(@"%d",[tmpNum intValue])]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + + NSString *tmpString = [sender stringValue]; + + // 'default' and 'identity' need to each contain a single long from a string + if (sender == defaultField) { + NSNumber *tmpNum = [self parseNumberFromString:tmpString]; + [myInput setObject:tmpNum forKey:@"DEFAULT"]; + } + else if (sender == identityField) { + NSNumber *tmpNum = [self parseNumberFromString:tmpString]; + [myInput setObject:tmpNum forKey:@"IDENTITY"]; + } + // 'values' needs to be an array of values from strings + else if (sender == valuesField) { + NSArray *tmpNums = [self parseValArrayFromString:tmpString]; + [myInput setObject:tmpNums forKey:@"VALUES"]; + } + // 'labels' needs to be an array of strings + else if (sender == labelsField) { + NSArray *tmpStrings = [self parseStringArrayFromString:tmpString]; + [myInput setObject:tmpStrings forKey:@"LABELS"]; + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropPassTableCellView.h b/ISF Editor/ISFPropPassTableCellView.h new file mode 100644 index 00000000..80772c69 --- /dev/null +++ b/ISF Editor/ISFPropPassTableCellView.h @@ -0,0 +1,30 @@ +#import +#import "JSONGUIPass.h" +#import "JSONGUITop.h" +#import "JSONGUIDragBarView.h" + + + + +@interface ISFPropPassTableCellView : NSTableCellView { + IBOutlet NSTextField *passNameField; + + IBOutlet NSTextField *targetField; + IBOutlet NSButton *persistentToggle; + IBOutlet NSButton *floatToggle; + IBOutlet NSTextField *widthField; + IBOutlet NSTextField *heightField; + + ObjectHolder *pass; // really a JSONGUIPass + + IBOutlet JSONGUIDragBarView *dragBar; +} + +- (IBAction) uiItemUsed:(id)sender; +- (IBAction) deleteClicked:(id)sender; + +- (void) refreshWithTop:(JSONGUITop *)t pass:(JSONGUIPass *)p; + +- (JSONGUIPass *) pass; + +@end diff --git a/ISF Editor/ISFPropPassTableCellView.m b/ISF Editor/ISFPropPassTableCellView.m new file mode 100644 index 00000000..bf7a2097 --- /dev/null +++ b/ISF Editor/ISFPropPassTableCellView.m @@ -0,0 +1,279 @@ +#import "ISFPropPassTableCellView.h" +#import "JSONGUIPersistentBuffer.h" +#import +#import +#import "JSONGUIController.h" + + + + +@implementation ISFPropPassTableCellView + + +- (id) initWithFrame:(NSRect)f { + self = [super initWithFrame:f]; + @synchronized (self) { + pass = nil; + } + return self; +} +- (id) initWithCoder:(NSCoder *)c { + self = [super initWithCoder:c]; + @synchronized (self) { + pass = nil; + } + return self; +} +- (void) dealloc { + [passNameField setTarget:nil]; + [targetField setTarget:nil]; + [persistentToggle setTarget:nil]; + [floatToggle setTarget:nil]; + [widthField setTarget:nil]; + [heightField setTarget:nil]; + @synchronized (self) { + VVRELEASE(pass); + } + [super dealloc]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + // get the pass & top, we're probably going to need it + JSONGUIPass *myPass = [self pass]; + //NSLog(@"\t\tmyPass is %@",myPass); + JSONGUITop *top = [myPass top]; + BOOL needsSaveAndReload = NO; + + if (sender == targetField) { + NSString *oldName = [myPass objectForKey:@"TARGET"]; + // get the target name- if it's empty, set it to nil + NSString *targetName = [[targetField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + if (targetName!=nil && [targetName length]<1) + targetName = nil; + // if the target name matches the current name, do nothing + if ((oldName==nil && targetName==nil) || + (oldName!=nil && targetName!=nil && [oldName isEqualToString:targetName])) { + // do nothing! + } + // else we're changing the target name + else { + // if another pass is already using the target name + if ([top getPassesRenderingToBufferNamed:targetName]!=nil) { + // we can't use the target name- for program flow, reset it to the "old" name + targetName = oldName; + } + // else no passes are using the target name- we're clear to use it + else { + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + [myPass setObject:targetName forKey:@"TARGET"]; + } + } + + } + else if (sender == persistentToggle) { + //NSLog(@"\t\tpersistent toggle used"); + // get the target name- if there isn't a target name, bail immediately + NSString *targetName = [myPass objectForKey:@"TARGET"]; + if (targetName!=nil) { + // if we're enabling the persistent toggle + if ([persistentToggle intValue]==NSOnState) { + // make a new persistent buffer object with the appropriate name + JSONGUIPersistentBuffer *pbuffer = [[[JSONGUIPersistentBuffer alloc] initWithName:targetName top:top] autorelease]; + // add the new persistent buffer to the dict of persistent buffers + [[[top buffersGroup] contents] lockSetObject:pbuffer forKey:targetName]; + } + // else we're disabling the persistent toggle + else { + //NSLog(@"\t\tshould be disabling persistent toggle"); + // locate the existing persistent buffer object + JSONGUIPersistentBuffer *pbuffer = [top getPersistentBufferNamed:targetName]; + //NSLog(@"\t\tpbuffer is %@",pbuffer); + // add the objects from the persistent buffer object's dict to my pass dict so i don't lose any sizing data + NSDictionary *oldBufferDict = [pbuffer createExportDict]; + for (NSString *tmpKey in [oldBufferDict allKeys]) { + if (![tmpKey isEqualToString:@"PERSISTENT"]) + [myPass setObject:[oldBufferDict objectForKey:tmpKey] forKey:tmpKey]; + } + // delete the persistent buffer object + //NSLog(@"\t\tbefore, buffersGroup is %@",[[top buffersGroup] contents]); + [[[top buffersGroup] contents] lockRemoveObjectForKey:targetName]; + //NSLog(@"\t\tafter, buffersGroup is %@",[[top buffersGroup] contents]); + // make sure all the passes know that anything targeting this isn't rendering to a peristent buffer + for (JSONGUIPass *tmpPass in [top getPassesRenderingToBufferNamed:targetName]) { + if ([tmpPass objectForKey:@"PERSISTENT"]!=nil) + [tmpPass setObject:nil forKey:@"PERSISTENT"]; + } + } + } + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + else if (sender == floatToggle) { + //NSLog(@"\t\tfloat toggle used"); + BOOL newFloatVal = ([floatToggle intValue]==NSOnState) ? YES : NO; + // get the target name + NSString *targetName = [myPass objectForKey:@"TARGET"]; + // try to get a persistent buffer for the name + JSONGUIPersistentBuffer *pbuffer = [top getPersistentBufferNamed:targetName]; + //NSLog(@"\t\ttargetName is %@, pbuffer is %@",targetName,pbuffer); + // if i got a persistent buffer, add the float property there + if (pbuffer != nil) { + [pbuffer setObject:((newFloatVal) ? NUMBOOL(YES) : nil) forKey:@"FLOAT"]; + } + // else i didn't get a persistent buffer- add the float property to the pass dict + else { + [myPass setObject:((newFloatVal) ? NUMBOOL(YES) : nil) forKey:@"FLOAT"]; + } + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + else if (sender == widthField) { + NSString *newStringVal = [[sender stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + if (newStringVal!=nil && [newStringVal length]<1) + newStringVal = nil; + // get the target name + NSString *targetName = [myPass objectForKey:@"TARGET"]; + // try to get a persistent buffer for the name + JSONGUIPersistentBuffer *pbuffer = [top getPersistentBufferNamed:targetName]; + // if i got a persistent buffer, add the float property there + if (pbuffer != nil) + [pbuffer setObject:newStringVal forKey:@"WIDTH"]; + // else i didn't get a persistent buffer- add the float property to the pass dict + else + [myPass setObject:newStringVal forKey:@"WIDTH"]; + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + else if (sender == heightField) { + NSString *newStringVal = [[sender stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + if (newStringVal!=nil && [newStringVal length]<1) + newStringVal = nil; + // get the target name + NSString *targetName = [myPass objectForKey:@"TARGET"]; + // try to get a persistent buffer for the name + JSONGUIPersistentBuffer *pbuffer = [top getPersistentBufferNamed:targetName]; + // if i got a persistent buffer, add the float property there + if (pbuffer != nil) + [pbuffer setObject:newStringVal forKey:@"HEIGHT"]; + // else i didn't get a persistent buffer- add the float property to the pass dict + else + [myPass setObject:newStringVal forKey:@"HEIGHT"]; + // i've made changes- save to disk & reload! + needsSaveAndReload = YES; + } + + // if i've made changes and need to save/reload stuff, do so now! + if (needsSaveAndReload) { + [_globalJSONGUIController recreateJSONAndExport]; + } +} +- (IBAction) deleteClicked:(id)sender { + JSONGUIPass *myPass = [self pass]; + if (myPass == nil) + return; + JSONGUITop *top = [myPass top]; + [[[top passesGroup] contents] lockRemoveObject:myPass]; + + [_globalJSONGUIController recreateJSONAndExport]; +} +- (void) refreshWithTop:(JSONGUITop *)t pass:(JSONGUIPass *)p { + //NSLog(@"%s ... %@",__func__,p); + @synchronized (self) { + VVRELEASE(pass); + pass = [[ObjectHolder alloc] initWithZWRObject:p]; + } + + NSString *tmpString = nil; + NSNumber *tmpNum = nil; + //NSArray *tmpArray = nil; + + // get the index of the passed pass + NSInteger passIndex = [t indexOfPass:p]; + if (passIndex == NSNotFound) + NSLog(@"\t\tERR: passIndex for %@ is NSNotFound",p); + else { + // update the pass name field + [passNameField setStringValue:[NSString stringWithFormat:@"PASSINDEX %d",(int)passIndex]]; + + // update the target buffer name field + tmpString = [p objectForKey:@"TARGET"]; + if (tmpString == nil) + tmpString = @""; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [targetField setStringValue:tmpString]; + + // is there a persistent buffer for the target buffer? + JSONGUIPersistentBuffer *pbuffer = [t getPersistentBufferNamed:[targetField stringValue]]; + // get an array of passes that render to the target buffer + JSONGUIPass *myPass = [self pass]; + //NSArray *passes = [t getPassesRenderingToBufferNamed:[targetField stringValue]]; + //JSONGUIPass *pass = (passes==nil || [passes count]<1) ? nil : [passes objectAtIndex:0]; + // ...okay, so now we have all the source of information about this buffer- populate more UI items... + + // persistent toggle + [persistentToggle setIntValue:(pbuffer==nil) ? NSOffState : NSOnState]; + + // float toggle + tmpString = [myPass objectForKey:@"FLOAT"]; + if (tmpString!=nil && [tmpString isKindOfClass:[NSNumber class]]) + tmpNum = [[(NSNumber *)tmpString retain] autorelease]; + else if ([tmpString isKindOfClass:[NSString class]]) { + tmpNum = [tmpString parseAsBoolean]; + if (tmpNum == nil) + tmpNum = [tmpString numberByEvaluatingString]; + } + else + tmpNum = nil; + if (tmpNum == nil) + tmpNum = NUMINT(0); + [floatToggle setIntValue:([tmpNum intValue]>0) ? NSOnState : NSOffState]; + /* + tmpString = [myPass objectForKey:@"FLOAT"]; + if (tmpString == nil) + tmpString = [pbuffer objectForKey:@"FLOAT"]; + + tmpNum = [self parseBooleanFromString:tmpString]; + if (tmpNum == nil) + tmpNum = [self parseNumberFromString]; + if (tmpNum == nil) + tmpNum = NUMINT(0); + [floatToggle setIntValue:([tmpNum intValue]>0) ? NSOnState : NSOffState]; + */ + + // width field + tmpString = [myPass objectForKey:@"WIDTH"]; + if (tmpString == nil) + tmpString = [pbuffer objectForKey:@"WIDTH"]; + if ([tmpString isKindOfClass:[NSNumber class]]) + tmpString = [NSString stringWithFormat:@"%d",[(NSNumber *)tmpString intValue]]; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [widthField setStringValue:tmpString]; + + // height field + tmpString = [myPass objectForKey:@"HEIGHT"]; + if (tmpString == nil) + tmpString = [pbuffer objectForKey:@"HEIGHT"]; + if ([tmpString isKindOfClass:[NSNumber class]]) + tmpString = [NSString stringWithFormat:@"%d",[(NSNumber *)tmpString intValue]]; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [heightField setStringValue:tmpString]; + } +} + + +- (JSONGUIPass *) pass { + JSONGUIPass *returnMe = nil; + @synchronized (self) { + returnMe = (pass==nil) ? nil : [pass object]; + } + return returnMe; +} + + +@end diff --git a/ISF Editor/ISFPropPoint2DTableCellView.h b/ISF Editor/ISFPropPoint2DTableCellView.h new file mode 100644 index 00000000..8fc62add --- /dev/null +++ b/ISF Editor/ISFPropPoint2DTableCellView.h @@ -0,0 +1,16 @@ +#import +#import "ISFPropInputTableCellView.h" + + + + +@interface ISFPropPoint2DTableCellView : ISFPropInputTableCellView { + IBOutlet NSTextField *defaultField; + IBOutlet NSTextField *minField; + IBOutlet NSTextField *maxField; + IBOutlet NSTextField *identityField; +} + +- (IBAction) uiItemUsed:(id)sender; + +@end diff --git a/ISF Editor/ISFPropPoint2DTableCellView.m b/ISF Editor/ISFPropPoint2DTableCellView.m new file mode 100644 index 00000000..8bb3ae73 --- /dev/null +++ b/ISF Editor/ISFPropPoint2DTableCellView.m @@ -0,0 +1,85 @@ +#import "ISFPropPoint2DTableCellView.h" +#import +#import "JSONGUIController.h" +#import "NSValueAdditions.h" + + + + +@implementation ISFPropPoint2DTableCellView + + +- (void) dealloc { + [defaultField setTarget:nil]; + [minField setTarget:nil]; + [maxField setTarget:nil]; + [identityField setTarget:nil]; + [super dealloc]; +} +- (void) refreshWithInput:(JSONGUIInput *)n { + //NSLog(@"%s ... %@",__func__,n); + [super refreshWithInput:n]; + + if (n==nil) + return; + + NSValue *tmpVal = nil; + NSString *tmpString = nil; + + tmpVal = [NSValue pointValueFromValArray:[n objectForKey:@"DEFAULT"]]; + if (tmpVal==nil) + tmpString = @""; + tmpString = (tmpVal==nil) ? @"" : [NSString stringWithFormat:@"%f, %f",[tmpVal pointValue].x, [tmpVal pointValue].y]; + [defaultField setStringValue:tmpString]; + + tmpVal = [NSValue pointValueFromValArray:[n objectForKey:@"MIN"]]; + if (tmpVal==nil) + tmpString = @""; + tmpString = (tmpVal==nil) ? @"" : [NSString stringWithFormat:@"%f, %f",[tmpVal pointValue].x, [tmpVal pointValue].y]; + [minField setStringValue:tmpString]; + + tmpVal = [NSValue pointValueFromValArray:[n objectForKey:@"MAX"]]; + if (tmpVal==nil) + tmpString = @""; + tmpString = (tmpVal==nil) ? @"" : [NSString stringWithFormat:@"%f, %f",[tmpVal pointValue].x, [tmpVal pointValue].y]; + [maxField setStringValue:tmpString]; + + tmpVal = [NSValue pointValueFromValArray:[n objectForKey:@"IDENTITY"]]; + if (tmpVal==nil) + tmpString = @""; + tmpString = (tmpVal==nil) ? @"" : [NSString stringWithFormat:@"%f, %f",[tmpVal pointValue].x, [tmpVal pointValue].y]; + [identityField setStringValue:tmpString]; +} + + +- (IBAction) uiItemUsed:(id)sender { + //NSLog(@"%s",__func__); + JSONGUIInput *myInput = [self input]; + if (myInput == nil) + return; + + // get the string from the UI item + NSString *tmpString = [sender stringValue]; + // parse the string into an array of values + NSArray *valArray = [self parseValArrayFromString:tmpString]; + if ([valArray count] != 2) + valArray = nil; + + if (sender == defaultField) { + [myInput setObject:valArray forKey:@"DEFAULT"]; + } + else if (sender == minField) { + [myInput setObject:valArray forKey:@"MIN"]; + } + else if (sender == maxField) { + [myInput setObject:valArray forKey:@"MAX"]; + } + else if (sender == identityField) { + [myInput setObject:valArray forKey:@"IDENTITY"]; + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/ISFPropTopTableCellView.h b/ISF Editor/ISFPropTopTableCellView.h new file mode 100644 index 00000000..f3033861 --- /dev/null +++ b/ISF Editor/ISFPropTopTableCellView.h @@ -0,0 +1,23 @@ +#import +#import "JSONGUITop.h" + + + + +@interface ISFPropTopTableCellView : NSTableCellView { + IBOutlet NSTextField *descriptionField; + IBOutlet NSTextField *creditField; + + IBOutlet NSTextField *categoriesField; + IBOutlet NSTextField *filterVsnField; + + ObjectHolder *top; +} + +- (IBAction) uiItemUsed:(id)sender; + +- (void) refreshWithTop:(JSONGUITop *)t; + +- (JSONGUITop *) top; + +@end diff --git a/ISF Editor/ISFPropTopTableCellView.m b/ISF Editor/ISFPropTopTableCellView.m new file mode 100644 index 00000000..4d821bf4 --- /dev/null +++ b/ISF Editor/ISFPropTopTableCellView.m @@ -0,0 +1,190 @@ +#import "ISFPropTopTableCellView.h" +#import "RegexKitLite.h" +#import "JSONGUIController.h" + + + + +@implementation ISFPropTopTableCellView + + +- (id) initWithFrame:(NSRect)f { + self = [super initWithFrame:f]; + @synchronized (self) { + top = nil; + } + return self; +} +- (id) initWithCoder:(NSCoder *)c { + self = [super initWithCoder:c]; + @synchronized (self) { + top = nil; + } + return self; +} +- (void) dealloc { + [descriptionField setTarget:nil]; + [creditField setTarget:nil]; + [categoriesField setTarget:nil]; + @synchronized (self) { + VVRELEASE(top); + } + [super dealloc]; +} +- (void) drawRect:(NSRect)r { + NSColor *bgColor = [[self window] backgroundColor]; + if (bgColor == nil) + return; + [bgColor set]; + NSRectFill([self bounds]); + [super drawRect:r]; +} + + +- (IBAction) uiItemUsed:(id)sender { + MutLockDict *isfDict = [[self top] isfDict]; + if (isfDict==nil) + return; + + NSString *tmpString = nil; + + if (sender == descriptionField) { + tmpString = [[sender stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + if (tmpString==nil || [tmpString length]<1) + [isfDict lockRemoveObjectForKey:@"DESCRIPTION"]; + else + [isfDict lockSetObject:tmpString forKey:@"DESCRIPTION"]; + } + else if (sender == creditField) { + tmpString = [[sender stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + if (tmpString==nil || [tmpString length]<1) + [isfDict lockRemoveObjectForKey:@"CREDIT"]; + else + [isfDict lockSetObject:tmpString forKey:@"CREDIT"]; + } + else if (sender == categoriesField) { + + // we're going to parse the string, and either have a nil array, or an array populated by one or more categories + NSMutableArray *newCats = nil; + // use regex, break on non-word stuff! + tmpString = [categoriesField stringValue]; + if (tmpString!=nil && [tmpString length]<1) + tmpString = nil; + if (tmpString == nil) { + [isfDict lockRemoveObjectForKey:@"CATEGORIES"]; + } + else { + NSArray *terms = nil; + terms = [tmpString componentsSeparatedByRegex:@"[^\\w]+"]; + //NSLog(@"\t\tcats are %@",terms); + for (NSString *term in terms) { + if ([term length]>0) { + if (newCats==nil) + newCats = MUTARRAY; + [newCats addObject:term]; + } + } + } + // now apply 'newCats' to isfDict + if (newCats == nil) + [isfDict lockRemoveObjectForKey:@"CATEGORIES"]; + else + [isfDict lockSetObject:newCats forKey:@"CATEGORIES"]; + } + else if (sender == filterVsnField) { + tmpString = [filterVsnField stringValue]; + // parse the string, breaking on periods- filter the results, ensuring that all the terms are numbers + NSArray *terms = [tmpString componentsSeparatedByRegex:@"\\."]; + NSMutableArray *filteredTerms = nil; + for (NSString *term in terms) { + NSString *filteredTerm = [term stringByReplacingOccurrencesOfRegex:@"[^0-9]" withString:@""]; + if (filteredTerm != nil) { + if (filteredTerms == nil) + filteredTerms = MUTARRAY; + [filteredTerms addObject:filteredTerm]; + } + } + // if there are zero terms, remove the object from the key + if (filteredTerms==nil || [filteredTerms count]<1) { + [isfDict lockRemoveObjectForKey:@"VSN"]; + } + // else there are one or more terms- make a new vsn string, store it + else { + NSMutableString *mutString = [NSMutableString stringWithCapacity:0]; + int i = 0; + for (NSString *filteredTerm in filteredTerms) { + if (i==0) + [mutString appendString:filteredTerm]; + else + [mutString appendFormat:@".%@",filteredTerm]; + ++i; + } + if (mutString != nil) + [isfDict lockSetObject:[[mutString copy] autorelease] forKey:@"VSN"]; + } + } + + [_globalJSONGUIController recreateJSONAndExport]; +} + + +- (void) refreshWithTop:(JSONGUITop *)t { + @synchronized (self) { + VVRELEASE(top); + top = [[ObjectHolder alloc] initWithZWRObject:t]; + } + + NSString *tmpString = nil; + MutLockDict *isfDict = [t isfDict]; + NSArray *tmpArray = nil; + + tmpString = [isfDict objectForKey:@"DESCRIPTION"]; + if (tmpString==nil) + tmpString = @""; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [descriptionField setStringValue:tmpString]; + + tmpString = [isfDict objectForKey:@"CREDIT"]; + if (tmpString==nil) + tmpString = @""; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [creditField setStringValue:tmpString]; + + tmpArray = [isfDict objectForKey:@"CATEGORIES"]; + if (![tmpArray isKindOfClass:[NSArray class]]) + tmpString = @""; + else { + NSMutableString *tmpMutString = [NSMutableString stringWithCapacity:0]; + int i = 0; + for (NSString *catString in tmpArray) { + if (i==0) + [tmpMutString appendString:catString]; + else + [tmpMutString appendFormat:@", %@",catString]; + ++i; + } + tmpString = [[tmpMutString copy] autorelease]; + } + [categoriesField setStringValue:tmpString]; + + tmpString = [isfDict objectForKey:@"VSN"]; + if (tmpString==nil) + tmpString = @""; + else if (![tmpString isKindOfClass:[NSString class]]) + tmpString = @""; + [filterVsnField setStringValue:tmpString]; +} + + +- (JSONGUITop *) top { + JSONGUITop *returnMe = nil; + @synchronized (self) { + returnMe = (top==nil) ? nil : [top object]; + } + return returnMe; +} + + +@end diff --git a/ISF Editor/ISFUIItem.h b/ISF Editor/ISFUIItem.h new file mode 100644 index 00000000..196f3219 --- /dev/null +++ b/ISF Editor/ISFUIItem.h @@ -0,0 +1,53 @@ +// +// ISFUIItem.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import +#import +#import +#import +#import "SyphonVVBufferPoolAdditions.h" +#import "ISFAudioFFT.h" + + + +@interface ISFUIItem : NSBox { + NSString *name; + ISFAttribValType type; + + NSButton *eventButton; + BOOL eventNeedsSending; + NSButton *boolButton; + NSPopUpButton *longPUB; + NSSlider *slider; + /* + NSSlider *xSlider; + NSSlider *ySlider; + */ + NSTextField *xField; + NSTextField *yField; + NSPoint pointVal; + NSColorWell *colorField; + NSPopUpButton *audioSourcePUB; + + NSDictionary *userInfoDict; // used to store float flag and max val for audio-type inputs + + SyphonClient *syphonClient; + NSString *syphonLastSelectedName; +} + +- (id) initWithFrame:(NSRect)f attrib:(ISFAttrib *)a; + +- (void) uiItemUsed:(id)sender; + +- (NSString *) name; +- (id) getNSObjectValue; +- (void) setNSObjectValue:(id)n; + +@property (retain,readwrite) NSDictionary *userInfoDict; + +@end diff --git a/ISF Editor/ISFUIItem.m b/ISF Editor/ISFUIItem.m new file mode 100644 index 00000000..2d0526a9 --- /dev/null +++ b/ISF Editor/ISFUIItem.m @@ -0,0 +1,550 @@ +// +// ISFUIItem.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/2/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import "ISFUIItem.h" +#import +//#import +#import "AudioController.h" + + + + +@implementation ISFUIItem + + ++ (void) initialize { + [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; +} +- (id) initWithFrame:(NSRect)f attrib:(ISFAttrib *)a { + if (a==nil) { + [self release]; + return nil; + } + if (self = [super initWithFrame:f]) { + name = [[a attribName] retain]; + type = [a attribType]; + eventButton = nil; + eventNeedsSending = NO; + boolButton = nil; + longPUB = nil; + slider = nil; + xField = nil; + yField = nil; + colorField = nil; + audioSourcePUB = nil; + userInfoDict = nil; + syphonClient = nil; + syphonLastSelectedName = nil; + + if ([a attribLabel]==nil) + [self setTitle:[a attribName]]; + else + [self setTitle:[NSString stringWithFormat:@"%@ (%@)",[a attribLabel],[a attribName]]]; + + NSRect tmpRect = NSMakeRect(15,0,f.size.width-30,25); + switch (type) { + case ISFAT_Event: + eventButton = [[NSButton alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:eventButton]; + [eventButton setTarget:self]; + [eventButton setAction:@selector(uiItemUsed:)]; + break; + case ISFAT_Bool: + boolButton = [[NSButton alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:boolButton]; + [boolButton setButtonType:NSSwitchButton]; + [boolButton setIntValue:([a currentVal].boolVal) ? NSOnState : NSOffState]; + break; + case ISFAT_Long: + longPUB = [[NSPopUpButton alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:longPUB]; + NSMenu *tmpMenu = [longPUB menu]; + [tmpMenu removeAllItems]; + NSArray *labelArray = [a labelArray]; + NSArray *valArray = [a valArray]; + if (labelArray!=nil && valArray!=nil && [labelArray count]==[valArray count]) { + NSEnumerator *labelIt = [labelArray objectEnumerator]; + NSEnumerator *valIt = [valArray objectEnumerator]; + NSString *labelString; + NSNumber *valNumber; + while ((valNumber=[valIt nextObject]) && (labelString=[labelIt nextObject])) { + NSMenuItem *newItem = [tmpMenu addItemWithTitle:labelString action:nil keyEquivalent:@""]; + if (newItem != nil) + [newItem setTag:[valNumber longValue]]; + } + } + else { + ISFAttribVal minVal = [a minVal]; + ISFAttribVal maxVal = [a maxVal]; + for (int i=fminl(minVal.longVal,maxVal.longVal); i<=fmaxl(minVal.longVal,maxVal.longVal); ++i) { + NSMenuItem *newItem = [tmpMenu addItemWithTitle:VVFMTSTRING(@"%d",i) action:nil keyEquivalent:@""]; + if (newItem != nil) + [newItem setTag:i]; + } + } + [longPUB selectItemAtIndex:[a defaultVal].longVal]; + break; + case ISFAT_Float: + slider = [[NSSlider alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:slider]; + [slider setMinValue:[a minVal].floatVal]; + [slider setMaxValue:[a maxVal].floatVal]; + [slider setFloatValue:[a currentVal].floatVal]; + break; + case ISFAT_Point2D: + /* + tmpRect.size.height = 30; + ySlider = [[NSSlider alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:ySlider]; + + //[ySlider setMinValue:[a minVal].point2DVal[1]]; + //[ySlider setMaxValue:[a maxVal].point2DVal[1]]; + [ySlider setFloatValue:[a currentVal].point2DVal[1]]; + [ySlider setTarget:self]; + [ySlider setAction:@selector(uiItemUsed:)]; + + tmpRect.origin.y += 30; + xSlider = [[NSSlider alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:xSlider]; + //[xSlider setMinValue:[a minVal].point2DVal[0]]; + //[xSlider setMaxValue:[a maxVal].point2DVal[0]]; + [xSlider setFloatValue:[a currentVal].point2DVal[0]]; + [xSlider setTarget:self]; + [xSlider setAction:@selector(uiItemUsed:)]; + + pointVal = NSMakePoint([a currentVal].point2DVal[0], [a currentVal].point2DVal[1]); + */ + + tmpRect.size.width = 100; + xField = [[NSTextField alloc] initWithFrame:tmpRect]; + [xField setTarget:self]; + [xField setAction:@selector(uiItemUsed:)]; + [[self contentView] addSubview:xField]; + tmpRect.origin.x += (tmpRect.size.width + 10); + yField = [[NSTextField alloc] initWithFrame:tmpRect]; + [yField setTarget:self]; + [yField setAction:@selector(uiItemUsed:)]; + [[self contentView] addSubview:yField]; + [xField setNextKeyView:yField]; + + ISFAttribVal tmpVal = [a currentVal]; + [xField setStringValue:VVFMTSTRING(@"%0.2f",tmpVal.point2DVal[0])]; + [yField setStringValue:VVFMTSTRING(@"%0.2f",tmpVal.point2DVal[1])]; + pointVal = NSMakePoint(tmpVal.point2DVal[0], tmpVal.point2DVal[1]); + + break; + case ISFAT_Color: + colorField = [[NSColorWell alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:colorField]; + GLfloat tmpFloat[4]; + for (int i=0; i<4; ++i) + tmpFloat[i] = [a currentVal].colorVal[i]; + [colorField setColor:[NSColor colorWithDeviceRed:tmpFloat[0] green:tmpFloat[1] blue:tmpFloat[2] alpha:tmpFloat[3]]]; + break; + case ISFAT_Image: + { + longPUB = [[NSPopUpButton alloc] initWithFrame:tmpRect]; + [[self contentView] addSubview:longPUB]; + [longPUB setTarget:self]; + [longPUB setAction:@selector(uiItemUsed:)]; + + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + // load the syphon stuff, fake a click on the syphon PUB + syphonClient = nil; + syphonLastSelectedName = [def objectForKey:@"syphonLastSelectedName"]; + if (syphonLastSelectedName != nil) + [syphonLastSelectedName retain]; + [self _reloadSyphonPUB]; + // register for notifications when syphon servers change + for (NSString *notificationName in [NSArray arrayWithObjects:SyphonServerAnnounceNotification, SyphonServerUpdateNotification, SyphonServerRetireNotification,nil]) { + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(_syphonServerChangeNotification:) + name:notificationName + object:nil]; + } + } + break; + case ISFAT_Cube: + { + // intentionally blank, don't do anything with cube + } + break; + case ISFAT_Audio: + case ISFAT_AudioFFT: + { + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(audioControllerDeviceChangeNotification:) + name:kAudioControllerInputNameChangedNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(audioInputsChangedNotification:) + name:AVCaptureDeviceWasConnectedNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(audioInputsChangedNotification:) + name:AVCaptureDeviceWasDisconnectedNotification + object:nil]; + audioSourcePUB = [[NSPopUpButton alloc] initWithFrame:tmpRect]; + [audioSourcePUB removeAllItems]; + [audioSourcePUB selectItem:nil]; + [[self contentView] addSubview:audioSourcePUB]; + [audioSourcePUB setTarget:self]; + [audioSourcePUB setAction:@selector(uiItemUsed:)]; + // if there's a max or float flag, apply it by storing it in a dictionary with me + long maxVal = [a maxVal].audioVal; + if (maxVal>0) { + [self setUserInfoDict:@{@"MAX":NUMLONG(maxVal)}]; + } + + //NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + // fake a click on the audio stuff + [self _reloadAudioPUB]; + // register to receive notifications that the list of audio sources has changed + //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioInputsChangedNotification:) name:VVAudioInputNodeArrayChangedNotification object:nil]; + } + break; + } + return self; + } + return nil; +} +- (void) dealloc { + //NSLog(@"%s ... %@",__func__,name); + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + switch (type) { + case ISFAT_Event: + [eventButton removeFromSuperview]; + [eventButton release]; + break; + case ISFAT_Bool: + [boolButton removeFromSuperview]; + [boolButton release]; + break; + case ISFAT_Long: + [longPUB removeFromSuperview]; + [longPUB release]; + break; + case ISFAT_Float: + [slider removeFromSuperview]; + [slider release]; + break; + case ISFAT_Point2D: + /* + [xSlider removeFromSuperview]; + [xSlider release]; + [ySlider removeFromSuperview]; + [ySlider release]; + */ + [xField removeFromSuperview]; + [xField release]; + [yField removeFromSuperview]; + [yField release]; + break; + case ISFAT_Color: + [colorField removeFromSuperview]; + [colorField release]; + break; + case ISFAT_Image: + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [longPUB removeFromSuperview]; + [longPUB release]; + break; + case ISFAT_Cube: + break; + case ISFAT_Audio: + case ISFAT_AudioFFT: + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [audioSourcePUB removeFromSuperview]; + [audioSourcePUB release]; + break; + } + + VVRELEASE(name); + VVRELEASE(syphonClient); + VVRELEASE(syphonLastSelectedName); + [self setUserInfoDict:nil]; + [super dealloc]; +} + + +- (void) audioControllerDeviceChangeNotification:(NSNotification *)note { + [self _reloadAudioPUB]; +} +- (void) _reloadSyphonPUB { + //NSLog(@"%s",__func__); + // first reload the pop up button + SyphonServerDirectory *sd = [SyphonServerDirectory sharedDirectory]; + NSArray *servers = (sd==nil) ? nil : [sd servers]; + if (servers!=nil) { + NSMenu *pubMenu = [longPUB menu]; + [pubMenu removeAllItems]; + [pubMenu addItemWithTitle:@"-" action:nil keyEquivalent:@""]; + for (NSDictionary *serverDict in servers) { + NSString *serverName = [NSString stringWithFormat:@"%@-%@",[serverDict objectForKey:SyphonServerDescriptionAppNameKey],[serverDict objectForKey:SyphonServerDescriptionNameKey]]; + NSMenuItem *serverItem = [[NSMenuItem alloc] + initWithTitle:serverName + action:nil + keyEquivalent:@""]; + [serverItem setEnabled:YES]; + [serverItem setRepresentedObject:[[serverDict copy] autorelease]]; + [pubMenu addItem:serverItem]; + [serverItem release]; + } + } + // try to select the last-selected syphon server + NSString *tmpString = nil; + @synchronized (self) { + tmpString = (syphonLastSelectedName==nil) ? nil : [syphonLastSelectedName retain]; + } + if (tmpString==nil) + [longPUB selectItemAtIndex:0]; + else { + [longPUB selectItemWithTitle:tmpString]; + [tmpString release]; + tmpString = nil; + } + [self uiItemUsed:longPUB]; +} +- (void) _reloadAudioPUB { + NSArray *newMenuItems = [_globalAudioController arrayOfAudioMenuItems]; + if (newMenuItems == nil) + return; + NSMenu *newMenu = [[NSMenu alloc] initWithTitle:@""]; + [newMenu setAutoenablesItems:NO]; + for (NSMenuItem *itemPtr in newMenuItems) { + [newMenu addItem:itemPtr]; + } + [audioSourcePUB setMenu:newMenu]; + [newMenu release]; + NSString *audioInputName = [_globalAudioController inputName]; + [audioSourcePUB selectItemWithTitle:audioInputName]; + /* + NSArray *newInputsNames = [VVAudioInputNode availableAudioInputNames]; + //NSLog(@"\t\tnew input names %@",newInputsNames); + [audioSourcePUB removeAllItems]; + [audioSourcePUB addItemWithTitle:@"<-System Default->"]; + [audioSourcePUB addItemsWithTitles:newInputsNames]; + + NSString *audioInputName = [_globalAudioController inputName]; + [audioSourcePUB selectItemWithTitle:audioInputName]; + */ + + + /* + NSString *lastSelectedTitle = nil; + if ([audioSourcePUB indexOfSelectedItem]>0 && [audioSourcePUB indexOfSelectedItem]!=NSNotFound) { + lastSelectedTitle = [audioSourcePUB titleOfSelectedItem]; + } + NSArray *newInputsNames = [VVAudioInputNode availableAudioInputNames]; + //NSLog(@"\t\tnew input names %@",newInputsNames); + [audioSourcePUB removeAllItems]; + [audioSourcePUB addItemWithTitle:@"<-System Default->"]; + [audioSourcePUB addItemsWithTitles:newInputsNames]; + + if (lastSelectedTitle != nil) { + [audioSourcePUB selectItemWithTitle:lastSelectedTitle]; + } + else { + // if nothing was selected try using the system default + [audioSourcePUB selectItemAtIndex:0]; + [self uiItemUsed:audioSourcePUB]; + } + */ +} +- (void) audioInputsChangedNotification:(NSNotification *)note { + [self _reloadAudioPUB]; +} +- (void) _syphonServerChangeNotification:(NSNotification *)note { + [self _reloadSyphonPUB]; +} +- (void) uiItemUsed:(id)sender { + switch (type) { + case ISFAT_Event: + eventNeedsSending = YES; + break; + case ISFAT_Bool: + case ISFAT_Long: + case ISFAT_Float: + case ISFAT_Point2D: + /* + if (sender == xSlider) { + pointVal.x = [xSlider floatValue]; + } + else if (sender == ySlider) { + pointVal.y = [ySlider floatValue]; + } + NSPointLog(@"\t\tpointVal is",pointVal); + */ + if (sender == xField) { + pointVal.x = [[[xField stringValue] numberByEvaluatingString] floatValue]; + } + else if (sender == yField) { + pointVal.y = [[[yField stringValue] numberByEvaluatingString] floatValue]; + } + break; + case ISFAT_Color: + break; + case ISFAT_Image: + { + NSUInteger selectedIndex = [longPUB indexOfSelectedItem]; + NSMenuItem *selectedItem = [longPUB selectedItem]; + if (selectedItem!=nil && selectedIndex>0 && selectedIndex!=NSNotFound) { + @synchronized (self) { + if (syphonLastSelectedName!=nil) + [syphonLastSelectedName release]; + syphonLastSelectedName = [[selectedItem title] retain]; + } + + NSDictionary *serverDict = [selectedItem representedObject]; + @synchronized (self) { + if (syphonClient != nil) + [syphonClient release]; + syphonClient = nil; + if (serverDict != nil) { + syphonClient = [[SyphonClient alloc] + initWithServerDescription:serverDict + options:nil + newFrameHandler:nil]; + } + } + } + else { + if (syphonClient != nil) { + [syphonClient release]; + syphonClient = nil; + } + } + break; + } + case ISFAT_Cube: + break; + case ISFAT_Audio: + case ISFAT_AudioFFT: + { + // get the name from the PUB + NSString *audioInputName = [audioSourcePUB titleOfSelectedItem]; + NSMenuItem *selectedItem = [audioSourcePUB selectedItem]; + NSString *audioUniqueID = [selectedItem representedObject]; + // if the default is selected, use it + if ([audioInputName isEqualToString:@"<-System Default->"]) { + //audioInputName = [VVAudioInputNode defaultInputName]; + } + // tell the global audio singleton to use the input with the chosen name + [_globalAudioController loadDeviceWithUniqueID:audioUniqueID]; + } + break; + } +} + + +- (NSString *) name { + return name; +} +- (id) getNSObjectValue { + //NSLog(@"%s ... %@",__func__,self); + switch (type) { + case ISFAT_Event: + if (eventNeedsSending) { + eventNeedsSending = NO; + return [NSNumber numberWithBool:YES]; + } + return [NSNumber numberWithBool:NO]; + case ISFAT_Bool: + return [NSNumber numberWithBool:([boolButton intValue]==NSOnState)?YES:NO]; + case ISFAT_Long: + return [NSNumber numberWithInt:(int)[[longPUB selectedItem] tag]]; + case ISFAT_Float: + return [NSNumber numberWithFloat:[slider floatValue]]; + case ISFAT_Point2D: + //return [NSValue valueWithPoint:NSMakePoint([[[xField stringValue] numberByEvaluatingString] floatValue], [[[yField stringValue] numberByEvaluatingString] floatValue])]; + //NSLog(@"\t\treturning %@",[NSValue valueWithPoint:pointVal]); + return [NSValue valueWithPoint:pointVal]; + case ISFAT_Color: + return [colorField color]; + case ISFAT_Image: + { + VVBuffer *tmpBuffer = (syphonClient!=nil && [syphonClient hasNewFrame]) ? [_globalVVBufferPool allocBufferForSyphonClient:syphonClient] : nil; + return [tmpBuffer autorelease]; + } + break; + case ISFAT_Cube: + break; + case ISFAT_Audio: + case ISFAT_AudioFFT: + { + NSDictionary *tmpDict = [self userInfoDict]; + NSNumber *maxNum = (tmpDict==nil) ? nil : [tmpDict objectForKey:@"MAX"]; + long maxVal = (maxNum==nil) ? 0 : [maxNum longValue]; + VVBuffer *tmpBuffer = nil; + if (maxVal <= 0) { + if (type == ISFAT_Audio) + tmpBuffer = [_globalAudioController allocAudioImageBuffer]; + else + tmpBuffer = [_globalAudioController allocAudioFFTImageBuffer]; + } + else { + if (type == ISFAT_Audio) + tmpBuffer = [_globalAudioController allocAudioImageBufferWithWidth:maxVal]; + else + tmpBuffer = [_globalAudioController allocAudioFFTImageBufferWithWidth:maxVal]; + } + return [tmpBuffer autorelease]; + } + break; + } + return nil; +} +- (void) setNSObjectValue:(id)n { + //NSLog(@"%s ... %@, %@",__func__,self,n); + if (n==nil) + return; + switch (type) { + case ISFAT_Event: + break; + case ISFAT_Bool: + [boolButton setIntValue:([n boolValue]) ? NSOnState : NSOffState]; + break; + case ISFAT_Long: + [longPUB selectItemAtIndex:[n intValue]]; + break; + case ISFAT_Float: + [slider setFloatValue:[n floatValue]]; + break; + case ISFAT_Point2D: + pointVal = [n pointValue]; + + /* + [xSlider setFloatValue:pointVal.x]; + [ySlider setFloatValue:pointVal.y]; + */ + [xField setStringValue:VVFMTSTRING(@"%0.2f",pointVal.x)]; + [yField setStringValue:VVFMTSTRING(@"%0.2f",pointVal.y)]; + + break; + case ISFAT_Color: + [colorField setColor:n]; + break; + case ISFAT_Image: + break; + case ISFAT_Cube: + break; + case ISFAT_Audio: + case ISFAT_AudioFFT: + break; + } +} +- (NSString *) description { + return [NSString stringWithFormat:@"",name]; +} +@synthesize userInfoDict; + + +@end diff --git a/ISF Editor/ISFVVBufferGLView.h b/ISF Editor/ISFVVBufferGLView.h new file mode 100644 index 00000000..b1cdaf8c --- /dev/null +++ b/ISF Editor/ISFVVBufferGLView.h @@ -0,0 +1,27 @@ +#import +#import +#import +#import + + + + +@interface ISFVVBufferGLView : VVSpriteGLView { + OSSpinLock localISFSceneLock; + ISFGLScene *localISFScene; // instead of rendering to a texture, this draws in my GL view. built from the same GL context used to draw me (i'm a GL view) + VVSprite *bgSprite; + + OSSpinLock bufferLock; + VVBuffer *buffer; // this is the buffer that needs to be drawn + NSMutableArray *bufferArray; // used to store the buffer being drawn 'til after my superclass flushes! +} + +- (void) drawBGSprite:(VVSprite *)s; + +- (void) drawBuffer:(VVBuffer *)n; +- (void) setSharedGLContext:(NSOpenGLContext *)c; +- (void) useFile:(NSString *)n; + +@property (readonly) ISFGLScene *localISFScene; + +@end diff --git a/ISF Editor/ISFVVBufferGLView.m b/ISF Editor/ISFVVBufferGLView.m new file mode 100644 index 00000000..b63ea527 --- /dev/null +++ b/ISF Editor/ISFVVBufferGLView.m @@ -0,0 +1,211 @@ +#import "ISFVVBufferGLView.h" + + + + +@implementation ISFVVBufferGLView + + +/*===================================================================================*/ +#pragma mark --------------------- init/setup/destroy +/*------------------------------------*/ + + +- (void) generalInit { + //NSLog(@"%s",__func__); + [super generalInit]; + localISFSceneLock = OS_SPINLOCK_INIT; + localISFScene = nil; + bgSprite = [spriteManager makeNewSpriteAtBottomForRect:NSMakeRect(0,0,1,1)]; + [bgSprite setDelegate:self]; + [bgSprite setActionCallback:@selector(actionBgSprite:)]; + [bgSprite setDrawCallback:@selector(drawBGSprite:)]; + spritesNeedUpdate = YES; + bufferLock = OS_SPINLOCK_INIT; + buffer = nil; + bufferArray = [MUTARRAY retain]; +} +- (void) awakeFromNib { + [super awakeFromNib]; +} +- (void) dealloc { + //NSLog(@"%s",__func__); + if (!deleted) + [self prepareToBeDeleted]; + OSSpinLockLock(&localISFSceneLock); + VVRELEASE(localISFScene); + OSSpinLockUnlock(&localISFSceneLock); + + OSSpinLockLock(&bufferLock); + VVRELEASE(buffer); + VVRELEASE(bufferArray); + OSSpinLockUnlock(&bufferLock); + + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- main interaction +/*------------------------------------*/ + + +- (void) drawBuffer:(VVBuffer *)n { + //NSLog(@"%s",__func__); + //if (n==nil) + // return; + + // i have to retain the buffer locally (a sprite needs to draw this in a delegate method) + OSSpinLockLock(&bufferLock); + VVRELEASE(buffer); + buffer = (n==nil) ? nil : [n retain]; + OSSpinLockUnlock(&bufferLock); + + // this causes my super to draw immediately + [self performDrawing:[self bounds]]; + + // since i just drew, i don't need to retain the buffer any more! + //OSSpinLockLock(&bufferLock); + //VVRELEASE(buffer); + //OSSpinLockUnlock(&bufferLock); +} +- (void) setSharedGLContext:(NSOpenGLContext *)c { + NSOpenGLContext *newCtx = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:c]; + [self setOpenGLContext:newCtx]; + [newCtx setView:self]; + [newCtx release]; + newCtx = nil; +} +- (void) useFile:(NSString *)n { + OSSpinLockLock(&localISFSceneLock); + if (localISFScene==nil) + NSLog(@"\t\terr: trying to load file %@, but ISF scene is nil! %s",n,__func__); + else { + [localISFScene useFile:n]; + } + OSSpinLockUnlock(&localISFSceneLock); +} + + +/*===================================================================================*/ +#pragma mark --------------------- drawing/sprites +/*------------------------------------*/ + + +- (void) initializeGL { + //NSLog(@"%s",__func__); + //[self setPixelFormat:[GLScene defaultQTPixelFormat]]; + + OSSpinLockLock(&localISFSceneLock); + if (localISFScene==nil) { + NSOpenGLContext *currentCtx = [self openGLContext]; + if (currentCtx!=nil) { + localISFScene = [[ISFGLScene alloc] initWithContext:currentCtx sharedContext:[_globalVVBufferPool sharedContext]]; + [localISFScene useFile:[[NSBundle mainBundle] pathForResource:@"AlphaOverCheckerboard" ofType:@"fs"]]; + } + } + OSSpinLockUnlock(&localISFSceneLock); + + //[self setOpenGLContext:[localISFScene context]]; + //[[localISFScene context] setView:self]; + [localISFScene setSize:[self backingBounds].size]; + + [super initializeGL]; + + CGLContextObj cgl_ctx = [[self openGLContext] CGLContextObj]; + //glEnable(GL_TEXTURE_RECTANGLE_EXT); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //glEnable(GL_BLEND); + glDisable(GL_BLEND); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); +} +- (void) updateSprites { + //NSLog(@"%s",__func__); + [super updateSprites]; + if (bgSprite != nil) { + [bgSprite setRect:[self backingBounds]]; + //NSRectLog(@"\t\tbgSprite's rect is",[bgSprite rect]); + } +} + + +- (void) drawBGSprite:(VVSprite *)s { + //NSLog(@"%s",__func__); + if (deleted || localISFScene==nil) + return; + + CGLContextObj cgl_ctx = [[self openGLContext] CGLContextObj]; + glDisable(GL_BLEND); + + OSSpinLockLock(&bufferLock); + VVBuffer *bufferToDraw = buffer; + if (bufferToDraw!=nil) + [bufferArray addObject:bufferToDraw]; + OSSpinLockUnlock(&bufferLock); + + //NSLog(@"\t\tbufferToDraw is %@",bufferToDraw); + if (bufferToDraw!=nil) { + [localISFScene setFilterInputImageBuffer:bufferToDraw]; + [localISFScene render]; + } + else { + //- (void) renderBlackFrameInFBO:(GLuint)f colorTex:(GLuint)t target:(GLuint)tt + [localISFScene renderBlackFrameInFBO:0 colorTex:0 target:GL_TEXTURE_RECTANGLE_EXT]; + //[localISFScene renderToBuffer:nil sized:size renderTime:[swatch timeSinceStart] passDict:nil]; + + } + +} +- (void) actionBgSprite:(VVSprite *)s { + +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (void) finishedDrawing { + if (deleted) + return; + + OSSpinLockLock(&bufferLock); + if (bufferArray != nil) { + // clear out any buffers already in the array from the last render + [bufferArray removeAllObjects]; + } + OSSpinLockUnlock(&bufferLock); + + [super finishedDrawing]; +} +- (void) setOpenGLContext:(NSOpenGLContext *)c { + // tell the super to set the GL context, which will handle all the context/view setup + [super setOpenGLContext:c]; + + // now i have to reload the ISF scene to use the passed context (which means reloading the file as well) + OSSpinLockLock(&localISFSceneLock); + NSString *currentISFPath = nil; + if (localISFScene!=nil) { + currentISFPath = [[[localISFScene filePath] retain] autorelease]; + VVRELEASE(localISFScene); + } + localISFScene = [[ISFGLScene alloc] initWithContext:c sized:[self backingBounds].size]; + if (currentISFPath!=nil) + [localISFScene useFile:currentISFPath]; + OSSpinLockUnlock(&localISFSceneLock); +} + + +/*===================================================================================*/ +#pragma mark --------------------- key-val +/*------------------------------------*/ + + +@synthesize localISFScene; + + +@end diff --git a/ISF Editor/JSONGUIArrayGroup.h b/ISF Editor/JSONGUIArrayGroup.h new file mode 100644 index 00000000..443aaee0 --- /dev/null +++ b/ISF Editor/JSONGUIArrayGroup.h @@ -0,0 +1,29 @@ +#import +#import +@class JSONGUITop; + + + + +// we have to pass an array around (group-type cell in the outline view), but we need to discern between arrays of inputs and arrays of passes at the group level (because the group needs to be capable of making additional instances of its contents) +typedef NS_ENUM(NSInteger, ISFArrayClassType) { + ISFArrayClassType_Input, + ISFArrayClassType_Pass +}; + + + + +@interface JSONGUIArrayGroup : NSObject { + ISFArrayClassType groupType; // what "type" of group this cell is describing (inputs/passes/etc) + MutLockArray *contents; // array of group contents (JSONGUIInput or JSONGUIPass instances) + ObjectHolder *top; +} + +- (id) initWithType:(ISFArrayClassType)targetType top:(JSONGUITop *)theTop; + +@property (readonly) ISFArrayClassType groupType; +@property (readonly) MutLockArray *contents; +- (JSONGUITop *) top; + +@end diff --git a/ISF Editor/JSONGUIArrayGroup.m b/ISF Editor/JSONGUIArrayGroup.m new file mode 100644 index 00000000..049b4200 --- /dev/null +++ b/ISF Editor/JSONGUIArrayGroup.m @@ -0,0 +1,61 @@ +#import "JSONGUIArrayGroup.h" +#import "JSONGUIInput.h" +#import "JSONGUIPass.h" + + + + +@implementation JSONGUIArrayGroup + + +- (id) initWithType:(ISFArrayClassType)targetType top:(JSONGUITop *)theTop { + self = [super init]; + if (self != nil) { + // initialize the basic vars + groupType = targetType; + contents = [[MutLockArray alloc] init]; + top = [[ObjectHolder alloc] initWithZWRObject:theTop]; + // get the raw ISF dict from the top-level object- this is what we're going to parse to populate our contents + MutLockDict *isfDict = [theTop isfDict]; + + switch (groupType) { + // if this is meant to parse an array of inputs + case ISFArrayClassType_Input: + for (NSDictionary *itemDict in [isfDict objectForKey:@"INPUTS"]) { + // create a JSONGUIInput from the dict + [contents lockAddObject:[[[JSONGUIInput alloc] initWithDict:itemDict top:theTop] autorelease]]; + } + break; + // if this is meant to parse an array of rendering passes + case ISFArrayClassType_Pass: + for (NSDictionary *itemDict in [isfDict objectForKey:@"PASSES"]) { + // create a JSONGUIPass from the dict- this instance will use the top to query the full ISF dict and populate itself + [contents lockAddObject:[[[JSONGUIPass alloc] initWithDict:itemDict top:theTop] autorelease]]; + } + break; + } + } + return self; +} +- (void) dealloc { + VVRELEASE(contents); + VVRELEASE(top); + [super dealloc]; +} +@synthesize groupType; +@synthesize contents; +- (JSONGUITop *) top { + return [top object]; +} +- (NSString *) description { + switch (groupType) { + case ISFArrayClassType_Input: + return @""; + case ISFArrayClassType_Pass: + return @""; + } + return @""; +} + + +@end diff --git a/ISF Editor/JSONGUIController.h b/ISF Editor/JSONGUIController.h new file mode 100644 index 00000000..f0fc7f49 --- /dev/null +++ b/ISF Editor/JSONGUIController.h @@ -0,0 +1,48 @@ +#import +#import +#import "JSONGUITop.h" + + + +// we parse a JSON blob, unserialize it into objects, and retain them. +/* +// if there is an object at the CLASS key in a dict for something, this enum lets you know whether this dict describes the top-level ISF dict, a single input, or a single pass +typedef NS_ENUM(NSInteger, ISFDictClassType) { + ISFDictClassType_Top, + ISFDictClassType_Input, + ISFDictClassType_Pass +}; +*/ + + + + +extern id _globalJSONGUIController; + + + + +@interface JSONGUIController : NSObject { + BOOL alreadyAwake; // when we make table cell views, awakeFromNib gets called repeatedly + + IBOutlet id docController; + IBOutlet id isfController; + IBOutlet NSOutlineView *outlineView; + IBOutlet NSTableView *tableView; + + OSSpinLock dictLock; + NSDictionary *isfDict; + JSONGUITop *top; +} + +- (void) refreshUI; + +- (NSDictionary *) isfDict; +- (NSMutableDictionary *) createNewISFDict; +- (id) objectAtRowIndex:(NSInteger)n; + +- (void) recreateJSONAndExport; + +- (IBAction) saveCurrentValsAsDefaults:(id)sender; + +@end diff --git a/ISF Editor/JSONGUIController.m b/ISF Editor/JSONGUIController.m new file mode 100644 index 00000000..76d592fc --- /dev/null +++ b/ISF Editor/JSONGUIController.m @@ -0,0 +1,451 @@ +#import "JSONGUIController.h" +#import "ISFController.h" +#import "DocController.h" +#import "JSONGUIArrayGroup.h" +#import "JSONGUIInput.h" +#import "JSONGUIPass.h" + +#import "ISFPropErrTableCellView.h" +#import "ISFPropGroupTableCellView.h" +#import "ISFPropInputTableCellView.h" +#import "ISFPropPassTableCellView.h" +#import "ISFPropTopTableCellView.h" + + + + +#define LOCK OSSpinLockLock +#define UNLOCK OSSpinLockUnlock + + + + +id _globalJSONGUIController = nil; + + + + +@implementation JSONGUIController + + +- (id) init { + self = [super init]; + if (self != nil) { + alreadyAwake = NO; + _globalJSONGUIController = self; + dictLock = OS_SPINLOCK_INIT; + isfDict = nil; + top = nil; + } + return self; +} +- (void) awakeFromNib { + if (!alreadyAwake) { + [tableView registerForDraggedTypes:OBJARRAY(@"com.Vidvox.ISFEditor.JSONGUIPboard")]; + } + + alreadyAwake = YES; +} +- (void) refreshUI { + //NSLog(@"%s",__func__); + + // get the JSON string from the ISF controller + //ISFGLScene *scene = [isfController scene]; + //NSString *importPath = [scene filePath]; + NSString *importPath = [docController fragFilePath]; + NSString *fragString = [NSString stringWithContentsOfFile:importPath encoding:NSUTF8StringEncoding error:nil]; + NSRange openCommentRange = [fragString rangeOfString:@"/*" options:NSLiteralSearch]; + // if i couldn't find the open comment range, bail + if (openCommentRange.location == NSNotFound) { + NSLog(@"\t\terr: couldn't find open comment in file, bailing %s",__func__); + NSLog(@"\t\terr: import path was %@",importPath); + return; + } + NSRange closeCommentSearchRange = NSMakeRange(openCommentRange.location+openCommentRange.length, 0); + closeCommentSearchRange.length = [fragString length] - closeCommentSearchRange.location; + NSRange closeCommentRange = [fragString rangeOfString:@"*/" options:NSLiteralSearch range:closeCommentSearchRange]; + // if i couldn't find the close comment range, bail + if (closeCommentRange.location == NSNotFound) { + NSLog(@"\t\terr: couldn't find close comment in file, bailing %s",__func__); + NSLog(@"\t\terr: import path was %@",importPath); + return; + } + NSRange jsonRange = NSMakeRange(openCommentRange.location+openCommentRange.length, 0); + jsonRange.length = closeCommentRange.location - jsonRange.location; + NSString *jsonString = [fragString substringWithRange:jsonRange]; + + /* + NSString *jsonString = [[[[isfController scene] jsonString] retain] autorelease]; + */ + + // parse it, turning it into objects- safely replace my local cache of objects + LOCK(&dictLock); + VVRELEASE(isfDict); + isfDict = [[jsonString mutableObjectFromJSONString] retain]; + + // now parse the dict by creating JSONGUI* instances from it + top = [[JSONGUITop alloc] initWithISFDict:isfDict]; + //NSLog(@"\t\ttop is %@",top); + //NSLog(@"\t\tinputs are %@",[top inputsGroup]); + //NSLog(@"\t\tpasses are %@",[top passesGroup]); + + UNLOCK(&dictLock); + + // update the outline view + [outlineView reloadData]; + [tableView reloadData]; +} + + +- (NSInteger) numberOfRowsInTableView:(NSTableView *)tv { + // base properties + 2 group cells + contents of both groups + return 1 + 2 + [[[top inputsGroup] contents] lockCount] + [[[top passesGroup] contents] lockCount]; +} +- (NSView *) tableView:(NSTableView *)tv viewForTableColumn:(NSTableColumn *)tc row:(NSInteger)row { + NSView *returnMe = nil; + NSInteger indexOfInputsGroupCell = 1; + NSInteger indexOfPassesGroupCell = indexOfInputsGroupCell + [[[top inputsGroup] contents] lockCount] + 1; + //NSLog(@"\t\tindexOfInputsGroupCell is %d, indexOfPassesGroupCell is %d",indexOfInputsGroupCell,indexOfPassesGroupCell); + // if this is the row for the 'top' item + if (row==0) { + returnMe = [tv makeViewWithIdentifier:@"TopCell" owner:self]; + [(ISFPropTopTableCellView *)returnMe refreshWithTop:top]; + } + // else if this is a row for a group ("inputs" or "passes") + else if (row==indexOfInputsGroupCell || row==indexOfPassesGroupCell) { + returnMe = [tv makeViewWithIdentifier:@"GroupCell" owner:self]; + [(ISFPropGroupTableCellView *)returnMe refreshWithGroup:(row==indexOfInputsGroupCell) ? [top inputsGroup] : [top passesGroup]]; + } + // else if this is a pass + else if (row>indexOfPassesGroupCell) { + JSONGUIPass *pass = [[[top passesGroup] contents] lockObjectAtIndex:row-(indexOfPassesGroupCell+1)]; + returnMe = [tv makeViewWithIdentifier:@"PassCell" owner:self]; + [(ISFPropPassTableCellView *)returnMe refreshWithTop:top pass:pass]; + } + // else this is an input + else { + JSONGUIInput *input = [[[top inputsGroup] contents] lockObjectAtIndex:row-(indexOfInputsGroupCell+1)]; + NSString *typeString = [(JSONGUIInput *)input objectForKey:@"TYPE"]; + returnMe = [self makeTableCellViewForISFTypeString:typeString]; + [(ISFPropInputTableCellView *)returnMe refreshWithInput:input]; + } + + return returnMe; +} +- (CGFloat) tableView:(NSTableView *)tv heightOfRow:(NSInteger)row { + CGFloat returnMe = 17.; + NSView *tmpView = nil; + NSInteger indexOfInputsGroupCell = 1; + NSInteger indexOfPassesGroupCell = indexOfInputsGroupCell + [[[top inputsGroup] contents] lockCount] + 1; + // if this is the row for the 'top' item + if (row==0) { + tmpView = [tv makeViewWithIdentifier:@"TopCell" owner:self]; + returnMe = [tmpView frame].size.height; + } + // else if this is a row for a group ("inputs" or "passes") + else if (row==indexOfInputsGroupCell || row==indexOfPassesGroupCell) { + tmpView = [tv makeViewWithIdentifier:@"GroupCell" owner:self]; + returnMe = [tmpView frame].size.height; + } + // else if this is a pass + else if (row>indexOfPassesGroupCell) { + tmpView = [tv makeViewWithIdentifier:@"PassCell" owner:self]; + returnMe = [tmpView frame].size.height; + } + // else this is an input + else { + JSONGUIInput *input = [[[top inputsGroup] contents] lockObjectAtIndex:row-(indexOfInputsGroupCell+1)]; + NSString *typeString = [(JSONGUIInput *)input objectForKey:@"TYPE"]; + tmpView = [self makeTableCellViewForISFTypeString:typeString]; + returnMe = [tmpView frame].size.height; + } + + return returnMe; +} +- (BOOL)tableView:(NSTableView *)tv shouldSelectRow:(NSInteger)rowIndex { + return NO; +} +- (NSDragOperation) tableView:(NSTableView *)tv validateDrop:(id )info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op { + //NSLog(@"%s",__func__); + NSPasteboard *pboard = [info draggingPasteboard]; + id draggedObj = [NSKeyedUnarchiver unarchiveObjectWithData:[pboard dataForType:@"com.Vidvox.ISFEditor.JSONGUIPboard"]]; + // if i couldn't find the dragged obj, bail + if (draggedObj == nil) + return NO; + if (![draggedObj isKindOfClass:[NSNumber class]]) { + NSLog(@"\t\terr: expected a number for drag in %s, but instead got %@",__func__,NSStringFromClass([draggedObj class])); + return NO; + } + //NSLog(@"\t\tdraggedObj is %@",draggedObj); + + // the dragged object is the absolute index of the item being dragged + NSInteger srcIndex = [draggedObj longValue]; + // calculate some reference indexes that i'll need to locate the item being dragged + NSInteger indexOfInputsGroupCell = 1; + NSInteger indexOfPassesGroupCell = indexOfInputsGroupCell + [[[top inputsGroup] contents] lockCount] + 1; + //NSInteger indexOfLastPassCell = indexOfPassesGroupCell + [[[top passesGroup] contents] lockCount]; + // if the item being dragged is an input... + if (srcIndex>indexOfInputsGroupCell && srcIndex=indexOfPassesGroupCell) + return NSDragOperationNone; + else { + if (op == NSTableViewDropOn) + [tableView setDropRow:row+1 dropOperation:NSTableViewDropAbove]; + } + } + // else if the item being dragged is a pass... + else if (srcIndex>indexOfPassesGroupCell) { + // make sure the proposed row is acceptable for passes + if (row<=indexOfPassesGroupCell) + return NSDragOperationNone; + else { + if (op == NSTableViewDropOn) + [tableView setDropRow:row+1 dropOperation:NSTableViewDropAbove]; + } + } + // else we don't know what the item being dragged is- bail + else { + NSLog(@"\t\terr: unable to determine drag source item, %s",__func__); + return NSDragOperationNone; + } + + + + + return NSDragOperationEvery; +} +- (BOOL) tableView:(NSTableView *)tv acceptDrop:(id )info row:(int)row dropOperation:(NSTableViewDropOperation)op { + //NSLog(@"%s",__func__); + NSPasteboard *pboard = [info draggingPasteboard]; + id draggedObj = [NSKeyedUnarchiver unarchiveObjectWithData:[pboard dataForType:@"com.Vidvox.ISFEditor.JSONGUIPboard"]]; + // if i couldn't find the dragged obj, bail + if (draggedObj == nil) + return NO; + if (![draggedObj isKindOfClass:[NSNumber class]]) { + NSLog(@"\t\terr: expected a number for drag in %s, but instead got %@",__func__,NSStringFromClass([draggedObj class])); + return NO; + } + //NSLog(@"\t\tdraggedObj is %@",draggedObj); + + // the dragged object is the absolute index of the item being dragged + NSInteger srcIndex = [draggedObj longValue]; + NSInteger dstIndex = row; + if (srcIndex == dstIndex) + return YES; + + //NSLog(@"\t\tin table, srcIndex is %ld, dstIndex is %ld",(long)srcIndex,(long)dstIndex); + // get the object being dragged + id draggedGUIObject = [self objectAtRowIndex:srcIndex]; + //NSLog(@"\t\tdraggedGUIObject is %@",draggedGUIObject); + if (draggedGUIObject == nil) + return NO; + + // calculate some reference indexes that i'll need to locate the item being dragged + NSInteger indexOfInputsGroupCell = 1; + NSInteger indexOfPassesGroupCell = indexOfInputsGroupCell + [[[top inputsGroup] contents] lockCount] + 1; + + // actually move the thing + if ([draggedGUIObject isKindOfClass:[JSONGUIInput class]]) { + MutLockArray *theArray = [[[draggedGUIObject top] inputsGroup] contents]; + [theArray wrlock]; + if (srcIndex < dstIndex) { + [theArray insertObject:draggedGUIObject atIndex:dstIndex-indexOfInputsGroupCell-1]; + [theArray removeObjectAtIndex:srcIndex-indexOfInputsGroupCell-1]; + } + else { + [theArray removeObjectAtIndex:srcIndex-indexOfInputsGroupCell-1]; + [theArray insertObject:draggedGUIObject atIndex:dstIndex-indexOfInputsGroupCell-1]; + } + [theArray unlock]; + + // i have to recreate the JSON & export it + [self recreateJSONAndExport]; + return YES; + } + else if ([draggedGUIObject isKindOfClass:[JSONGUIPass class]]) { + MutLockArray *theArray = [[[draggedGUIObject top] passesGroup] contents]; + [theArray wrlock]; + if (srcIndex < dstIndex) { + [theArray insertObject:draggedGUIObject atIndex:dstIndex-indexOfPassesGroupCell-1]; + [theArray removeObjectAtIndex:srcIndex-indexOfPassesGroupCell-1]; + } + else { + [theArray removeObjectAtIndex:srcIndex-indexOfPassesGroupCell-1]; + [theArray insertObject:draggedGUIObject atIndex:dstIndex-indexOfPassesGroupCell-1]; + } + [theArray unlock]; + + // i have to recreate the JSON & export it + [self recreateJSONAndExport]; + return YES; + } + else { + return NO; + } + +} + + +- (NSView *) makeTableCellViewForISFTypeString:(NSString *)typeString { + NSView *returnMe = nil; + + if (typeString==nil) + returnMe = nil; + else if (![typeString isKindOfClass:[NSString class]]) + returnMe = nil; + else if ([typeString isEqualToString:@"event"]) + returnMe = [tableView makeViewWithIdentifier:@"EventCell" owner:self]; + else if ([typeString isEqualToString:@"bool"]) + returnMe = [tableView makeViewWithIdentifier:@"BoolCell" owner:self]; + else if ([typeString isEqualToString:@"long"]) + returnMe = [tableView makeViewWithIdentifier:@"LongCell" owner:self]; + else if ([typeString isEqualToString:@"float"]) + returnMe = [tableView makeViewWithIdentifier:@"FloatCell" owner:self]; + else if ([typeString isEqualToString:@"point2D"]) + returnMe = [tableView makeViewWithIdentifier:@"Point2DCell" owner:self]; + else if ([typeString isEqualToString:@"color"]) + returnMe = [tableView makeViewWithIdentifier:@"ColorCell" owner:self]; + else if ([typeString isEqualToString:@"image"]) + returnMe = [tableView makeViewWithIdentifier:@"ImageCell" owner:self]; + else if ([typeString isEqualToString:@"audio"]) + returnMe = [tableView makeViewWithIdentifier:@"AudioCell" owner:self]; + else if ([typeString isEqualToString:@"audioFFT"]) + returnMe = [tableView makeViewWithIdentifier:@"AudioFFTCell" owner:self]; + + return returnMe; +} +- (NSDictionary *) isfDict { + LOCK(&dictLock); + NSDictionary *returnMe = (isfDict==nil) ? nil : [[isfDict retain] autorelease]; + UNLOCK(&dictLock); + return returnMe; +} +- (NSMutableDictionary *) createNewISFDict { + NSMutableDictionary *returnMe = MUTDICT; + NSMutableArray *tmpArray = nil; + //NSMutableDictionary *tmpDict = nil; + + // populate the dict i'll be returning with the base dict i was populated from + [returnMe addEntriesFromDictionary:[[top isfDict] dict]]; + // remove the stuff that i'll be populating dynamically (leaving whatever non-spec stuff the user put in there) + [returnMe removeObjectForKey:@"INPUTS"]; + [returnMe removeObjectForKey:@"PERSISTENT_BUFFERS"]; + [returnMe removeObjectForKey:@"PASSES"]; + // now populate the INPUTS + tmpArray = [top makeInputsArray]; + if (tmpArray != nil) + [returnMe setObject:tmpArray forKey:@"INPUTS"]; + // populate the PASSES + tmpArray = [top makePassesArray]; + if (tmpArray != nil) + [returnMe setObject:tmpArray forKey:@"PASSES"]; + // populate the PERSISTENT_BUFFERS + //tmpDict = [top makeBuffersDict]; + //if (tmpDict != nil) + // [returnMe setObject:tmpDict forKey:@"PERSISTENT_BUFFERS"]; + + // make sure we're flagged as ISFVSN 2.0 + [returnMe setObject:@"2" forKey:@"ISFVSN"]; + + return returnMe; +} +- (id) objectAtRowIndex:(NSInteger)n { + if (n<0 || n==NSNotFound) + return nil; + id returnMe = nil; + // calculate some reference indexes that i'll need to locate the item being dragged + NSInteger indexOfInputsGroupCell = 1; + NSInteger indexOfPassesGroupCell = indexOfInputsGroupCell + [[[top inputsGroup] contents] lockCount] + 1; + NSInteger indexOfLastPassCell = indexOfPassesGroupCell + [[[top passesGroup] contents] lockCount]; + // if the item being dragged is an input... + if (n>indexOfInputsGroupCell && nindexOfPassesGroupCell && n<=indexOfLastPassCell) { + returnMe = [[[top passesGroup] contents] lockObjectAtIndex:n-indexOfPassesGroupCell-1]; + } + // else we don't know what the item being dragged is- bail + else { + NSLog(@"\t\terr: unable to determine drag source item, %s",__func__); + } + return [[returnMe retain] autorelease]; +} + + +- (void) recreateJSONAndExport { + //NSLog(@"%s",__func__); + NSDictionary *newDict = [self createNewISFDict]; + if (newDict == nil) { + NSLog(@"\t\terr: newly-created ISF dict nil, %s",__func__); + return; + } + + //[docController loadFile:nil]; + + ISFGLScene *scene = [isfController scene]; + NSString *exportString = [NSString stringWithFormat:@"/*\n%@\n*/%@",[newDict prettyJSONString],[scene fragShaderSource]]; + //NSLog(@"\t\texportString is %@",exportString); + NSString *exportPath = [scene filePath]; + NSError *nsErr = nil; + if (exportPath!=nil && exportString!=nil) { + if (![exportString writeToFile:exportPath atomically:YES encoding:NSUTF8StringEncoding error:&nsErr]) { + NSLog(@"\t\tERR exporting to file %@ in %s. %@",exportPath,__func__,nsErr); + } + else { + // tell the doc controller to load the file again (the ISF controller reloaded the file already b/c it's watching the file for changes) + [isfController reloadTargetFile]; + [docController loadFile:exportPath]; + } + } +} + + +- (IBAction) saveCurrentValsAsDefaults:(id)sender { + //NSLog(@"%s",__func__); + // get the scene & inputs & top, bail if we can't + ISFGLScene *scene = [isfController scene]; + MutLockArray *inputs = [scene inputs]; + LOCK(&dictLock); + JSONGUITop *_top = (top==nil) ? nil : [[top retain] autorelease]; + UNLOCK(&dictLock); + if (inputs==nil || _top==nil) + return; + // run through the inputs- we want to get the current val of applicable inputs, and apply it to the relevation JSONGUI* object + [inputs rdlock]; + for (ISFAttrib *attrib in [inputs array]) { + ISFAttribVal attribVal = [attrib currentVal]; + JSONGUIInput *input = [_top getInputNamed:[attrib attribName]]; + switch ([attrib attribType]) { + case ISFAT_Event: + case ISFAT_Image: + case ISFAT_Cube: + case ISFAT_Audio: + case ISFAT_AudioFFT: + // do nothing for these types- they can't have a "currentVal" + break; + case ISFAT_Bool: + [input setObject:NUMBOOL(attribVal.boolVal) forKey:@"DEFAULT"]; + break; + case ISFAT_Long: + [input setObject:NUMLONG(attribVal.longVal) forKey:@"DEFAULT"]; + break; + case ISFAT_Float: + [input setObject:NUMFLOAT(attribVal.floatVal) forKey:@"DEFAULT"]; + break; + case ISFAT_Point2D: + [input setObject:@[NUMFLOAT(attribVal.point2DVal[0]), NUMFLOAT(attribVal.point2DVal[1])] forKey:@"DEFAULT"]; + break; + case ISFAT_Color: + [input setObject:@[NUMFLOAT(attribVal.colorVal[0]), NUMFLOAT(attribVal.colorVal[1]), NUMFLOAT(attribVal.colorVal[2]), NUMFLOAT(attribVal.colorVal[3])] forKey:@"DEFAULT"]; + break; + } + } + [inputs unlock]; + // save everything! + [self recreateJSONAndExport]; +} + + +@end diff --git a/ISF Editor/JSONGUIDictGroup.h b/ISF Editor/JSONGUIDictGroup.h new file mode 100644 index 00000000..d4bdb6c6 --- /dev/null +++ b/ISF Editor/JSONGUIDictGroup.h @@ -0,0 +1,30 @@ +#import +#import +@class JSONGUITop; + + + + +// we have to pass an array around (group-type cell in the outline view), but we need to discern between arrays of inputs and arrays of passes at the group level (because the group needs to be capable of making additional instances of its contents) +typedef NS_ENUM(NSInteger, ISFDictClassType) { + ISFDictClassType_PersistentBuffer +}; + + + + +@interface JSONGUIDictGroup : NSObject { + ISFDictClassType groupType; + MutLockDict *contents; + ObjectHolder *top; +} + +- (id) initWithType:(ISFDictClassType)targetType top:(JSONGUITop *)theTop; + +- (id) objectForKey:(NSString *)k; + +@property (readonly) ISFDictClassType groupType; +@property (readonly) MutLockDict *contents; +- (JSONGUITop *) top; + +@end diff --git a/ISF Editor/JSONGUIDictGroup.m b/ISF Editor/JSONGUIDictGroup.m new file mode 100644 index 00000000..7c4e9d32 --- /dev/null +++ b/ISF Editor/JSONGUIDictGroup.m @@ -0,0 +1,102 @@ +#import "JSONGUIDictGroup.h" +#import "JSONGUIPersistentBuffer.h" +#import "JSONGUITop.h" +#import +#import + + + + +@implementation JSONGUIDictGroup + + +- (id) initWithType:(ISFDictClassType)targetType top:(JSONGUITop *)theTop { + self = [super init]; + if (self != nil) { + // initialize the basic vars + groupType = targetType; + contents = [[MutLockDict alloc] init]; + top = [[ObjectHolder alloc] initWithZWRObject:theTop]; + + // get the raw ISF dict from the top-level object- this is what we're going to parse to populate our contents + MutLockDict *isfDict = [theTop isfDict]; + + switch (targetType) { + // this dict is going to contain persistent buffers + case ISFDictClassType_PersistentBuffer: + { + // get the PERSISTENT_BUFFERS object from the top-level ISF dict, parse it- we just need a name + NSDictionary *pBuffersDict = [isfDict objectForKey:@"PERSISTENT_BUFFERS"]; + if (pBuffersDict != nil) { + if ([pBuffersDict isKindOfClass:[NSArray class]]) { + for (NSString *pbName in (NSArray *)pBuffersDict) { + // make a persistent buffer object from the name (it will populate itself) + JSONGUIPersistentBuffer *newBuffer = [[[JSONGUIPersistentBuffer alloc] initWithName:pbName top:theTop] autorelease]; + if (newBuffer != nil) + [contents lockSetObject:newBuffer forKey:pbName]; + } + } + else if ([pBuffersDict isKindOfClass:[NSDictionary class]]) { + for (NSString *pbName in [pBuffersDict allKeys]) { + // make a persistent buffer object from the name (it will populate itself) + JSONGUIPersistentBuffer *newBuffer = [[[JSONGUIPersistentBuffer alloc] initWithName:pbName top:theTop] autorelease]; + if (newBuffer != nil) + [contents lockSetObject:newBuffer forKey:pbName]; + } + } + } + // run through all the PASSES, looking for a pass dict with a PERSISTENT flag + NSArray *passesArray = [isfDict objectForKey:@"PASSES"]; + for (NSDictionary *passDict in passesArray) { + id persistentObj = [passDict objectForKey:@"PERSISTENT"]; + NSNumber *persistentNum = nil; + if ([persistentObj isKindOfClass:[NSString class]]) { + persistentNum = [(NSString *)persistentObj parseAsBoolean]; + if (persistentNum == nil) + persistentNum = [(NSString *)persistentObj numberByEvaluatingString]; + } + else if ([persistentObj isKindOfClass:[NSNumber class]]) + persistentNum = [[persistentObj retain] autorelease]; + // if there's a valid "PERSISTENT" flag in this pass dict and it's indicating a positive + if (persistentNum!=nil && [persistentNum intValue]>0) { + // get the name of the target + NSString *targetName = [passDict objectForKey:@"TARGET"]; + if (targetName!=nil && [targetName isKindOfClass:[NSString class]]) { + // make a persistent buffer object (it will populate itself) + JSONGUIPersistentBuffer *newBuffer = [[[JSONGUIPersistentBuffer alloc] initWithName:targetName top:theTop] autorelease]; + if (newBuffer != nil) + [contents lockSetObject:newBuffer forKey:targetName]; + } + } + } + } + break; + } + } + return self; +} +- (void) dealloc { + VVRELEASE(contents); + VVRELEASE(top); + [super dealloc]; +} +- (id) objectForKey:(NSString *)k { + if (k==nil) + return nil; + return [[[contents lockObjectForKey:k] retain] autorelease]; +} +@synthesize groupType; +@synthesize contents; +- (JSONGUITop *) top { + return [top object]; +} +- (NSString *) description { + switch (groupType) { + case ISFDictClassType_PersistentBuffer: + return @""; + } + return @""; +} + + +@end diff --git a/ISF Editor/JSONGUIDragBarView.h b/ISF Editor/JSONGUIDragBarView.h new file mode 100644 index 00000000..e4e7484a --- /dev/null +++ b/ISF Editor/JSONGUIDragBarView.h @@ -0,0 +1,11 @@ +#import +#import + + + +// must always be in an instance of either ISFPropInputTableCellView or ISFPropPassTableCellView +@interface JSONGUIDragBarView : VVSpriteView { + ObjectHolder *bgSpriteHolder; +} + +@end diff --git a/ISF Editor/JSONGUIDragBarView.m b/ISF Editor/JSONGUIDragBarView.m new file mode 100644 index 00000000..4932b82d --- /dev/null +++ b/ISF Editor/JSONGUIDragBarView.m @@ -0,0 +1,151 @@ +#import "JSONGUIDragBarView.h" +#import "ISFPropInputTableCellView.h" +#import "ISFPropPassTableCellView.h" +#import + + + + +#define ARCHIVE(a) [NSKeyedArchiver archivedDataWithRootObject:a] +#define UNARCHIVE(a) [NSKeyedUnarchiver unarchiveObjectWithData:a] + + + + +@implementation JSONGUIDragBarView + + +- (void) generalInit { + [super generalInit]; + VVSprite *tmpSprite = [spriteManager makeNewSpriteAtBottomForRect:NSMakeRect(0,0,1,1)]; + [tmpSprite setDelegate:self]; + [tmpSprite setDrawCallback:@selector(drawBGSprite:)]; + [tmpSprite setActionCallback:@selector(bgSpriteAction:)]; + bgSpriteHolder = [[ObjectHolder alloc] initWithZWRObject:tmpSprite]; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + VVRELEASE(bgSpriteHolder); + [super dealloc]; +} +- (void) drawBGSprite:(VVSprite *)s { + /* + [[NSColor redColor] set]; + NSRectFill([s rect]); + */ + + [[NSColor colorWithDeviceRed:0. green:0. blue:0. alpha:0.05] set]; + NSRectFill([s rect]); + + NSImage *logo = [NSImage imageNamed:NSImageNameShareTemplate]; + NSSize logoSize = [logo size]; + NSRect logoRect = [VVSizingTool + rectThatFitsRect:NSMakeRect(0,0,logoSize.width,logoSize.height) + inRect:NSInsetRect([self bounds],2,2) + sizingMode:VVSizingModeFit]; + [logo drawInRect:logoRect]; +} +- (void) bgSpriteAction:(VVSprite *)s { + //NSLog(@"%s",__func__); + if ([s lastActionType]==VVSpriteEventDrag) { + NSPoint mdd = [s mouseDownDelta]; + if (fabs(mdd.x)>30 || fabs(mdd.y)>30) { + + NSString *dragType = @"com.Vidvox.ISFEditor.JSONGUIPboard"; + NSPasteboardItem *pbItem = [[NSPasteboardItem alloc] init]; + NSDraggingItem *dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter:pbItem]; + [dragItem setImageComponentsProvider:^(void) { + //NSLog(@"%s",__func__); + NSArray *returnMe = nil; + NSImage *dragImage = [[[NSImage alloc] initWithData:[[self superview] dataWithPDFInsideRect:[[self superview] bounds]]] autorelease]; + + // when i draw the drag image, an origin of (0,0) will draw it at the origin of self + + + NSPoint mouseDown = NSZeroPoint; + NSPoint convertedMouseDown = [self convertPoint:mouseDown toView:[self superview]]; + NSRect dragImageFrame = NSMakeRect(0,0,0,0); + dragImageFrame.origin = VVADDPOINT(VVSUBPOINT(NSZeroPoint, convertedMouseDown), mdd); + //dragImageFrame.origin = NSMakePoint(0,0); + dragImageFrame.size = [dragImage size]; + if (dragImage==nil) + NSLog(@"\t\terr: couldn't make drag image, %s",__func__); + else { + NSDraggingImageComponent *component = [NSDraggingImageComponent draggingImageComponentWithKey:NSDraggingImageComponentIconKey]; + if (component==nil) + NSLog(@"\t\terr: couldn't make component for key %@ in %s",dragType,__func__); + else { + [component setContents:dragImage]; + [component setFrame:dragImageFrame]; + returnMe = OBJARRAY(component); + } + } + return (NSArray *)returnMe; + }]; + NSDraggingSession *session = [self beginDraggingSessionWithItems:OBJARRAY(dragItem) event:[self lastMouseEvent] source:self]; + if (session==nil) + NSLog(@"\t\terr: dragging session nil in %s",__func__); + else { + NSPasteboard *pb = [session draggingPasteboard]; + if (pb==nil) + NSLog(@"\t\terr: dragging pb nil in %s",__func__); + else { + // populate the pasteboard using the ABSOLUTE index of the item being dragged + [pb clearContents]; + id mySuperview = [self superview]; + NSInteger myIndex = NSNotFound; + if ([mySuperview isKindOfClass:[ISFPropInputTableCellView class]]) { + JSONGUIInput *myInput = [mySuperview input]; + myIndex = [[myInput top] indexOfInput:myInput]; + myIndex += 2; // the first two rows in the table are the "top" view and the "group" view for inputs + } + else if ([mySuperview isKindOfClass:[ISFPropPassTableCellView class]]) { + JSONGUIPass *myPass = [mySuperview pass]; + myIndex = [[myPass top] indexOfPass:myPass]; + myIndex += 2; // the first two rows in the table are the "top" view and the "group" view for inputs + myIndex += [[[[myPass top] inputsGroup] contents] lockCount]; // compensate for the inputs + ++myIndex; // compensate for the "group" view for passes + } + if (myIndex == NSNotFound) + NSLog(@"\t\terr: index is NSNotFound in %s",__func__); + else + [pb setData:ARCHIVE(NUMLONG(myIndex)) forType:dragType]; + /* + NSNumber *draggedTabIndex = [NSNumber numberWithInt:[[dragTabWindow dragTabViewControllers] lockIndexOfIdenticalPtr:[t NRUserInfo]]]; + NSData *tmpData = [NSKeyedArchiver archivedDataWithRootObject:draggedTabIndex]; + [pb setData:tmpData forType:dragType]; + */ + } + } + VVRELEASE(dragItem); + VVRELEASE(pbItem); + } + } +} +- (void) updateSprites { + [super updateSprites]; + [[bgSpriteHolder object] setRect:[self bounds]]; +} + +/*===================================================================================*/ +#pragma mark --------------------- dragging source protocol +/*------------------------------------*/ + +- (NSDragOperation) draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context { + + switch (context) { + case NSDraggingContextOutsideApplication: + return NSDragOperationNone; + break; + case NSDraggingContextWithinApplication: + return NSDragOperationMove; + break; + default: + return NSDragOperationNone; + break; + } + +} + +@end diff --git a/ISF Editor/JSONGUIInput.h b/ISF Editor/JSONGUIInput.h new file mode 100644 index 00000000..1e7da934 --- /dev/null +++ b/ISF Editor/JSONGUIInput.h @@ -0,0 +1,22 @@ +#import +#import +#import "JSONGUITop.h" + + + + +@interface JSONGUIInput : NSObject { + MutLockDict *dict; + ObjectHolder *top; +} + +- (id) initWithDict:(NSDictionary *)n top:(JSONGUITop *)t; + +- (id) objectForKey:(NSString *)k; +- (void) setObject:(id)n forKey:(NSString *)k; +- (JSONGUITop *) top; + +- (NSMutableDictionary *) createExportDict; + + +@end diff --git a/ISF Editor/JSONGUIInput.m b/ISF Editor/JSONGUIInput.m new file mode 100644 index 00000000..5902c704 --- /dev/null +++ b/ISF Editor/JSONGUIInput.m @@ -0,0 +1,54 @@ +#import "JSONGUIInput.h" + + + + +@implementation JSONGUIInput + + +- (id) initWithDict:(NSDictionary *)n top:(JSONGUITop *)t { + self = [super init]; + if (self != nil) { + dict = nil; + top = nil; + if (n==nil || t==nil) { + [self release]; + return nil; + } + dict = [[MutLockDict alloc] init]; + // we can just copy the contents of INPUT dicts + [dict lockAddEntriesFromDictionary:n]; + top = [[ObjectHolder alloc] initWithZWRObject:t]; + } + return self; +} +- (void) dealloc { + VVRELEASE(dict); + VVRELEASE(top); + [super dealloc]; +} +- (id) objectForKey:(NSString *)k { + return [[[dict lockObjectForKey:k] retain] autorelease]; +} +- (void) setObject:(id)n forKey:(NSString *)k { + if (n==nil) + [dict lockRemoveObjectForKey:k]; + else + [dict lockSetObject:n forKey:k]; +} +- (NSString *) description { + return [NSString stringWithFormat:@"",[dict lockObjectForKey:@"NAME"]]; +} +- (JSONGUITop *) top { + return [top object]; +} + + +- (NSMutableDictionary *) createExportDict { + if (dict==nil) + return nil; + return [dict lockCreateDictCopy]; +} + + +@end diff --git a/ISF Editor/JSONGUIPass.h b/ISF Editor/JSONGUIPass.h new file mode 100644 index 00000000..f49dfd35 --- /dev/null +++ b/ISF Editor/JSONGUIPass.h @@ -0,0 +1,21 @@ +#import +#import +@class JSONGUITop; + + + + +@interface JSONGUIPass : NSObject { + MutLockDict *dict; + ObjectHolder *top; +} + +- (id) initWithDict:(NSDictionary *)n top:(JSONGUITop *)t; + +- (id) objectForKey:(NSString *)k; +- (void) setObject:(id)n forKey:(NSString *)k; +- (JSONGUITop *) top; + +- (NSMutableDictionary *) createExportDict; + +@end diff --git a/ISF Editor/JSONGUIPass.m b/ISF Editor/JSONGUIPass.m new file mode 100644 index 00000000..49ac1764 --- /dev/null +++ b/ISF Editor/JSONGUIPass.m @@ -0,0 +1,78 @@ +#import "JSONGUIPass.h" +#import "JSONGUIPersistentBuffer.h" +#import "JSONGUITop.h" + + + + +@implementation JSONGUIPass + + +- (id) initWithDict:(NSDictionary *)n top:(JSONGUITop *)t { + self = [super init]; + if (self != nil) { + dict = nil; + top = nil; + if (t==nil) { + [self release]; + return nil; + } + dict = [[MutLockDict alloc] init]; + [dict wrlock]; + // add all the entries from the dict we were passed (which should be a dict from the PASSES array of an ISF dict) + [dict addEntriesFromDictionary:n]; + [dict unlock]; + + top = [[ObjectHolder alloc] initWithZWRObject:t]; + } + return self; +} +- (void) dealloc { + VVRELEASE(dict); + VVRELEASE(top); + [super dealloc]; +} +- (id) objectForKey:(NSString *)k { + return [[[dict lockObjectForKey:k] retain] autorelease]; +} +- (void) setObject:(id)n forKey:(NSString *)k { + //NSLog(@"%s ... %@, %@",__func__,n,k); + if (n==nil) + [dict lockRemoveObjectForKey:k]; + else + [dict lockSetObject:n forKey:k]; + //NSLog(@"\t\tafter, dict is %@",dict); +} +- (NSString *) description { + return [NSString stringWithFormat:@"",self]; +} +- (JSONGUITop *) top { + return [top object]; +} + + +- (NSMutableDictionary *) createExportDict { + //NSLog(@"%s ... %@",__func__,self); + if (dict==nil) + return nil; + // copy the entries from my dict into the dict i'll be returning + NSMutableDictionary *returnMe = MUTDICT; + [dict rdlock]; + [returnMe addEntriesFromDictionary:[dict dict]]; + [dict unlock]; + // if i'm rendering into a persistent buffer, i shouldn't put any info about it in this dict (i'll let the persistent buffer do this) + NSString *targetName = [dict lockObjectForKey:@"TARGET"]; + JSONGUIPersistentBuffer *pbuffer = (targetName==nil) ? nil : [[top object] getPersistentBufferNamed:targetName]; + if (pbuffer != nil) { + [returnMe removeObjectForKey:@"WIDTH"]; + [returnMe removeObjectForKey:@"HEIGHT"]; + [returnMe removeObjectForKey:@"FLOAT"]; + [returnMe setObject:NUMBOOL(YES) forKey:@"PERSISTENT"]; + [returnMe addEntriesFromDictionary:[pbuffer createExportDict]]; + } + //NSLog(@"\t\treturning %@",returnMe); + return returnMe; +} + + +@end diff --git a/ISF Editor/JSONGUIPersistentBuffer.h b/ISF Editor/JSONGUIPersistentBuffer.h new file mode 100644 index 00000000..9d6c598c --- /dev/null +++ b/ISF Editor/JSONGUIPersistentBuffer.h @@ -0,0 +1,23 @@ +#import +#import +@class JSONGUITop; + + + + +@interface JSONGUIPersistentBuffer : NSObject { + MutLockDict *dict; + NSString *name; + ObjectHolder *top; +} + +- (id) initWithName:(NSString *)n top:(JSONGUITop *)t; + +- (id) objectForKey:(NSString *)k; +- (void) setObject:(id)n forKey:(NSString *)k; +- (NSString *) name; +- (JSONGUITop *) top; + +- (NSDictionary *) createExportDict; + +@end diff --git a/ISF Editor/JSONGUIPersistentBuffer.m b/ISF Editor/JSONGUIPersistentBuffer.m new file mode 100644 index 00000000..6b12ba5a --- /dev/null +++ b/ISF Editor/JSONGUIPersistentBuffer.m @@ -0,0 +1,100 @@ +#import "JSONGUIPersistentBuffer.h" +#import "JSONGUITop.h" + + + + +@implementation JSONGUIPersistentBuffer + + +- (id) initWithName:(NSString *)n top:(JSONGUITop *)t { + self = [super init]; + if (self != nil) { + dict = nil; + name = nil; + top = nil; + if (n==nil || [n length]<1 || t==nil) { + [self release]; + return nil; + } + + // make an empty dict, retain the passed name and make a weak ref to the top + dict = [[MutLockDict alloc] init]; + name = (n==nil) ? nil : [n retain]; + top = [[ObjectHolder alloc] initWithZWRObject:t]; + + // get the top-level ISF dict- we're going to parse its contents to populate 'dict' + MutLockDict *isfDict = [t isfDict]; + + // the "PERSISTENT_BUFFERS" dict (or maybe array?) has to be parsed for information relevant to the buffer i'm looking for + NSDictionary *pbuffersDict = [isfDict objectForKey:@"PERSISTENT_BUFFERS"]; + if (pbuffersDict != nil) { + // if the "PERSISTENT_BUFFERS" dict is really an array + if ([pbuffersDict isKindOfClass:[NSArray class]]) { + // do nothing- the array only contains strings/buffer names, and we already have the name + } + // if the "PERSISTENT_BUFFERS" dict is really a dictionary + else if ([pbuffersDict isKindOfClass:[NSDictionary class]]) { + // use the passed name to look up the sub-dict which describes the persistent buffer + NSDictionary *pbufferDict = [pbuffersDict objectForKey:n]; + // if i found a dict describing myself, add its entries to my dict + if (pbufferDict != nil) + [dict lockAddEntriesFromDictionary:pbufferDict]; + } + } + + // the "PASSES" might also contain information about persistent buffers! + NSArray *passes = [isfDict objectForKey:@"PASSES"]; + // run through all the pass dicts + for (NSDictionary *passDict in passes) { + // if this pass has a target, and that target matches my target + NSString *passTargetName = [passDict objectForKey:@"TARGET"]; + if (passTargetName!=nil && [passTargetName isEqualToString:n]) { + // get the WIDTH, HEIGHT, and FLOAT keys from the pass dict! + NSArray *tmpKeys = @[@"WIDTH", @"HEIGHT", @"FLOAT"]; + for (NSString *tmpKey in tmpKeys) { + id anObj = [passDict objectForKey:tmpKey];; + if (anObj != nil) + [dict lockSetObject:anObj forKey:tmpKey]; + } + } + } + + // ...okay, at this point 'dict' should be fully populated with all the values necessary to describe this buffer + } + return self; +} +- (void) dealloc { + VVRELEASE(dict); + VVRELEASE(name); + VVRELEASE(top); + [super dealloc]; +} +- (id) objectForKey:(NSString *)k { + return [[[dict lockObjectForKey:k] retain] autorelease]; +} +- (void) setObject:(id)n forKey:(NSString *)k { + //NSLog(@"%s ... %@, %@",__func__,n,k); + if (n==nil) + [dict lockRemoveObjectForKey:k]; + else + [dict lockSetObject:n forKey:k]; + //NSLog(@"\t\tafter, dict is %@",dict); +} +- (NSString *) name { + return [[name retain] autorelease]; +} +- (NSString *) description { + return [NSString stringWithFormat:@"",name]; +} +- (JSONGUITop *) top { + return [top object]; +} + + +- (NSDictionary *) createExportDict { + return [dict lockCreateDictCopy]; +} + + +@end diff --git a/ISF Editor/JSONGUITop.h b/ISF Editor/JSONGUITop.h new file mode 100644 index 00000000..268d7994 --- /dev/null +++ b/ISF Editor/JSONGUITop.h @@ -0,0 +1,39 @@ +#import +#import +#import "JSONGUIArrayGroup.h" +#import "JSONGUIDictGroup.h" +#import "JSONGUIPersistentBuffer.h" +#import "JSONGUIPass.h" +@class JSONGUIInput; + + + + +@interface JSONGUITop : NSObject { + MutLockDict *isfDict; + + JSONGUIArrayGroup *inputsGroup; + JSONGUIArrayGroup *passesGroup; + JSONGUIDictGroup *buffersGroup; +} + +- (id) initWithISFDict:(NSDictionary *)n; + +- (MutLockDict *) isfDict; +- (JSONGUIArrayGroup *) inputsGroup; +- (JSONGUIArrayGroup *) passesGroup; +- (JSONGUIDictGroup *) buffersGroup; + +- (JSONGUIInput *) getInputNamed:(NSString *)n; +- (NSArray *) getPassesRenderingToBufferNamed:(NSString *)n; +- (JSONGUIPersistentBuffer *) getPersistentBufferNamed:(NSString *)n; +- (NSInteger) indexOfInput:(JSONGUIInput *)n; +- (NSInteger) indexOfPass:(JSONGUIPass *)n; +//- (NSArray *) persistentBufferNames; +- (NSString *) createNewInputName; + +- (NSMutableArray *) makeInputsArray; +- (NSMutableArray *) makePassesArray; +- (NSMutableDictionary *) makeBuffersDict; + +@end diff --git a/ISF Editor/JSONGUITop.m b/ISF Editor/JSONGUITop.m new file mode 100644 index 00000000..46ff2c1d --- /dev/null +++ b/ISF Editor/JSONGUITop.m @@ -0,0 +1,198 @@ +#import "JSONGUITop.h" +#import "JSONGUIPass.h" +#import "JSONGUIInput.h" + + + + +@implementation JSONGUITop + + +- (id) initWithISFDict:(NSDictionary *)n { + self = [super init]; + if (self != nil) { + isfDict = nil; + inputsGroup = nil; + passesGroup = nil; + buffersGroup = nil; + if (n==nil) { + [self release]; + return nil; + } + isfDict = [[MutLockDict alloc] init]; + [isfDict lockAddEntriesFromDictionary:n]; + + // make the groups- the groups create instances of inputs/passes/persistent buffers as needed (which do all their own parsing) + inputsGroup = [[JSONGUIArrayGroup alloc] initWithType:ISFArrayClassType_Input top:self]; + passesGroup = [[JSONGUIArrayGroup alloc] initWithType:ISFArrayClassType_Pass top:self]; + buffersGroup = [[JSONGUIDictGroup alloc] initWithType:ISFDictClassType_PersistentBuffer top:self]; + } + return self; +} +- (void) dealloc { + VVRELEASE(inputsGroup); + VVRELEASE(passesGroup); + VVRELEASE(buffersGroup); + [super dealloc]; +} +- (MutLockDict *) isfDict { + return [[isfDict retain] autorelease]; +} +- (JSONGUIArrayGroup *) inputsGroup { + return [[inputsGroup retain] autorelease]; +} +- (JSONGUIArrayGroup *) passesGroup { + return [[passesGroup retain] autorelease]; +} +- (JSONGUIDictGroup *) buffersGroup { + return [[buffersGroup retain] autorelease]; +} +- (NSString *) description { + return @""; +} + + + +- (JSONGUIInput *) getInputNamed:(NSString *)n { + if (n==nil) + return nil; + JSONGUIInput *returnMe = nil; + MutLockArray *inputArray = [inputsGroup contents]; + [inputArray rdlock]; + for (JSONGUIInput *input in [inputArray array]) { + NSString *inputName = [input objectForKey:@"NAME"]; + if (inputName!=nil && [inputName isEqualToString:n]) + returnMe = [[input retain] autorelease]; + } + [inputArray unlock]; + return returnMe; +} +- (NSArray *) getPassesRenderingToBufferNamed:(NSString *)n { + if (n==nil) + return nil; + NSMutableArray *returnMe = nil; + MutLockArray *passes = [passesGroup contents]; + [passes rdlock]; + for (JSONGUIPass *passPtr in [passes array]) { + NSString *passTarget = [passPtr objectForKey:@"TARGET"]; + if (passTarget!=nil && [passTarget isEqualToString:n]) { + //returnMe = [[passTarget retain] autorelease]; + if (returnMe == nil) + returnMe = MUTARRAY; + [returnMe addObject:passPtr]; + } + } + [passes unlock]; + + return returnMe; +} +- (JSONGUIPersistentBuffer *) getPersistentBufferNamed:(NSString *)n { + if (n==nil) + return nil; + return [[[[buffersGroup contents] lockObjectForKey:n] retain] autorelease]; +} +- (NSInteger) indexOfInput:(JSONGUIInput *)n { + NSInteger returnMe = NSNotFound; + if (n != nil) { + returnMe = [[inputsGroup contents] lockIndexOfObject:n]; + } + return returnMe; +} +- (NSInteger) indexOfPass:(JSONGUIPass *)n { + //NSLog(@"%s ... %@",__func__,n); + //NSLog(@"\t\tcontents are %@",[passesGroup contents]); + NSInteger returnMe = NSNotFound; + if (n != nil) { + returnMe = [[passesGroup contents] lockIndexOfObject:n]; + } + return returnMe; +} +/* +- (NSArray *) persistentBufferNames { + NSMutableArray *returnMe = MUTARRAY; + MutLockArray *passes = [passesGroup contents]; + MutLockDict *persistentBuffers = [buffersGroup contents]; + + return returnMe; +} +*/ +- (NSString *) createNewInputName { + NSString *returnMe = nil; + NSInteger count = 1; + do { + // make a new name + if (count == 1) + returnMe = @"tmpInputName"; + else + returnMe = [NSString stringWithFormat:@"tmpInputName%d",(int)count]; + // check to see if the name is already in use- if it is, set it to nil and it'll loop + if ([self getInputNamed:returnMe]!=nil) + returnMe = nil; + // increment the count + ++count; + } while (returnMe == nil); + return returnMe; +} + + +- (NSMutableArray *) makeInputsArray { + NSMutableArray *returnMe = nil; + + if (inputsGroup != nil) { + MutLockArray *inputsArray = [inputsGroup contents]; + [inputsArray rdlock]; + for (JSONGUIInput *input in [inputsArray array]) { + NSDictionary *newDict = [input createExportDict]; + if (newDict != nil) { + if (returnMe == nil) + returnMe = MUTARRAY; + [returnMe addObject:newDict]; + } + } + [inputsArray unlock]; + } + + return returnMe; +} +- (NSMutableArray *) makePassesArray { + NSMutableArray *returnMe = nil; + + if (passesGroup != nil) { + MutLockArray *passesArray = [passesGroup contents]; + [passesArray rdlock]; + for (JSONGUIPass *pass in [passesArray array]) { + NSDictionary *newDict = [pass createExportDict]; + if (newDict != nil) { + if (returnMe == nil) + returnMe = MUTARRAY; + [returnMe addObject:newDict]; + } + } + [passesArray unlock]; + } + + return returnMe; +} +- (NSMutableDictionary *) makeBuffersDict { + NSMutableDictionary *returnMe = nil; + + if (buffersGroup != nil) { + MutLockDict *buffersDict = [buffersGroup contents]; + [buffersDict rdlock]; + for (NSString *bufferKey in [buffersDict allKeys]) { + JSONGUIPersistentBuffer *pbuffer = [buffersDict objectForKey:bufferKey]; + NSDictionary *pbufferDict = [pbuffer createExportDict]; + if (pbufferDict!=nil) { + if (returnMe == nil) + returnMe = MUTDICT; + [returnMe setObject:pbufferDict forKey:bufferKey]; + } + } + [buffersDict unlock]; + } + + return returnMe; +} + + +@end diff --git a/ISF Editor/MouseView.h b/ISF Editor/MouseView.h new file mode 100644 index 00000000..18337b99 --- /dev/null +++ b/ISF Editor/MouseView.h @@ -0,0 +1,22 @@ +// +// MouseView.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/21/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import +#import +#import +#import +#import "ISFVVBufferGLView.h" + + + + +@interface MouseView : ISFVVBufferGLView { + IBOutlet id controller; +} + +@end diff --git a/ISF Editor/MouseView.m b/ISF Editor/MouseView.m new file mode 100644 index 00000000..419be053 --- /dev/null +++ b/ISF Editor/MouseView.m @@ -0,0 +1,50 @@ +// +// MouseView.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/21/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import "MouseView.h" +#import "ISFController.h" + + + + +@implementation MouseView + + +- (void) actionBgSprite:(VVSprite *)s { + //NSLog(@"%s",__func__); + NSPoint actionPoint = [s lastActionCoords]; + //NSPointLog(@"\t\tactionPoint is",actionPoint); + NSRect bounds = [s rect]; + //NSRectLog(@"\t\tbounds are",bounds); + OSSpinLockLock(&bufferLock); + VVBuffer *clickBuffer = (buffer==nil) ? nil : [buffer retain]; + OSSpinLockUnlock(&bufferLock); + NSRect clickBufferSrcRect = [clickBuffer srcRect]; + //NSRectLog(@"\t\tclickBufferSrcRect is",clickBufferSrcRect); + + NSRect bufferFrameInBounds = [VVSizingTool + rectThatFitsRect:clickBufferSrcRect + inRect:bounds + sizingMode:VVSizingModeFit]; + //NSRectLog(@"\t\tbufferFrameInBounds is",bufferFrameInBounds); + NSPoint actionPointInBufferFrame = NSMakePoint(actionPoint.x-VVMINX(bufferFrameInBounds), actionPoint.y-VVMINY(bufferFrameInBounds)); + //NSPointLog(@"\t\tactionPointInBufferFrame is",actionPointInBufferFrame); + // calculate the normalized click loc within the frame + NSPoint normalizedClickLoc = NSMakePoint(actionPointInBufferFrame.x/bufferFrameInBounds.size.width, actionPointInBufferFrame.y/bufferFrameInBounds.size.height); + + //NSPoint bufferCoordsClickLoc = NSMakePoint(normalizedClickLoc.x*clickBufferSrcRect.size.width, normalizedClickLoc.y*clickBufferSrcRect.size.height); + //NSPointLog(@"\t\tpassing",actionPointInBufferFrame); + + //[controller passNormalizedMouseClickToPoints:bufferCoordsClickLoc]; + [controller passNormalizedMouseClickToPoints:normalizedClickLoc]; + + VVRELEASE(clickBuffer); +} + + +@end diff --git a/ISF Editor/MovieFileVideoSource.h b/ISF Editor/MovieFileVideoSource.h new file mode 100644 index 00000000..2117f36b --- /dev/null +++ b/ISF Editor/MovieFileVideoSource.h @@ -0,0 +1,17 @@ +#import +#import +#import +#import "VideoSource.h" + + + + +@interface MovieFileVideoSource : VideoSource { + AVPlayer *propPlayer; + AVPlayerItem *propItem; + AVPlayerItemVideoOutput *propOutput; +} + +- (void) loadFileAtPath:(NSString *)p; + +@end diff --git a/ISF Editor/MovieFileVideoSource.m b/ISF Editor/MovieFileVideoSource.m new file mode 100644 index 00000000..84bf0a51 --- /dev/null +++ b/ISF Editor/MovieFileVideoSource.m @@ -0,0 +1,171 @@ +#import "MovieFileVideoSource.h" +#import + + + + +@implementation MovieFileVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + propPlayer = [[AVPlayer alloc] initWithPlayerItem:nil]; + [propPlayer setActionAtItemEnd:AVPlayerActionAtItemEndPause]; + propItem = nil; + propOutput = nil; + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [super prepareToBeDeleted]; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + OSSpinLockLock(&propLock); + VVRELEASE(propPlayer); + VVRELEASE(propItem); + VVRELEASE(propOutput); + OSSpinLockUnlock(&propLock); + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (void) loadFileAtPath:(NSString *)p { + NSLog(@"%s ... %@",__func__,p); + [self stop]; + + // make an AVPlayerItem for the passed file + NSURL *newURL = (p==nil) ? nil : [NSURL fileURLWithPath:p]; + AVAsset *newAsset = (newURL==nil) ? nil : [AVAsset assetWithURL:newURL]; + AVPlayerItem *newItem = (newAsset==nil) ? nil : [[AVPlayerItem alloc] initWithAsset:newAsset]; + // if i couldn't make an item from the passed path, send an error back through the conn and then bail + if (newItem == nil) { + NSLog(@"\t\terr: couldn't create asset from path %@, %s",p,__func__); + return; + } + + // now lock and load the AVPlayerItem + OSSpinLockLock(&propLock); + // make sure that an output exists (create one if it doesn't) + if (propOutput == nil) { + NSDictionary *pba = [NSDictionary dictionaryWithObjectsAndKeys: + NUMINT(kCVPixelFormatType_422YpCbCr8), kCVPixelBufferPixelFormatTypeKey, + //NUMINT(kCVPixelFormatType_32BGRA), kCVPixelBufferPixelFormatTypeKey, + //NUMBOOL(YES), kCVPixelBufferIOSurfaceOpenGLFBOCompatibilityKey, + //NUMBOOL(YES), kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, + nil]; + propOutput = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:pba]; + } + + [propItem release]; + propItem = newItem; + [propItem addOutput:propOutput]; + // tell the player to actually load the item + if ([NSThread isMainThread]) { + [propPlayer replaceCurrentItemWithPlayerItem:newItem]; + // begin playback + [propPlayer setRate:1.0]; + } + else { + dispatch_sync(dispatch_get_main_queue(), ^{ + NSLog(@"\t\treplacing the item in the player"); + OSSpinLockLock(&propLock); + [propPlayer replaceCurrentItemWithPlayerItem:propItem]; + // begin playback + [propPlayer setRate:1.0]; + OSSpinLockUnlock(&propLock); + }); + } + //CMTime durationCMTime = [item duration]; + //durationInSeconds = CMTimeGetSeconds(durationCMTime); + // register to receive "played to end" notifications on the new item + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidPlayToEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:propItem]; + + OSSpinLockUnlock(&propLock); + + [self start]; +} +- (void) stop { + // remove myself for "played to end" notifications + OSSpinLockLock(&propLock); + id localPropItem = (propItem==nil) ? nil : [propItem retain]; + OSSpinLockUnlock(&propLock); + if (localPropItem != nil) { + [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:localPropItem]; + if ([NSThread isMainThread]) { + OSSpinLockLock(&propLock); + [propPlayer replaceCurrentItemWithPlayerItem:nil]; + OSSpinLockUnlock(&propLock); + } + else { + dispatch_sync(dispatch_get_main_queue(), ^{ + OSSpinLockLock(&propLock); + [propPlayer replaceCurrentItemWithPlayerItem:nil]; + OSSpinLockUnlock(&propLock); + }); + } + + OSSpinLockLock(&propLock); + if (propOutput != nil) + [propItem removeOutput:propOutput]; + OSSpinLockUnlock(&propLock); + + [localPropItem release]; + localPropItem = nil; + } + + [super stop]; +} +- (VVBuffer *) allocBuffer { + VVBuffer *returnMe = nil; + OSSpinLockLock(&propLock); + + + CMTime frameMachTime = [propOutput itemTimeForMachAbsoluteTime:mach_absolute_time()]; + if ([propOutput hasNewPixelBufferForItemTime:frameMachTime]) { + //NSLog(@"\t\toutput has new pixel buffer"); + CMTime frameDisplayTime = kCMTimeZero; + CVPixelBufferRef pb = [propOutput copyPixelBufferForItemTime:frameMachTime itemTimeForDisplay:&frameDisplayTime]; + if (pb != NULL) { + // make a new buffer from the CVPixelBuffer, then release the CVPixelBuffer + returnMe = [_globalVVBufferPool allocBufferForCVPixelBuffer:pb texRange:YES ioSurface:NO]; + [returnMe setFlipped:YES]; + [VVBufferPool pushTexRangeBufferRAMtoVRAM:returnMe usingContext:[_globalVVBufferPool CGLContextObj]]; + CVPixelBufferRelease(pb); + pb = NULL; + } + else { + //NSLog(@"\t\terr: couldn't copy pixel buffer, %s",__func__); + } + } + else { + //NSLog(@"\t\toutput does NOT have a new pixel buffer"); + } + + + OSSpinLockUnlock(&propLock); + return returnMe; +} +- (void) itemDidPlayToEnd:(NSNotification *)note { + NSLog(@"%s",__func__); + OSSpinLockLock(&propLock); + [propPlayer seekToTime:kCMTimeZero]; + [propPlayer play]; + OSSpinLockUnlock(&propLock); +} + + +@end diff --git a/ISF Editor/NSColorAdditions.h b/ISF Editor/NSColorAdditions.h new file mode 100644 index 00000000..25df0790 --- /dev/null +++ b/ISF Editor/NSColorAdditions.h @@ -0,0 +1,12 @@ +#import +//#import "Macros.h" + + + + +@interface NSColor (NSColorAdditions) + +- (void) getDevRGBComponents:(CGFloat *)components; ++ (NSColor *) devColorFromValArray:(NSArray *)n; + +@end diff --git a/ISF Editor/NSColorAdditions.m b/ISF Editor/NSColorAdditions.m new file mode 100644 index 00000000..11707ddf --- /dev/null +++ b/ISF Editor/NSColorAdditions.m @@ -0,0 +1,45 @@ +#import "NSColorAdditions.h" + + + + +@implementation NSColor (NSColorAdditions) + + +- (void) getDevRGBComponents:(CGFloat *)components { + if (components == nil) + return; + NSColor *devColor = nil; + NSColorSpace *devCS = [NSColorSpace deviceRGBColorSpace]; + devColor = ([self colorSpace]==devCS) ? self : [self colorUsingColorSpaceName:NSDeviceRGBColorSpace]; + if (devColor != nil) + [devColor getComponents:components]; +} ++ (NSColor *) devColorFromValArray:(NSArray *)n { + if (n==nil) + return nil; + NSInteger maxValIndex = [n count] - 1; + if (maxValIndex<3 || maxValIndex>4) + return nil; + double valArray[] = {1., 1., 1., 1.}; + NSNumber *tmpNum = nil; + for (int i=0; i<4; ++i) { + if (i <= maxValIndex) { + tmpNum = [n objectAtIndex:i]; + if (tmpNum != nil) { + if ([tmpNum isKindOfClass:[NSNumber class]]) + valArray[i] = [tmpNum doubleValue]; + else + valArray[i] = 1.; + } + else + valArray[i] = 1.; + } + else + valArray[i] = 1.; + } + return [NSColor colorWithDeviceRed:valArray[0] green:valArray[1] blue:valArray[2] alpha:valArray[3]]; +} + + +@end diff --git a/ISF Editor/NSColorWellNonContinuous.h b/ISF Editor/NSColorWellNonContinuous.h new file mode 100644 index 00000000..4bf44231 --- /dev/null +++ b/ISF Editor/NSColorWellNonContinuous.h @@ -0,0 +1,6 @@ +#import +#import + +@interface NSColorWellNonContinuous : NSColorWell + +@end diff --git a/ISF Editor/NSColorWellNonContinuous.m b/ISF Editor/NSColorWellNonContinuous.m new file mode 100644 index 00000000..f88af0e8 --- /dev/null +++ b/ISF Editor/NSColorWellNonContinuous.m @@ -0,0 +1,12 @@ +#import "NSColorWellNonContinuous.h" + +@implementation NSColorWellNonContinuous + +- (void) deactivate { + //NSLog(@"%s",__func__); + [super deactivate]; + if (![self isContinuous] && [self target]!=nil) + [self sendAction:[self action] to:[self target]]; +} + +@end diff --git a/ISF Editor/NSPopUpButtonAdditions.h b/ISF Editor/NSPopUpButtonAdditions.h new file mode 100644 index 00000000..32cf6692 --- /dev/null +++ b/ISF Editor/NSPopUpButtonAdditions.h @@ -0,0 +1,15 @@ +// +// NSPopUpButtonAdditions.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 1/13/14. +// Copyright (c) 2014 zoidberg. All rights reserved. +// + +#import + +@interface NSPopUpButton (NSPopUpButtonAdditions) + +- (NSMenuItem *) addAndReturnItemWithTitle:(NSString *)t; + +@end diff --git a/ISF Editor/NSPopUpButtonAdditions.m b/ISF Editor/NSPopUpButtonAdditions.m new file mode 100644 index 00000000..fbd851c8 --- /dev/null +++ b/ISF Editor/NSPopUpButtonAdditions.m @@ -0,0 +1,30 @@ +// +// NSPopUpButtonAdditions.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 1/13/14. +// Copyright (c) 2014 zoidberg. All rights reserved. +// + +#import "NSPopUpButtonAdditions.h" + + + + +@implementation NSPopUpButton (NSPopUpButtonAdditions) + + +- (NSMenuItem *) addAndReturnItemWithTitle:(NSString *)t { + NSMenu *myMenu = [self menu]; + if (myMenu == nil) + return nil; + NSMenuItem *returnMe = [[NSMenuItem alloc] initWithTitle:(t==nil)?@"":t action:nil keyEquivalent:@""]; + if (returnMe == nil) + return nil; + [myMenu addItem:returnMe]; + [returnMe release]; + return returnMe; +} + + +@end diff --git a/ISF Editor/NSProgressIndicatorAdditions.h b/ISF Editor/NSProgressIndicatorAdditions.h new file mode 100644 index 00000000..a33d4286 --- /dev/null +++ b/ISF Editor/NSProgressIndicatorAdditions.h @@ -0,0 +1,18 @@ +// +// NSProgressIndicatorAdditions.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 1/20/14. +// Copyright (c) 2014 zoidberg. All rights reserved. +// + +#import + + + + +@interface NSProgressIndicator (NSProgressIndicatorAdditions) + +- (void) setNSNumberValue:(NSNumber *)n; + +@end diff --git a/ISF Editor/NSProgressIndicatorAdditions.m b/ISF Editor/NSProgressIndicatorAdditions.m new file mode 100644 index 00000000..58171256 --- /dev/null +++ b/ISF Editor/NSProgressIndicatorAdditions.m @@ -0,0 +1,25 @@ +// +// NSProgressIndicatorAdditions.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 1/20/14. +// Copyright (c) 2014 zoidberg. All rights reserved. +// + +#import "NSProgressIndicatorAdditions.h" + + + + +@implementation NSProgressIndicator (NSProgressIndicatorAdditions) + + +- (void) setNSNumberValue:(NSNumber *)n { + //NSLog(@"%s ... %@",__func__,n); + if (n==nil) + return; + [self setDoubleValue:[n doubleValue]]; +} + + +@end diff --git a/ISF Editor/NSValueAdditions.h b/ISF Editor/NSValueAdditions.h new file mode 100644 index 00000000..c8d2e4e1 --- /dev/null +++ b/ISF Editor/NSValueAdditions.h @@ -0,0 +1,12 @@ +#import + + + + +@interface NSValue (NSValueAdditions) + + ++ (NSValue *) pointValueFromValArray:(NSArray *)n; + + +@end diff --git a/ISF Editor/NSValueAdditions.m b/ISF Editor/NSValueAdditions.m new file mode 100644 index 00000000..67d48442 --- /dev/null +++ b/ISF Editor/NSValueAdditions.m @@ -0,0 +1,29 @@ +#import "NSValueAdditions.h" + + + + +@implementation NSValue (NSValueAdditions) + + ++ (NSValue *) pointValueFromValArray:(NSArray *)n { + if (n==nil) + return nil; + NSInteger valCount = [n count]; + if (valCount != 2) + return nil; + NSPoint pointVal = NSMakePoint(0., 0.); + NSNumber *tmpNum = nil; + tmpNum = [n objectAtIndex:0]; + if (tmpNum==nil || ![tmpNum isKindOfClass:[NSNumber class]]) + return nil; + pointVal.x = [tmpNum doubleValue]; + tmpNum = [n objectAtIndex:1]; + if (tmpNum==nil || ![tmpNum isKindOfClass:[NSNumber class]]) + return nil; + pointVal.y = [tmpNum doubleValue]; + return [NSValue valueWithPoint:pointVal]; +} + + +@end \ No newline at end of file diff --git a/ISF Editor/NewFileTemplate.txt b/ISF Editor/NewFileTemplate.txt new file mode 100644 index 00000000..b531bdcb --- /dev/null +++ b/ISF Editor/NewFileTemplate.txt @@ -0,0 +1,87 @@ +/*{ + "DESCRIPTION": "", + "CREDIT": "", + "ISFVSN": "2", + "CATEGORIES": [ + "XXX" + ], + "INPUTS": [ + { + "NAME": "inputImage", + "TYPE": "image" + }, + { + "NAME": "boolInput", + "TYPE": "bool", + "DEFAULT": 1.0 + }, + { + "NAME": "colorInput", + "TYPE": "color", + "DEFAULT": [ + 0.0, + 0.0, + 1.0, + 1.0 + ] + }, + { + "NAME": "flashInput", + "TYPE": "event" + }, + { + "NAME": "floatInput", + "TYPE": "float", + "DEFAULT": 0.5, + "MIN": 0.0, + "MAX": 1.0 + }, + { + "NAME": "longInputIsAPopUpButton", + "TYPE": "long", + "VALUES": [ + 0, + 1, + 2 + ], + "LABELS": [ + "red", + "green", + "blue" + ], + "DEFAULT": 1 + }, + { + "NAME": "pointInput", + "TYPE": "point2D", + "DEFAULT": [ + 0, + 0 + ] + } + ], + "PASSES": [ + { + "TARGET":"bufferVariableNameA", + "WIDTH": "$WIDTH/16.0", + "HEIGHT": "$HEIGHT/16.0" + }, + { + "DESCRIPTION": "this empty pass is rendered at the same rez as whatever you are running the ISF filter at- the previous step rendered an image at one-sixteenth the res, so this step ensures that the output is full-size" + } + ] + +}*/ + +void main() { + vec4 inputPixelColor; + // both of these are the same + inputPixelColor = IMG_THIS_PIXEL(inputImage); + inputPixelColor = IMG_PIXEL(inputImage, gl_FragCoord.xy); + + // both of these are also the same + inputPixelColor = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord.xy); + inputPixelColor = IMG_THIS_NORM_PIXEL(inputImage); + + gl_FragColor = inputPixelColor; +} diff --git a/ISF Editor/QCVideoSource.h b/ISF Editor/QCVideoSource.h new file mode 100644 index 00000000..3f585fc5 --- /dev/null +++ b/ISF Editor/QCVideoSource.h @@ -0,0 +1,15 @@ +#import +#import +#import "VideoSource.h" + + + + +@interface QCVideoSource : VideoSource { + NSString *propPath; // have to load the comp on the render thread... + QCGLScene *propScene; +} + +- (void) loadFileAtPath:(NSString *)p; + +@end diff --git a/ISF Editor/QCVideoSource.m b/ISF Editor/QCVideoSource.m new file mode 100644 index 00000000..1416f893 --- /dev/null +++ b/ISF Editor/QCVideoSource.m @@ -0,0 +1,86 @@ +#import "QCVideoSource.h" + + + + +@implementation QCVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + propScene = nil; + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [super prepareToBeDeleted]; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + OSSpinLockLock(&propLock); + VVRELEASE(propScene); + OSSpinLockUnlock(&propLock); + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (void) loadFileAtPath:(NSString *)p { + NSFileManager *fm = [NSFileManager defaultManager]; + if (![fm fileExistsAtPath:p]) + return; + [self stop]; + + OSSpinLockLock(&propLock); + VVRELEASE(propPath); + propPath = [p retain]; + OSSpinLockUnlock(&propLock); + + [self start]; +} +- (void) _stop { + VVRELEASE(propScene); +} +- (VVBuffer *) allocBuffer { + VVBuffer *returnMe = nil; + OSSpinLockLock(&propLock); + if (propPath != nil) { + VVRELEASE(propScene); + //propScene = [[QCGLScene alloc] initWithSharedContext:[_globalVVBufferPool sharedContext] sized:NSMakeSize(1280,720)]; + propScene = [[QCGLScene alloc] initCommonBackendSceneSized:NSMakeSize(1280,720)]; + [propScene useFile:propPath]; + VVRELEASE(propPath); + } + returnMe = (propScene==nil) ? nil : [propScene allocAndRenderABuffer]; + OSSpinLockUnlock(&propLock); + return returnMe; +} +- (NSArray *) arrayOfSourceMenuItems { + NSMutableArray *returnMe = MUTARRAY; + NSArray *fileNames = @[@"Cube Array", @"Blue"]; + NSBundle *mb = [NSBundle mainBundle]; + for (NSString *fileName in fileNames) { + NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:fileName action:nil keyEquivalent:@""]; + NSString *filePath = [mb pathForResource:fileName ofType:@"qtz"]; + NSURL *fileURL = [NSURL fileURLWithPath:filePath]; + [newItem setRepresentedObject:fileURL]; + [returnMe addObject:newItem]; + [newItem release]; + } + return returnMe; +} + + +@end diff --git a/ISF Editor/RegexKitLite.h b/ISF Editor/RegexKitLite.h new file mode 100644 index 00000000..d467702f --- /dev/null +++ b/ISF Editor/RegexKitLite.h @@ -0,0 +1,295 @@ +// +// RegexKitLite.h +// http://regexkit.sourceforge.net/ +// Licensed under the terms of the BSD License, as specified below. +// + +/* + Copyright (c) 2008-2010, John Engelhart + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the Zang Industries nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef __OBJC__ +#import +#import +#import +#import +#import +#endif // __OBJC__ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef REGEXKITLITE_VERSION_DEFINED +#define REGEXKITLITE_VERSION_DEFINED + +#define _RKL__STRINGIFY(b) #b +#define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a) +#define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b) +#define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b) + +#define REGEXKITLITE_VERSION_MAJOR 4 +#define REGEXKITLITE_VERSION_MINOR 0 + +#define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR) +#define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING + +#endif // REGEXKITLITE_VERSION_DEFINED + +#if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1) +#define RKL_BLOCKS 1 +#endif + +#if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) +#define _RKL_BLOCKS_ENABLED 1 +#endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) + +#if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) +#warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors. +#endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) + +// For Mac OS X < 10.5. +#ifndef NSINTEGER_DEFINED +#define NSINTEGER_DEFINED +#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) +typedef long NSInteger; +typedef unsigned long NSUInteger; +#define NSIntegerMin LONG_MIN +#define NSIntegerMax LONG_MAX +#define NSUIntegerMax ULONG_MAX +#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) +typedef int NSInteger; +typedef unsigned int NSUInteger; +#define NSIntegerMin INT_MIN +#define NSIntegerMax INT_MAX +#define NSUIntegerMax UINT_MAX +#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) +#endif // NSINTEGER_DEFINED + +#ifndef RKLREGEXOPTIONS_DEFINED +#define RKLREGEXOPTIONS_DEFINED + +// These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html +enum { + RKLNoOptions = 0, + RKLCaseless = 2, + RKLComments = 4, + RKLDotAll = 32, + RKLMultiline = 8, + RKLUnicodeWordBoundaries = 256 +}; +typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type. + +#endif // RKLREGEXOPTIONS_DEFINED + +#ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED +#define RKLREGEXENUMERATIONOPTIONS_DEFINED + +enum { + RKLRegexEnumerationNoOptions = 0UL, + RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9, + RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10, + RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11, +}; +typedef NSUInteger RKLRegexEnumerationOptions; + +#endif // RKLREGEXENUMERATIONOPTIONS_DEFINED + +#ifndef _REGEXKITLITE_H_ +#define _REGEXKITLITE_H_ + +#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465) +#define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#else +#define RKL_DEPRECATED_ATTRIBUTE +#endif + +#if defined(NS_REQUIRES_NIL_TERMINATION) +#define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION +#else // defined(NS_REQUIRES_NIL_TERMINATION) +#define RKL_REQUIRES_NIL_TERMINATION +#endif // defined(NS_REQUIRES_NIL_TERMINATION) + +// This requires a few levels of rewriting to get the desired results. +#define _RKL_CONCAT_2(c,d) c ## d +#define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b) + +#ifdef RKL_PREPEND_TO_METHODS +#define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x) +#else // RKL_PREPEND_TO_METHODS +#define RKL_METHOD_PREPEND(x) x +#endif // RKL_PREPEND_TO_METHODS + +// If it looks like low memory notifications might be available, add code to register and respond to them. +// This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for, +// UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym(). +#if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0)) +#define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1 +#endif + +#ifdef __OBJC__ + +// NSException exception name. +extern NSString * const RKLICURegexException; + +// NSError error domains and user info keys. +extern NSString * const RKLICURegexErrorDomain; + +extern NSString * const RKLICURegexEnumerationOptionsErrorKey; +extern NSString * const RKLICURegexErrorCodeErrorKey; +extern NSString * const RKLICURegexErrorNameErrorKey; +extern NSString * const RKLICURegexLineErrorKey; +extern NSString * const RKLICURegexOffsetErrorKey; +extern NSString * const RKLICURegexPreContextErrorKey; +extern NSString * const RKLICURegexPostContextErrorKey; +extern NSString * const RKLICURegexRegexErrorKey; +extern NSString * const RKLICURegexRegexOptionsErrorKey; +extern NSString * const RKLICURegexReplacedCountErrorKey; +extern NSString * const RKLICURegexReplacedStringErrorKey; +extern NSString * const RKLICURegexReplacementStringErrorKey; +extern NSString * const RKLICURegexSubjectRangeErrorKey; +extern NSString * const RKLICURegexSubjectStringErrorKey; + +@interface NSString (RegexKitLiteAdditions) + ++ (void)RKL_METHOD_PREPEND(clearStringCache); + +// Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857. ++ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE; ++ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE; + +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex; +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range; +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; + +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex; +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range; +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error; + +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex; +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture; +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range; +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; + +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex; +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture; +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range; +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; + + //// >= 3.0 + +- (NSInteger)RKL_METHOD_PREPEND(captureCount); +- (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error; + +- (BOOL)RKL_METHOD_PREPEND(isRegexValid); +- (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error; + +- (void)RKL_METHOD_PREPEND(flushCachedRegexData); + +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex; +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture; +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range; +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; + + +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex; +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex; +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; + + //// >= 4.0 + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; + +#ifdef _RKL_BLOCKS_ENABLED + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; + +#endif // _RKL_BLOCKS_ENABLED + +@end + +@interface NSMutableString (RegexKitLiteAdditions) + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; + + //// >= 4.0 + +#ifdef _RKL_BLOCKS_ENABLED + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; + +#endif // _RKL_BLOCKS_ENABLED + +@end + +#endif // __OBJC__ + +#endif // _REGEXKITLITE_H_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/ISF Editor/RegexKitLite.m b/ISF Editor/RegexKitLite.m new file mode 100644 index 00000000..dababa6a --- /dev/null +++ b/ISF Editor/RegexKitLite.m @@ -0,0 +1,2636 @@ +// +// RegexKitLite.m +// http://regexkit.sourceforge.net/ +// Licensed under the terms of the BSD License, as specified below. +// + +/* + Copyright (c) 2008-2010, John Engelhart + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the Zang Industries nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#import +#import +#import +#import +#import +#import +#ifdef __OBJC_GC__ +#import +#define RKL_STRONG_REF __strong +#define RKL_GC_VOLATILE volatile +#else // __OBJC_GC__ +#define RKL_STRONG_REF +#define RKL_GC_VOLATILE +#endif // __OBJC_GC__ + +#if (defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0)) || (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)) +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#import "RegexKitLite.h" + +// If the gcc flag -mmacosx-version-min is used with, for example, '=10.2', give a warning that the libicucore.dylib is only available on >= 10.3. +// If you are reading this comment because of this warning, this is to let you know that linking to /usr/lib/libicucore.dylib will cause your executable to fail on < 10.3. +// You will need to build your own version of the ICU library and link to that in order for RegexKitLite to work successfully on < 10.3. This is not simple. + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 +#warning The ICU dynamic shared library, /usr/lib/libicucore.dylib, is only available on Mac OS X 10.3 and later. +#warning You will need to supply a version of the ICU library to use RegexKitLite on Mac OS X 10.2 and earlier. +#endif + +//////////// +#pragma mark Compile time tunables + +#ifndef RKL_CACHE_SIZE +#define RKL_CACHE_SIZE (13UL) +#endif + +#if RKL_CACHE_SIZE < 1 +#error RKL_CACHE_SIZE must be a non-negative number greater than 0. +#endif // RKL_CACHE_SIZE < 1 + +#ifndef RKL_FIXED_LENGTH +#define RKL_FIXED_LENGTH (2048UL) +#endif + +#if RKL_FIXED_LENGTH < 1 +#error RKL_FIXED_LENGTH must be a non-negative number greater than 0. +#endif // RKL_FIXED_LENGTH < 1 + +#ifndef RKL_STACK_LIMIT +#define RKL_STACK_LIMIT (128UL * 1024UL) +#endif + +#if RKL_STACK_LIMIT < 0 +#error RKL_STACK_LIMIT must be a non-negative number. +#endif // RKL_STACK_LIMIT < 0 + +#ifdef RKL_APPEND_TO_ICU_FUNCTIONS +#define RKL_ICU_FUNCTION_APPEND(x) _RKL_CONCAT(x, RKL_APPEND_TO_ICU_FUNCTIONS) +#else // RKL_APPEND_TO_ICU_FUNCTIONS +#define RKL_ICU_FUNCTION_APPEND(x) x +#endif // RKL_APPEND_TO_ICU_FUNCTIONS + +#if defined(RKL_DTRACE) && (RKL_DTRACE != 0) +#define _RKL_DTRACE_ENABLED 1 +#endif // defined(RKL_DTRACE) && (RKL_DTRACE != 0) + +// These are internal, non-public tunables. +#define _RKL_FIXED_LENGTH ((NSUInteger)RKL_FIXED_LENGTH) +#define _RKL_STACK_LIMIT ((NSUInteger)RKL_STACK_LIMIT) +#define _RKL_SCRATCH_BUFFERS (5UL) +#if _RKL_SCRATCH_BUFFERS != 5 +#error _RKL_SCRATCH_BUFFERS is not tunable, it must be set to 5. +#endif // _RKL_SCRATCH_BUFFERS != 5 +#define _RKL_PREFETCH_SIZE (64UL) +#define _RKL_DTRACE_REGEXUTF8_SIZE (64UL) + +// A LRU Cache Set holds 4 lines, and the LRU algorithm uses 4 bits per line. +// A LRU Cache Set has a type of RKLLRUCacheSet_t and is 16 bits wide (4 lines * 4 bits per line). +// RKLLRUCacheSet_t must be initialized to a value of 0x0137 in order to work correctly. +typedef uint16_t RKLLRUCacheSet_t; +#define _RKL_LRU_CACHE_SET_INIT ((RKLLRUCacheSet_t)0x0137U) +#define _RKL_LRU_CACHE_SET_WAYS (4UL) +#if _RKL_LRU_CACHE_SET_WAYS != 4 +#error _RKL_LRU_CACHE_SET_WAYS is not tunable, it must be set to 4. +#endif // _RKL_LRU_CACHE_SET_WAYS != 4 + +#define _RKL_REGEX_LRU_CACHE_SETS ((NSUInteger)(RKL_CACHE_SIZE)) +#define _RKL_REGEX_CACHE_LINES ((NSUInteger)((NSUInteger)(_RKL_REGEX_LRU_CACHE_SETS) * (NSUInteger)(_RKL_LRU_CACHE_SET_WAYS))) + +// Regex String Lookaside Cache parameters. +#define _RKL_REGEX_LOOKASIDE_CACHE_BITS (6UL) +#if _RKL_REGEX_LOOKASIDE_CACHE_BITS < 0 +#error _RKL_REGEX_LOOKASIDE_CACHE_BITS must be a non-negative number and is not intended to be user tunable. +#endif // _RKL_REGEX_LOOKASIDE_CACHE_BITS < 0 +#define _RKL_REGEX_LOOKASIDE_CACHE_SIZE (1LU << _RKL_REGEX_LOOKASIDE_CACHE_BITS) +#define _RKL_REGEX_LOOKASIDE_CACHE_MASK ((1LU << _RKL_REGEX_LOOKASIDE_CACHE_BITS) - 1LU) +// RKLLookasideCache_t should be large enough to to hold the maximum number of cached regexes, or (RKL_CACHE_SIZE * _RKL_LRU_CACHE_SET_WAYS). +#if (RKL_CACHE_SIZE * _RKL_LRU_CACHE_SET_WAYS) <= (1 << 8) +typedef uint8_t RKLLookasideCache_t; +#elif (RKL_CACHE_SIZE * _RKL_LRU_CACHE_SET_WAYS) <= (1 << 16) +typedef uint16_t RKLLookasideCache_t; +#else // (RKL_CACHE_SIZE * _RKL_LRU_CACHE_SET_WAYS) > (1 << 16) +typedef uint32_t RKLLookasideCache_t; +#endif // (RKL_CACHE_SIZE * _RKL_LRU_CACHE_SET_WAYS) + +////////////// +#pragma mark - +#pragma mark GCC / Compiler macros + +#if defined (__GNUC__) && (__GNUC__ >= 4) +#define RKL_ATTRIBUTES(attr, ...) __attribute__((attr, ##__VA_ARGS__)) +#define RKL_EXPECTED(cond, expect) __builtin_expect((long)(cond), (expect)) +#define RKL_PREFETCH(ptr) __builtin_prefetch(ptr) +#define RKL_PREFETCH_UNICHAR(ptr, off) { const char *p = ((const char *)(ptr)) + ((off) * sizeof(UniChar)) + _RKL_PREFETCH_SIZE; RKL_PREFETCH(p); RKL_PREFETCH(p + _RKL_PREFETCH_SIZE); } +#define RKL_HAVE_CLEANUP +#define RKL_CLEANUP(func) RKL_ATTRIBUTES(cleanup(func)) +#else // defined (__GNUC__) && (__GNUC__ >= 4) +#define RKL_ATTRIBUTES(attr, ...) +#define RKL_EXPECTED(cond, expect) (cond) +#define RKL_PREFETCH(ptr) +#define RKL_PREFETCH_UNICHAR(ptr, off) +#define RKL_CLEANUP(func) +#endif // defined (__GNUC__) && (__GNUC__ >= 4) + +#define RKL_STATIC_INLINE static __inline__ RKL_ATTRIBUTES(always_inline) +#define RKL_ALIGNED(arg) RKL_ATTRIBUTES(aligned(arg)) +#define RKL_UNUSED_ARG RKL_ATTRIBUTES(unused) +#define RKL_WARN_UNUSED RKL_ATTRIBUTES(warn_unused_result) +#define RKL_WARN_UNUSED_CONST RKL_ATTRIBUTES(warn_unused_result, const) +#define RKL_WARN_UNUSED_PURE RKL_ATTRIBUTES(warn_unused_result, pure) +#define RKL_WARN_UNUSED_SENTINEL RKL_ATTRIBUTES(warn_unused_result, sentinel) +#define RKL_NONNULL_ARGS(arg, ...) RKL_ATTRIBUTES(nonnull(arg, ##__VA_ARGS__)) +#define RKL_WARN_UNUSED_NONNULL_ARGS(arg, ...) RKL_ATTRIBUTES(warn_unused_result, nonnull(arg, ##__VA_ARGS__)) +#define RKL_WARN_UNUSED_CONST_NONNULL_ARGS(arg, ...) RKL_ATTRIBUTES(warn_unused_result, const, nonnull(arg, ##__VA_ARGS__)) +#define RKL_WARN_UNUSED_PURE_NONNULL_ARGS(arg, ...) RKL_ATTRIBUTES(warn_unused_result, pure, nonnull(arg, ##__VA_ARGS__)) + +#if defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3) +#define RKL_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(as, nn, ...) RKL_ATTRIBUTES(warn_unused_result, nonnull(nn, ##__VA_ARGS__), alloc_size(as)) +#else // defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3) +#define RKL_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(as, nn, ...) RKL_ATTRIBUTES(warn_unused_result, nonnull(nn, ##__VA_ARGS__)) +#endif // defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3) + +#ifdef _RKL_DTRACE_ENABLED +#define RKL_UNUSED_DTRACE_ARG +#else // _RKL_DTRACE_ENABLED +#define RKL_UNUSED_DTRACE_ARG RKL_ATTRIBUTES(unused) +#endif // _RKL_DTRACE_ENABLED + +//////////// +#pragma mark - +#pragma mark Assertion macros + +// These macros are nearly identical to their NSCParameterAssert siblings. +// This is required because nearly everything is done while rkl_cacheSpinLock is locked. +// We need to safely unlock before throwing any of these exceptions. +// @try {} @finally {} significantly slows things down so it's not used. + +#define RKLCHardAbortAssert(c) do { int _c=(c); if(RKL_EXPECTED(!_c, 0L)) { NSLog(@"%@:%ld: Invalid parameter not satisfying: %s\n", [NSString stringWithUTF8String:__FILE__], (long)__LINE__, #c); abort(); } } while(0) +#define RKLCAssertDictionary(d, ...) rkl_makeAssertDictionary(__PRETTY_FUNCTION__, __FILE__, __LINE__, (d), ##__VA_ARGS__) +#define RKLCDelayedHardAssert(c, e, g) do { id *_e=(e); int _c=(c); if(RKL_EXPECTED(_e == NULL, 0L) || RKL_EXPECTED(*_e != NULL, 0L)) { goto g; } if(RKL_EXPECTED(!_c, 0L)) { *_e = RKLCAssertDictionary(@"Invalid parameter not satisfying: %s", #c); goto g; } } while(0) + +#ifdef NS_BLOCK_ASSERTIONS +#define RKLCAbortAssert(c) +#define RKLCDelayedAssert(c, e, g) +#define RKL_UNUSED_ASSERTION_ARG RKL_ATTRIBUTES(unused) +#else // NS_BLOCK_ASSERTIONS +#define RKLCAbortAssert(c) RKLCHardAbortAssert(c) +#define RKLCDelayedAssert(c, e, g) RKLCDelayedHardAssert(c, e, g) +#define RKL_UNUSED_ASSERTION_ARG +#endif // NS_BLOCK_ASSERTIONS + +#define RKL_EXCEPTION(e, f, ...) [NSException exceptionWithName:(e) reason:rkl_stringFromClassAndMethod((self), (_cmd), (f), ##__VA_ARGS__) userInfo:NULL] +#define RKL_RAISE_EXCEPTION(e, f, ...) [RKL_EXCEPTION(e, f, ##__VA_ARGS__) raise] + +//////////// +#pragma mark - +#pragma mark Utility functions and macros + +RKL_STATIC_INLINE BOOL NSRangeInsideRange(NSRange cin, NSRange win) RKL_WARN_UNUSED; +RKL_STATIC_INLINE BOOL NSRangeInsideRange(NSRange cin, NSRange win) { return((((cin.location - win.location) <= win.length) && ((NSMaxRange(cin) - win.location) <= win.length)) ? YES : NO); } + +#define NSMakeRange(loc, len) ((NSRange){.location=(NSUInteger)(loc), .length=(NSUInteger)(len)}) +#define CFMakeRange(loc, len) ((CFRange){.location= (CFIndex)(loc), .length= (CFIndex)(len)}) +#define NSNotFoundRange ((NSRange){.location=(NSUInteger)NSNotFound, .length= 0UL}) +#define NSMaxiumRange ((NSRange){.location= 0UL, .length= NSUIntegerMax}) +// These values are used to help tickle improper usage. +#define RKLIllegalRange ((NSRange){.location= NSIntegerMax, .length= NSIntegerMax}) +#define RKLIllegalPointer ((void * RKL_GC_VOLATILE)0xBAD0C0DE) + +//////////// +#pragma mark - +#pragma mark Exported NSString symbols for exception names, error domains, error keys, etc + +NSString * const RKLICURegexException = @"RKLICURegexException"; + +NSString * const RKLICURegexErrorDomain = @"RKLICURegexErrorDomain"; + +NSString * const RKLICURegexEnumerationOptionsErrorKey = @"RKLICURegexEnumerationOptions"; +NSString * const RKLICURegexErrorCodeErrorKey = @"RKLICURegexErrorCode"; +NSString * const RKLICURegexErrorNameErrorKey = @"RKLICURegexErrorName"; +NSString * const RKLICURegexLineErrorKey = @"RKLICURegexLine"; +NSString * const RKLICURegexOffsetErrorKey = @"RKLICURegexOffset"; +NSString * const RKLICURegexPreContextErrorKey = @"RKLICURegexPreContext"; +NSString * const RKLICURegexPostContextErrorKey = @"RKLICURegexPostContext"; +NSString * const RKLICURegexRegexErrorKey = @"RKLICURegexRegex"; +NSString * const RKLICURegexRegexOptionsErrorKey = @"RKLICURegexRegexOptions"; +NSString * const RKLICURegexReplacedCountErrorKey = @"RKLICURegexReplacedCount"; +NSString * const RKLICURegexReplacedStringErrorKey = @"RKLICURegexReplacedString"; +NSString * const RKLICURegexReplacementStringErrorKey = @"RKLICURegexReplacementString"; +NSString * const RKLICURegexSubjectRangeErrorKey = @"RKLICURegexSubjectRange"; +NSString * const RKLICURegexSubjectStringErrorKey = @"RKLICURegexSubjectString"; + +// Used internally by rkl_userInfoDictionary to specify which arguments should be set in the NSError userInfo dictionary. +enum { + RKLUserInfoNone = 0UL, + RKLUserInfoSubjectRange = 1UL << 0, + RKLUserInfoReplacedCount = 1UL << 1, + RKLUserInfoRegexEnumerationOptions = 1UL << 2, +}; +typedef NSUInteger RKLUserInfoOptions; + +//////////// +#pragma mark - +#pragma mark Type / struct definitions + +// In general, the ICU bits and pieces here must exactly match the definition in the ICU sources. + +#define U_STRING_NOT_TERMINATED_WARNING -124 +#define U_ZERO_ERROR 0 +#define U_INDEX_OUTOFBOUNDS_ERROR 8 +#define U_BUFFER_OVERFLOW_ERROR 15 +#define U_PARSE_CONTEXT_LEN 16 + +typedef struct uregex uregex; // Opaque ICU regex type. + +typedef struct UParseError { // This must be exactly the same as the 'real' ICU declaration. + int32_t line; + int32_t offset; + UniChar preContext[U_PARSE_CONTEXT_LEN]; + UniChar postContext[U_PARSE_CONTEXT_LEN]; +} UParseError; + +// For use with GCC's cleanup() __attribute__. +enum { + RKLLockedCacheSpinLock = 1UL << 0, + RKLUnlockedCacheSpinLock = 1UL << 1, +}; + +enum { + RKLSplitOp = 1UL, + RKLReplaceOp = 2UL, + RKLRangeOp = 3UL, + RKLArrayOfStringsOp = 4UL, + RKLArrayOfCapturesOp = 5UL, + RKLCapturesArrayOp = 6UL, + RKLDictionaryOfCapturesOp = 7UL, + RKLArrayOfDictionariesOfCapturesOp = 8UL, + RKLMaskOp = 0xFUL, + RKLReplaceMutable = 1UL << 4, + RKLSubcapturesArray = 1UL << 5, +}; +typedef NSUInteger RKLRegexOp; + +enum { + RKLBlockEnumerationMatchOp = 1UL, + RKLBlockEnumerationReplaceOp = 2UL, +}; +typedef NSUInteger RKLBlockEnumerationOp; + +typedef struct { + RKL_STRONG_REF NSRange * RKL_GC_VOLATILE ranges; + NSRange findInRange, remainingRange; + NSInteger capacity, found, findUpTo, capture, addedSplitRanges; + size_t size, stackUsed; + RKL_STRONG_REF void ** RKL_GC_VOLATILE rangesScratchBuffer; + RKL_STRONG_REF void ** RKL_GC_VOLATILE stringsScratchBuffer; + RKL_STRONG_REF void ** RKL_GC_VOLATILE arraysScratchBuffer; + RKL_STRONG_REF void ** RKL_GC_VOLATILE dictionariesScratchBuffer; + RKL_STRONG_REF void ** RKL_GC_VOLATILE keysScratchBuffer; +} RKLFindAll; + +typedef struct { + CFStringRef string; + CFHashCode hash; + CFIndex length; + RKL_STRONG_REF UniChar * RKL_GC_VOLATILE uniChar; +} RKLBuffer; + +typedef struct { + CFStringRef regexString; + CFHashCode regexHash; + RKLRegexOptions options; + uregex *icu_regex; + NSInteger captureCount; + + CFStringRef setToString; + CFHashCode setToHash; + CFIndex setToLength; + NSUInteger setToIsImmutable:1; + NSUInteger setToNeedsConversion:1; + RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE setToUniChar; + NSRange setToRange, lastFindRange, lastMatchRange; + + RKLBuffer *buffer; +} RKLCachedRegex; + +//////////// +#pragma mark - +#pragma mark Translation unit scope global variables + +static RKLLRUCacheSet_t rkl_lruFixedBufferCacheSet = _RKL_LRU_CACHE_SET_INIT, rkl_lruDynamicBufferCacheSet = _RKL_LRU_CACHE_SET_INIT; +static RKLBuffer rkl_lruDynamicBuffer[_RKL_LRU_CACHE_SET_WAYS]; +static UniChar rkl_lruFixedUniChar[_RKL_LRU_CACHE_SET_WAYS][_RKL_FIXED_LENGTH]; // This is the fixed sized UTF-16 conversion buffer. +static RKLBuffer rkl_lruFixedBuffer[_RKL_LRU_CACHE_SET_WAYS] = {{NULL, 0UL, 0L, &rkl_lruFixedUniChar[0][0]}, {NULL, 0UL, 0L, &rkl_lruFixedUniChar[1][0]}, {NULL, 0UL, 0L, &rkl_lruFixedUniChar[2][0]}, {NULL, 0UL, 0L, &rkl_lruFixedUniChar[3][0]}}; +static RKLCachedRegex rkl_cachedRegexes[_RKL_REGEX_CACHE_LINES]; +#if defined(__GNUC__) && (__GNUC__ == 4) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ == 2) +static RKLCachedRegex * volatile rkl_lastCachedRegex; // XXX This is a work around for what appears to be a optimizer code generation bug in GCC 4.2. +#else +static RKLCachedRegex *rkl_lastCachedRegex; +#endif // defined(__GNUC__) && (__GNUC__ == 4) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ == 2) +static RKLLRUCacheSet_t rkl_cachedRegexCacheSets[_RKL_REGEX_LRU_CACHE_SETS] = { [0 ... (_RKL_REGEX_LRU_CACHE_SETS - 1UL)] = _RKL_LRU_CACHE_SET_INIT }; +static RKLLookasideCache_t rkl_regexLookasideCache[_RKL_REGEX_LOOKASIDE_CACHE_SIZE] RKL_ALIGNED(64); +static OSSpinLock rkl_cacheSpinLock = OS_SPINLOCK_INIT; +static const UniChar rkl_emptyUniCharString[1]; // For safety, icu_regexes are 'set' to this when the string they were searched is cleared. +static RKL_STRONG_REF void * RKL_GC_VOLATILE rkl_scratchBuffer[_RKL_SCRATCH_BUFFERS]; // Used to hold temporary allocations that are allocated via reallocf(). + +//////////// +#pragma mark - +#pragma mark CFArray and CFDictionary call backs + +// These are used when running under manual memory management for the array that rkl_splitArray creates. +// The split strings are created, but not autoreleased. The (immutable) array is created using these callbacks, which skips the CFRetain() call, effectively transferring ownership to the CFArray object. +// For each split string this saves the overhead of an autorelease, then an array retain, then an NSAutoreleasePool release. This is good for a ~30% speed increase. + +static void rkl_CFCallbackRelease(CFAllocatorRef allocator RKL_UNUSED_ARG, const void *ptr) { CFRelease((CFTypeRef)ptr); } +static const CFArrayCallBacks rkl_transferOwnershipArrayCallBacks = { (CFIndex)0L, NULL, rkl_CFCallbackRelease, CFCopyDescription, CFEqual }; +static const CFDictionaryKeyCallBacks rkl_transferOwnershipDictionaryKeyCallBacks = { (CFIndex)0L, NULL, rkl_CFCallbackRelease, CFCopyDescription, CFEqual, CFHash }; +static const CFDictionaryValueCallBacks rkl_transferOwnershipDictionaryValueCallBacks = { (CFIndex)0L, NULL, rkl_CFCallbackRelease, CFCopyDescription, CFEqual }; + +#ifdef __OBJC_GC__ +//////////// +#pragma mark - +#pragma mark Low-level Garbage Collection aware memory/resource allocation utilities +// If compiled with Garbage Collection, we need to be able to do a few things slightly differently. +// The basic premiss is that under GC we use a trampoline function pointer which is set to a _start function to catch the first invocation. +// The _start function checks if GC is running and then overwrites the function pointer with the appropriate routine. Think of it as 'lazy linking'. + +enum { RKLScannedOption = NSScannedOption }; + +// rkl_collectingEnabled uses objc_getClass() to get the NSGarbageCollector class, which doesn't exist on earlier systems. +// This allows for graceful failure should we find ourselves running on an earlier version of the OS without NSGarbageCollector. +static BOOL rkl_collectingEnabled_first (void); +static BOOL rkl_collectingEnabled_yes (void) { return(YES); } +static BOOL rkl_collectingEnabled_no (void) { return(NO); } +static BOOL(*rkl_collectingEnabled) (void) = rkl_collectingEnabled_first; +static BOOL rkl_collectingEnabled_first (void) { + BOOL gcEnabled = ([objc_getClass("NSGarbageCollector") defaultCollector] != NULL) ? YES : NO; + if(gcEnabled == YES) { + // This section of code is required due to what I consider to be a fundamental design flaw in Cocoas GC system. + // Earlier versions of "Garbage Collection Programming Guide" stated that (paraphrased) "all globals are automatically roots". + // Current versions of the guide now include the following warning: + // "You may pass addresses of strong globals or statics into routines expecting pointers to object pointers (such as id* or NSError**) + // only if they have first been assigned to directly, rather than through a pointer dereference." + // This is a surprisingly non-trivial condition to actually meet in practice and is a recipe for impossible to debug race condition bugs. + // We just happen to be very, very, very lucky in the fact that we can initialize our root set before the first use. + NSUInteger x = 0UL; + for(x = 0UL; x < _RKL_SCRATCH_BUFFERS; x++) { rkl_scratchBuffer[x] = NSAllocateCollectable(16UL, 0UL); rkl_scratchBuffer[x] = NULL; } + for(x = 0UL; x < _RKL_LRU_CACHE_SET_WAYS; x++) { rkl_lruDynamicBuffer[x].uniChar = NSAllocateCollectable(16UL, 0UL); rkl_lruDynamicBuffer[x].uniChar = NULL; } + } + return((rkl_collectingEnabled = (gcEnabled == YES) ? rkl_collectingEnabled_yes : rkl_collectingEnabled_no)()); +} + +// rkl_realloc() +static void *rkl_realloc_first (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr, size_t size, NSUInteger flags); +static void *rkl_realloc_std (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr, size_t size, NSUInteger flags RKL_UNUSED_ARG) { return((*ptr = reallocf(*ptr, size))); } +static void *rkl_realloc_gc (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr, size_t size, NSUInteger flags) { return((*ptr = NSReallocateCollectable(*ptr, (NSUInteger)size, flags))); } +static void *(*rkl_realloc) (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr, size_t size, NSUInteger flags) RKL_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(2,1) = rkl_realloc_first; +static void *rkl_realloc_first (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr, size_t size, NSUInteger flags) { if(rkl_collectingEnabled()==YES) { rkl_realloc = rkl_realloc_gc; } else { rkl_realloc = rkl_realloc_std; } return(rkl_realloc(ptr, size, flags)); } + +// rkl_free() +static void * rkl_free_first (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr); +static void * rkl_free_std (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr) { if(*ptr != NULL) { free(*ptr); *ptr = NULL; } return(NULL); } +static void * rkl_free_gc (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr) { if(*ptr != NULL) { *ptr = NULL; } return(NULL); } +static void *(*rkl_free) (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr) RKL_NONNULL_ARGS(1) = rkl_free_first; +static void *rkl_free_first (RKL_STRONG_REF void ** RKL_GC_VOLATILE ptr) { if(rkl_collectingEnabled()==YES) { rkl_free = rkl_free_gc; } else { rkl_free = rkl_free_std; } return(rkl_free(ptr)); } + +// rkl_CFAutorelease() +static id rkl_CFAutorelease_first (CFTypeRef obj); +static id rkl_CFAutorelease_std (CFTypeRef obj) { return([(id)obj autorelease]); } +static id rkl_CFAutorelease_gc (CFTypeRef obj) { return(NSMakeCollectable(obj)); } +static id(*rkl_CFAutorelease) (CFTypeRef obj) = rkl_CFAutorelease_first; +static id rkl_CFAutorelease_first (CFTypeRef obj) { return((rkl_CFAutorelease = (rkl_collectingEnabled()==YES) ? rkl_CFAutorelease_gc : rkl_CFAutorelease_std)(obj)); } + +// rkl_CreateStringWithSubstring() +static id rkl_CreateStringWithSubstring_first (id string, NSRange range); +static id rkl_CreateStringWithSubstring_std (id string, NSRange range) { return((id)CFStringCreateWithSubstring(NULL, (CFStringRef)string, CFMakeRange((CFIndex)range.location, (CFIndex)range.length))); } +static id rkl_CreateStringWithSubstring_gc (id string, NSRange range) { return([string substringWithRange:range]); } +static id(*rkl_CreateStringWithSubstring) (id string, NSRange range) RKL_WARN_UNUSED_NONNULL_ARGS(1) = rkl_CreateStringWithSubstring_first; +static id rkl_CreateStringWithSubstring_first (id string, NSRange range) { return((rkl_CreateStringWithSubstring = (rkl_collectingEnabled()==YES) ? rkl_CreateStringWithSubstring_gc : rkl_CreateStringWithSubstring_std)(string, range)); } + +// rkl_ReleaseObject() +static id rkl_ReleaseObject_first (id obj); +static id rkl_ReleaseObject_std (id obj) { CFRelease((CFTypeRef)obj); return(NULL); } +static id rkl_ReleaseObject_gc (id obj RKL_UNUSED_ARG) { return(NULL); } +static id (*rkl_ReleaseObject) (id obj) RKL_NONNULL_ARGS(1) = rkl_ReleaseObject_first; +static id rkl_ReleaseObject_first (id obj) { return((rkl_ReleaseObject = (rkl_collectingEnabled()==YES) ? rkl_ReleaseObject_gc : rkl_ReleaseObject_std)(obj)); } + +// rkl_CreateArrayWithObjects() +static id rkl_CreateArrayWithObjects_first (void **objects, NSUInteger count); +static id rkl_CreateArrayWithObjects_std (void **objects, NSUInteger count) { return((id)CFArrayCreate(NULL, (const void **)objects, (CFIndex)count, &rkl_transferOwnershipArrayCallBacks)); } +static id rkl_CreateArrayWithObjects_gc (void **objects, NSUInteger count) { return([NSArray arrayWithObjects:(const id *)objects count:count]); } +static id(*rkl_CreateArrayWithObjects) (void **objects, NSUInteger count) RKL_WARN_UNUSED_NONNULL_ARGS(1) = rkl_CreateArrayWithObjects_first; +static id rkl_CreateArrayWithObjects_first (void **objects, NSUInteger count) { return((rkl_CreateArrayWithObjects = (rkl_collectingEnabled()==YES) ? rkl_CreateArrayWithObjects_gc : rkl_CreateArrayWithObjects_std)(objects, count)); } + +// rkl_CreateAutoreleasedArray() +static id rkl_CreateAutoreleasedArray_first (void **objects, NSUInteger count); +static id rkl_CreateAutoreleasedArray_std (void **objects, NSUInteger count) { return((id)rkl_CFAutorelease(rkl_CreateArrayWithObjects(objects, count))); } +static id rkl_CreateAutoreleasedArray_gc (void **objects, NSUInteger count) { return( rkl_CreateArrayWithObjects(objects, count) ); } +static id(*rkl_CreateAutoreleasedArray) (void **objects, NSUInteger count) RKL_WARN_UNUSED_NONNULL_ARGS(1) = rkl_CreateAutoreleasedArray_first; +static id rkl_CreateAutoreleasedArray_first (void **objects, NSUInteger count) { return((rkl_CreateAutoreleasedArray = (rkl_collectingEnabled()==YES) ? rkl_CreateAutoreleasedArray_gc : rkl_CreateAutoreleasedArray_std)(objects, count)); } + +#else // __OBJC_GC__ not defined +//////////// +#pragma mark - +#pragma mark Low-level explicit memory/resource allocation utilities + +enum { RKLScannedOption = 0 }; + +#define rkl_collectingEnabled() (NO) + +RKL_STATIC_INLINE void *rkl_realloc (void **ptr, size_t size, NSUInteger flags) RKL_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(2,1); +RKL_STATIC_INLINE void *rkl_free (void **ptr) RKL_NONNULL_ARGS(1); +RKL_STATIC_INLINE id rkl_CFAutorelease (CFTypeRef obj) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE id rkl_CreateAutoreleasedArray (void **objects, NSUInteger count) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE id rkl_CreateArrayWithObjects (void **objects, NSUInteger count) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE id rkl_CreateStringWithSubstring (id string, NSRange range) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE id rkl_ReleaseObject (id obj) RKL_NONNULL_ARGS(1); + +RKL_STATIC_INLINE void *rkl_realloc (void **ptr, size_t size, NSUInteger flags RKL_UNUSED_ARG) { return((*ptr = reallocf(*ptr, size))); } +RKL_STATIC_INLINE void *rkl_free (void **ptr) { if(*ptr != NULL) { free(*ptr); *ptr = NULL; } return(NULL); } +RKL_STATIC_INLINE id rkl_CFAutorelease (CFTypeRef obj) { return([(id)obj autorelease]); } +RKL_STATIC_INLINE id rkl_CreateArrayWithObjects (void **objects, NSUInteger count) { return((id)CFArrayCreate(NULL, (const void **)objects, (CFIndex)count, &rkl_transferOwnershipArrayCallBacks)); } +RKL_STATIC_INLINE id rkl_CreateAutoreleasedArray (void **objects, NSUInteger count) { return(rkl_CFAutorelease(rkl_CreateArrayWithObjects(objects, count))); } +RKL_STATIC_INLINE id rkl_CreateStringWithSubstring (id string, NSRange range) { return((id)CFStringCreateWithSubstring(NULL, (CFStringRef)string, CFMakeRange((CFIndex)range.location, (CFIndex)range.length))); } +RKL_STATIC_INLINE id rkl_ReleaseObject (id obj) { CFRelease((CFTypeRef)obj); return(NULL); } + +#endif // __OBJC_GC__ + +//////////// +#pragma mark - +#pragma mark ICU function prototypes + +// ICU functions. See http://www.icu-project.org/apiref/icu4c/uregex_8h.html Tweaked slightly from the originals, but functionally identical. +const char *RKL_ICU_FUNCTION_APPEND(u_errorName) ( int32_t status) RKL_WARN_UNUSED_PURE; +int32_t RKL_ICU_FUNCTION_APPEND(u_strlen) (const UniChar *s) RKL_WARN_UNUSED_PURE_NONNULL_ARGS(1); +int32_t RKL_ICU_FUNCTION_APPEND(uregex_appendReplacement) ( uregex *regexp, const UniChar *replacementText, int32_t replacementLength, UniChar **destBuf, int32_t *destCapacity, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4,5,6); +int32_t RKL_ICU_FUNCTION_APPEND(uregex_appendTail) ( uregex *regexp, UniChar **destBuf, int32_t *destCapacity, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,3,4); +void RKL_ICU_FUNCTION_APPEND(uregex_close) ( uregex *regexp) RKL_NONNULL_ARGS(1); +int32_t RKL_ICU_FUNCTION_APPEND(uregex_end) ( uregex *regexp, int32_t groupNum, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,3); +BOOL RKL_ICU_FUNCTION_APPEND(uregex_find) ( uregex *regexp, int32_t location, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,3); +BOOL RKL_ICU_FUNCTION_APPEND(uregex_findNext) ( uregex *regexp, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2); +int32_t RKL_ICU_FUNCTION_APPEND(uregex_groupCount) ( uregex *regexp, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2); +uregex *RKL_ICU_FUNCTION_APPEND(uregex_open) (const UniChar *pattern, int32_t patternLength, RKLRegexOptions flags, UParseError *parseError, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,4,5); +void RKL_ICU_FUNCTION_APPEND(uregex_reset) ( uregex *regexp, int32_t newIndex, int32_t *status) RKL_NONNULL_ARGS(1,3); +void RKL_ICU_FUNCTION_APPEND(uregex_setText) ( uregex *regexp, const UniChar *text, int32_t textLength, int32_t *status) RKL_NONNULL_ARGS(1,2,4); +int32_t RKL_ICU_FUNCTION_APPEND(uregex_start) ( uregex *regexp, int32_t groupNum, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,3); +uregex *RKL_ICU_FUNCTION_APPEND(uregex_clone) (const uregex *regexp, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2); + +//////////// +#pragma mark - +#pragma mark RegexKitLite internal, private function prototypes + +// Functions used for managing the 4-way set associative LRU cache and regex string hash lookaside cache. +RKL_STATIC_INLINE NSUInteger rkl_leastRecentlyUsedWayInSet ( NSUInteger cacheSetsCount, const RKLLRUCacheSet_t cacheSetsArray[cacheSetsCount], NSUInteger set) RKL_WARN_UNUSED_NONNULL_ARGS(2); +RKL_STATIC_INLINE void rkl_accessCacheSetWay ( NSUInteger cacheSetsCount, RKLLRUCacheSet_t cacheSetsArray[cacheSetsCount], NSUInteger set, NSUInteger way) RKL_NONNULL_ARGS(2); +RKL_STATIC_INLINE NSUInteger rkl_regexLookasideCacheIndexForPointerAndOptions (const void *ptr, RKLRegexOptions options) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE void rkl_setRegexLookasideCacheToCachedRegexForPointer (const RKLCachedRegex *cachedRegex, const void *ptr) RKL_NONNULL_ARGS(1,2); +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexFromRegexLookasideCacheForString (const void *ptr, RKLRegexOptions options) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE NSUInteger rkl_makeCacheSetHash ( CFHashCode regexHash, RKLRegexOptions options) RKL_WARN_UNUSED; +RKL_STATIC_INLINE NSUInteger rkl_cacheSetForRegexHashAndOptions ( CFHashCode regexHash, RKLRegexOptions options) RKL_WARN_UNUSED; +RKL_STATIC_INLINE NSUInteger rkl_cacheWayForCachedRegex (const RKLCachedRegex *cachedRegex) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE NSUInteger rkl_cacheSetForCachedRegex (const RKLCachedRegex *cachedRegex) RKL_WARN_UNUSED_NONNULL_ARGS(1); +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexForCacheSetAndWay ( NSUInteger cacheSet, NSUInteger cacheWay) RKL_WARN_UNUSED; +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexForRegexHashAndOptionsAndWay ( CFHashCode regexHash, RKLRegexOptions options, NSUInteger cacheWay) RKL_WARN_UNUSED; +RKL_STATIC_INLINE void rkl_updateCachesWithCachedRegex ( RKLCachedRegex *cachedRegex, const void *ptr, int hitOrMiss RKL_UNUSED_DTRACE_ARG, int status RKL_UNUSED_DTRACE_ARG) RKL_NONNULL_ARGS(1,2); +RKL_STATIC_INLINE RKLCachedRegex *rkl_leastRecentlyUsedCachedRegexForRegexHashAndOptions ( CFHashCode regexHash, RKLRegexOptions options) RKL_WARN_UNUSED; + +static RKLCachedRegex *rkl_getCachedRegex (NSString *regexString, RKLRegexOptions options, NSError **error, id *exception) RKL_WARN_UNUSED_NONNULL_ARGS(1,4); +static NSUInteger rkl_setCachedRegexToString (RKLCachedRegex *cachedRegex, const NSRange *range, int32_t *status, id *exception RKL_UNUSED_ASSERTION_ARG) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,3,4); +static RKLCachedRegex *rkl_getCachedRegexSetToString (NSString *regexString, RKLRegexOptions options, NSString *matchString, NSUInteger *matchLengthPtr, NSRange *matchRange, NSError **error, id *exception, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,3,4,5,7,8); +static id rkl_performDictionaryVarArgsOp(id self, SEL _cmd, RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, NSInteger capture, id matchString, NSRange *matchRange, NSString *replacementString, NSError **error, void *result, id firstKey, va_list varArgsList) RKL_NONNULL_ARGS(1,2); +static id rkl_performRegexOp (id self, SEL _cmd, RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, NSInteger capture, id matchString, NSRange *matchRange, NSString *replacementString, NSError **error, void *result, NSUInteger captureKeysCount, id captureKeys[captureKeysCount], const int captureKeyIndexes[captureKeysCount]) RKL_NONNULL_ARGS(1,2); +static void rkl_handleDelayedAssert (id self, SEL _cmd, id exception) RKL_NONNULL_ARGS(3); + +static NSUInteger rkl_search (RKLCachedRegex *cachedRegex, NSRange *searchRange, NSUInteger updateSearchRange, id *exception RKL_UNUSED_ASSERTION_ARG, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4,5); + +static BOOL rkl_findRanges (RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, id *exception, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,3,4,5); +static NSUInteger rkl_growFindRanges (RKLCachedRegex *cachedRegex, NSUInteger lastLocation, RKLFindAll *findAll, id *exception RKL_UNUSED_ASSERTION_ARG) RKL_WARN_UNUSED_NONNULL_ARGS(1,3,4); +static NSArray *rkl_makeArray (RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, id *exception RKL_UNUSED_ASSERTION_ARG) RKL_WARN_UNUSED_NONNULL_ARGS(1,3,4); +static id rkl_makeDictionary (RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, NSUInteger captureKeysCount, id captureKeys[captureKeysCount], const int captureKeyIndexes[captureKeysCount], id *exception RKL_UNUSED_ASSERTION_ARG) RKL_WARN_UNUSED_NONNULL_ARGS(1,3,5,6); + +static NSString *rkl_replaceString (RKLCachedRegex *cachedRegex, id searchString, NSUInteger searchU16Length, NSString *replacementString, NSUInteger replacementU16Length, NSInteger *replacedCount, NSUInteger replaceMutable, id *exception, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4,8,9); +static int32_t rkl_replaceAll (RKLCachedRegex *cachedRegex, RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE replacementUniChar, int32_t replacementU16Length, UniChar *replacedUniChar, int32_t replacedU16Capacity, NSInteger *replacedCount, int32_t *needU16Capacity, id *exception RKL_UNUSED_ASSERTION_ARG, int32_t *status) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4,6,7,8,9); + +static NSUInteger rkl_isRegexValid (id self, SEL _cmd, NSString *regex, RKLRegexOptions options, NSInteger *captureCountPtr, NSError **error) RKL_NONNULL_ARGS(1,2); + +static void rkl_clearStringCache (void); +static void rkl_clearBuffer (RKLBuffer *buffer, NSUInteger freeDynamicBuffer) RKL_NONNULL_ARGS(1); +static void rkl_clearCachedRegex (RKLCachedRegex *cachedRegex) RKL_NONNULL_ARGS(1); +static void rkl_clearCachedRegexSetTo (RKLCachedRegex *cachedRegex) RKL_NONNULL_ARGS(1); + +static NSDictionary *rkl_userInfoDictionary (RKLUserInfoOptions userInfoOptions, NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status, NSString *matchString, NSRange matchRange, NSString *replacementString, NSString *replacedString, NSInteger replacedCount, RKLRegexEnumerationOptions enumerationOptions, ...) RKL_WARN_UNUSED_SENTINEL; +static NSError *rkl_makeNSError (RKLUserInfoOptions userInfoOptions, NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status, NSString *matchString, NSRange matchRange, NSString *replacementString, NSString *replacedString, NSInteger replacedCount, RKLRegexEnumerationOptions enumerationOptions, NSString *errorDescription) RKL_WARN_UNUSED; + +static NSException *rkl_NSExceptionForRegex (NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status) RKL_WARN_UNUSED_NONNULL_ARGS(1); +static NSDictionary *rkl_makeAssertDictionary (const char *function, const char *file, int line, NSString *format, ...) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4); +static NSString *rkl_stringFromClassAndMethod (id object, SEL selector, NSString *format, ...) RKL_WARN_UNUSED_NONNULL_ARGS(3); + +RKL_STATIC_INLINE int32_t rkl_getRangeForCapture(RKLCachedRegex *cr, int32_t *s, int32_t c, NSRange *r) RKL_WARN_UNUSED_NONNULL_ARGS(1,2,4); +RKL_STATIC_INLINE int32_t rkl_getRangeForCapture(RKLCachedRegex *cr, int32_t *s, int32_t c, NSRange *r) { uregex *re = cr->icu_regex; int32_t start = RKL_ICU_FUNCTION_APPEND(uregex_start)(re, c, s); if(RKL_EXPECTED((*s > U_ZERO_ERROR), 0L) || (start == -1)) { *r = NSNotFoundRange; } else { r->location = (NSUInteger)start; r->length = (NSUInteger)RKL_ICU_FUNCTION_APPEND(uregex_end)(re, c, s) - r->location; r->location += cr->setToRange.location; } return(*s); } + +RKL_STATIC_INLINE RKLFindAll rkl_makeFindAll(RKL_STRONG_REF NSRange * RKL_GC_VOLATILE r, NSRange fir, NSInteger c, size_t s, size_t su, RKL_STRONG_REF void ** RKL_GC_VOLATILE rsb, RKL_STRONG_REF void ** RKL_GC_VOLATILE ssb, RKL_STRONG_REF void ** RKL_GC_VOLATILE asb, RKL_STRONG_REF void ** RKL_GC_VOLATILE dsb, RKL_STRONG_REF void ** RKL_GC_VOLATILE ksb, NSInteger f, NSInteger cap, NSInteger fut) RKL_WARN_UNUSED_CONST; +RKL_STATIC_INLINE RKLFindAll rkl_makeFindAll(RKL_STRONG_REF NSRange * RKL_GC_VOLATILE r, NSRange fir, NSInteger c, size_t s, size_t su, RKL_STRONG_REF void ** RKL_GC_VOLATILE rsb, RKL_STRONG_REF void ** RKL_GC_VOLATILE ssb, RKL_STRONG_REF void ** RKL_GC_VOLATILE asb, RKL_STRONG_REF void ** RKL_GC_VOLATILE dsb, RKL_STRONG_REF void ** RKL_GC_VOLATILE ksb, NSInteger f, NSInteger cap, NSInteger fut) { return(((RKLFindAll){ .ranges=r, .findInRange=fir, .remainingRange=fir, .capacity=c, .found=f, .findUpTo=fut, .capture=cap, .addedSplitRanges=0L, .size=s, .stackUsed=su, .rangesScratchBuffer=rsb, .stringsScratchBuffer=ssb, .arraysScratchBuffer=asb, .dictionariesScratchBuffer=dsb, .keysScratchBuffer=ksb})); } + +//////////// +#pragma mark - +#pragma mark RKL_FAST_MUTABLE_CHECK implementation + +#ifdef RKL_FAST_MUTABLE_CHECK +// We use a trampoline function pointer to check at run time if the function __CFStringIsMutable is available. +// If it is, the trampoline function pointer is replaced with the address of that function. +// Otherwise, we assume the worst case that every string is mutable. +// This hopefully helps to protect us since we're using an undocumented, non-public API call. +// We will keep on working if it ever does go away, just with a bit less performance due to the overhead of mutable checks. + +static BOOL rkl_CFStringIsMutable_first (CFStringRef str); +static BOOL rkl_CFStringIsMutable_yes (CFStringRef str RKL_UNUSED_ARG) { return(YES); } +static BOOL(*rkl_CFStringIsMutable) (CFStringRef str) = rkl_CFStringIsMutable_first; +static BOOL rkl_CFStringIsMutable_first (CFStringRef str) { if((rkl_CFStringIsMutable = (BOOL(*)(CFStringRef))dlsym(RTLD_DEFAULT, "__CFStringIsMutable")) == NULL) { rkl_CFStringIsMutable = rkl_CFStringIsMutable_yes; } return(rkl_CFStringIsMutable(str)); } +#else // RKL_FAST_MUTABLE_CHECK is not defined. Assume that all strings are potentially mutable. +#define rkl_CFStringIsMutable(s) (YES) +#endif // RKL_FAST_MUTABLE_CHECK + +//////////// +#pragma mark - +#pragma mark iPhone / iPod touch low memory notification handler + +#if defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) && (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS == 1) + +// The next few lines are specifically for the iPhone to catch low memory conditions. +// The basic idea is that rkl_RegisterForLowMemoryNotifications() is set to be run once by the linker at load time via __attribute((constructor)). +// rkl_RegisterForLowMemoryNotifications() tries to find the iPhone low memory notification symbol. If it can find it, +// it registers with the default NSNotificationCenter to call the RKLLowMemoryWarningObserver class method +lowMemoryWarning:. +// rkl_RegisterForLowMemoryNotifications() uses an atomic compare and swap to guarantee that it initializes exactly once. +// +lowMemoryWarning tries to acquire the cache lock. If it gets the lock, it clears the cache. If it can't, it calls performSelector: +// with a delay of half a second to try again. This will hopefully prevent any deadlocks, such as a RegexKitLite request for +// memory triggering a notification while the lock is held. + +static void rkl_RegisterForLowMemoryNotifications(void) RKL_ATTRIBUTES(used); + +@interface RKLLowMemoryWarningObserver : NSObject +(void)lowMemoryWarning:(id)notification; @end +@implementation RKLLowMemoryWarningObserver ++(void)lowMemoryWarning:(id)notification { + if(OSSpinLockTry(&rkl_cacheSpinLock)) { rkl_clearStringCache(); OSSpinLockUnlock(&rkl_cacheSpinLock); } + else { [[RKLLowMemoryWarningObserver class] performSelector:@selector(lowMemoryWarning:) withObject:notification afterDelay:(NSTimeInterval)0.1]; } +} +@end + +static volatile int rkl_HaveRegisteredForLowMemoryNotifications = 0; + +__attribute__((constructor)) static void rkl_RegisterForLowMemoryNotifications(void) { + _Bool didSwap = false; + void **memoryWarningNotification = NULL; + + while((rkl_HaveRegisteredForLowMemoryNotifications == 0) && ((didSwap = OSAtomicCompareAndSwapIntBarrier(0, 1, &rkl_HaveRegisteredForLowMemoryNotifications)) == false)) { /* Allows for spurious CAS failures. */ } + if(didSwap == true) { + if((memoryWarningNotification = (void **)dlsym(RTLD_DEFAULT, "UIApplicationDidReceiveMemoryWarningNotification")) != NULL) { + [[NSNotificationCenter defaultCenter] addObserver:[RKLLowMemoryWarningObserver class] selector:@selector(lowMemoryWarning:) name:(NSString *)*memoryWarningNotification object:NULL]; + } + } +} + +#endif // defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) && (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS == 1) + +//////////// +#pragma mark - +#pragma mark DTrace functionality + +#ifdef _RKL_DTRACE_ENABLED + +// compiledRegexCache(unsigned long eventID, const char *regexUTF8, int options, int captures, int hitMiss, int icuStatusCode, const char *icuErrorMessage, double *hitRate); +// utf16ConversionCache(unsigned long eventID, unsigned int lookupResultFlags, double *hitRate, const void *string, unsigned long NSRange.location, unsigned long NSRange.length, long length); + +/* +provider RegexKitLite { + probe compiledRegexCache(unsigned long, const char *, unsigned int, int, int, int, const char *, double *); + probe utf16ConversionCache(unsigned long, unsigned int, double *, const void *, unsigned long, unsigned long, long); +}; + +#pragma D attributes Unstable/Unstable/Common provider RegexKitLite provider +#pragma D attributes Private/Private/Common provider RegexKitLite module +#pragma D attributes Private/Private/Common provider RegexKitLite function +#pragma D attributes Unstable/Unstable/Common provider RegexKitLite name +#pragma D attributes Unstable/Unstable/Common provider RegexKitLite args +*/ + +#define REGEXKITLITE_STABILITY "___dtrace_stability$RegexKitLite$v1$4_4_5_1_1_5_1_1_5_4_4_5_4_4_5" +#define REGEXKITLITE_TYPEDEFS "___dtrace_typedefs$RegexKitLite$v1" +#define REGEXKITLITE_COMPILEDREGEXCACHE(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { __asm__ volatile(".reference " REGEXKITLITE_TYPEDEFS); __dtrace_probe$RegexKitLite$compiledRegexCache$v1$756e7369676e6564206c6f6e67$63686172202a$756e7369676e656420696e74$696e74$696e74$696e74$63686172202a$646f75626c65202a(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); __asm__ volatile(".reference " REGEXKITLITE_STABILITY); } +#define REGEXKITLITE_COMPILEDREGEXCACHE_ENABLED() __dtrace_isenabled$RegexKitLite$compiledRegexCache$v1() +#define REGEXKITLITE_CONVERTEDSTRINGU16CACHE(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { __asm__ volatile(".reference " REGEXKITLITE_TYPEDEFS); __dtrace_probe$RegexKitLite$utf16ConversionCache$v1$756e7369676e6564206c6f6e67$756e7369676e656420696e74$646f75626c65202a$766f6964202a$756e7369676e6564206c6f6e67$756e7369676e6564206c6f6e67$6c6f6e67(arg0, arg1, arg2, arg3, arg4, arg5, arg6); __asm__ volatile(".reference " REGEXKITLITE_STABILITY); } +#define REGEXKITLITE_CONVERTEDSTRINGU16CACHE_ENABLED() __dtrace_isenabled$RegexKitLite$utf16ConversionCache$v1() + +extern void __dtrace_probe$RegexKitLite$compiledRegexCache$v1$756e7369676e6564206c6f6e67$63686172202a$756e7369676e656420696e74$696e74$696e74$696e74$63686172202a$646f75626c65202a(unsigned long, const char *, unsigned int, int, int, int, const char *, double *); +extern int __dtrace_isenabled$RegexKitLite$compiledRegexCache$v1(void); +extern void __dtrace_probe$RegexKitLite$utf16ConversionCache$v1$756e7369676e6564206c6f6e67$756e7369676e656420696e74$646f75626c65202a$766f6964202a$756e7369676e6564206c6f6e67$756e7369676e6564206c6f6e67$6c6f6e67(unsigned long, unsigned int, double *, const void *, unsigned long, unsigned long, long); +extern int __dtrace_isenabled$RegexKitLite$utf16ConversionCache$v1(void); + +//////////////////////////// + +enum { + RKLCacheHitLookupFlag = 1 << 0, + RKLConversionRequiredLookupFlag = 1 << 1, + RKLSetTextLookupFlag = 1 << 2, + RKLDynamicBufferLookupFlag = 1 << 3, + RKLErrorLookupFlag = 1 << 4, + RKLEnumerationBufferLookupFlag = 1 << 5, +}; + +#define rkl_dtrace_addLookupFlag(a,b) do { a |= (unsigned int)(b); } while(0) + +static char rkl_dtrace_regexUTF8[_RKL_REGEX_CACHE_LINES + 1UL][_RKL_DTRACE_REGEXUTF8_SIZE]; +static NSUInteger rkl_dtrace_eventID, rkl_dtrace_compiledCacheLookups, rkl_dtrace_compiledCacheHits, rkl_dtrace_conversionBufferLookups, rkl_dtrace_conversionBufferHits; + +#define rkl_dtrace_incrementEventID() do { rkl_dtrace_eventID++; } while(0) +#define rkl_dtrace_incrementAndGetEventID(v) do { rkl_dtrace_eventID++; v = rkl_dtrace_eventID; } while(0) +#define rkl_dtrace_compiledRegexCache(a0, a1, a2, a3, a4, a5) do { int _a3 = (a3); rkl_dtrace_compiledCacheLookups++; if(_a3 == 1) { rkl_dtrace_compiledCacheHits++; } if(RKL_EXPECTED(REGEXKITLITE_COMPILEDREGEXCACHE_ENABLED(), 0L)) { double hitRate = 0.0; if(rkl_dtrace_compiledCacheLookups > 0UL) { hitRate = ((double)rkl_dtrace_compiledCacheHits / (double)rkl_dtrace_compiledCacheLookups) * 100.0; } REGEXKITLITE_COMPILEDREGEXCACHE(rkl_dtrace_eventID, a0, a1, a2, _a3, a4, a5, &hitRate); } } while(0) +#define rkl_dtrace_utf16ConversionCache(a0, a1, a2, a3, a4) do { unsigned int _a0 = (a0); if((_a0 & RKLConversionRequiredLookupFlag) != 0U) { rkl_dtrace_conversionBufferLookups++; if((_a0 & RKLCacheHitLookupFlag) != 0U) { rkl_dtrace_conversionBufferHits++; } } if(RKL_EXPECTED(REGEXKITLITE_CONVERTEDSTRINGU16CACHE_ENABLED(), 0L)) { double hitRate = 0.0; if(rkl_dtrace_conversionBufferLookups > 0UL) { hitRate = ((double)rkl_dtrace_conversionBufferHits / (double)rkl_dtrace_conversionBufferLookups) * 100.0; } REGEXKITLITE_CONVERTEDSTRINGU16CACHE(rkl_dtrace_eventID, _a0, &hitRate, a1, a2, a3, a4); } } while(0) +#define rkl_dtrace_utf16ConversionCacheWithEventID(c0, a0, a1, a2, a3, a4) do { unsigned int _a0 = (a0); if((_a0 & RKLConversionRequiredLookupFlag) != 0U) { rkl_dtrace_conversionBufferLookups++; if((_a0 & RKLCacheHitLookupFlag) != 0U) { rkl_dtrace_conversionBufferHits++; } } if(RKL_EXPECTED(REGEXKITLITE_CONVERTEDSTRINGU16CACHE_ENABLED(), 0L)) { double hitRate = 0.0; if(rkl_dtrace_conversionBufferLookups > 0UL) { hitRate = ((double)rkl_dtrace_conversionBufferHits / (double)rkl_dtrace_conversionBufferLookups) * 100.0; } REGEXKITLITE_CONVERTEDSTRINGU16CACHE(c0, _a0, &hitRate, a1, a2, a3, a4); } } while(0) + + +// \342\200\246 == UTF8 for HORIZONTAL ELLIPSIS, aka triple dots '...' +#define RKL_UTF8_ELLIPSE "\342\200\246" + +// rkl_dtrace_getRegexUTF8 will copy the str argument to utf8Buffer using UTF8 as the string encoding. +// If the utf8 encoding would take up more bytes than the utf8Buffers length, then the unicode character 'HORIZONTAL ELLIPSIS' ('...') is appended to indicate truncation occurred. +static void rkl_dtrace_getRegexUTF8(CFStringRef str, char *utf8Buffer) RKL_NONNULL_ARGS(2); +static void rkl_dtrace_getRegexUTF8(CFStringRef str, char *utf8Buffer) { + if((str == NULL) || (utf8Buffer == NULL)) { return; } + CFIndex maxLength = ((CFIndex)_RKL_DTRACE_REGEXUTF8_SIZE - 2L), maxBytes = (maxLength - (CFIndex)sizeof(RKL_UTF8_ELLIPSE) - 1L), stringU16Length = CFStringGetLength(str), usedBytes = 0L; + CFStringGetBytes(str, CFMakeRange(0L, ((stringU16Length < maxLength) ? stringU16Length : maxLength)), kCFStringEncodingUTF8, (UInt8)'?', (Boolean)0, (UInt8 *)utf8Buffer, maxBytes, &usedBytes); + if(usedBytes == maxBytes) { strncpy(utf8Buffer + usedBytes, RKL_UTF8_ELLIPSE, ((size_t)_RKL_DTRACE_REGEXUTF8_SIZE - (size_t)usedBytes) - 2UL); } else { utf8Buffer[usedBytes] = (char)0; } +} + +#else // _RKL_DTRACE_ENABLED + +#define rkl_dtrace_incrementEventID() +#define rkl_dtrace_incrementAndGetEventID(v) +#define rkl_dtrace_compiledRegexCache(a0, a1, a2, a3, a4, a5) +#define rkl_dtrace_utf16ConversionCache(a0, a1, a2, a3, a4) +#define rkl_dtrace_utf16ConversionCacheWithEventID(c0, a0, a1, a2, a3, a4) +#define rkl_dtrace_getRegexUTF8(str, buf) +#define rkl_dtrace_addLookupFlag(a,b) + +#endif // _RKL_DTRACE_ENABLED + +//////////// +#pragma mark - +#pragma mark RegexKitLite low-level internal functions +#pragma mark - + +// The 4-way set associative LRU logic comes from Henry S. Warren Jr.'s Hacker's Delight, "revisions", 7-7 An LRU Algorithm: +// http://www.hackersdelight.org/revisions.pdf +// The functions rkl_leastRecentlyUsedWayInSet() and rkl_accessCacheSetWay() implement the cache functionality and are used +// from a number of different places that need to perform caching (i.e., cached regex, cached UTF16 conversions, etc) + +#pragma mark 4-way set associative LRU functions + +RKL_STATIC_INLINE NSUInteger rkl_leastRecentlyUsedWayInSet(NSUInteger cacheSetsCount, const RKLLRUCacheSet_t cacheSetsArray[cacheSetsCount], NSUInteger set) { + RKLCAbortAssert((cacheSetsArray != NULL) && ((NSInteger)cacheSetsCount > 0L) && (set < cacheSetsCount) && ((cacheSetsArray == rkl_cachedRegexCacheSets) ? set < _RKL_REGEX_LRU_CACHE_SETS : 1) && (((sizeof(unsigned int) - sizeof(RKLLRUCacheSet_t)) * 8) < (sizeof(unsigned int) * 8))); + unsigned int cacheSet = (((unsigned int)cacheSetsArray[set]) << ((sizeof(unsigned int) - sizeof(RKLLRUCacheSet_t)) * 8)); // __builtin_clz takes an 'unsigned int' argument. The rest is to ensure bit alignment regardless of 32/64/whatever. + NSUInteger leastRecentlyUsed = ((NSUInteger)(3LU - (NSUInteger)((__builtin_clz((~(((cacheSet & 0x77777777U) + 0x77777777U) | cacheSet | 0x77777777U))) ) >> 2))); + RKLCAbortAssert(leastRecentlyUsed < _RKL_LRU_CACHE_SET_WAYS); + return(leastRecentlyUsed); +} + +RKL_STATIC_INLINE void rkl_accessCacheSetWay(NSUInteger cacheSetsCount, RKLLRUCacheSet_t cacheSetsArray[cacheSetsCount], NSUInteger cacheSet, NSUInteger cacheWay) { + RKLCAbortAssert((cacheSetsArray != NULL) && ((NSInteger)cacheSetsCount > 0L) && (cacheSet < cacheSetsCount) && (cacheWay < _RKL_LRU_CACHE_SET_WAYS) && ((cacheSetsArray == rkl_cachedRegexCacheSets) ? cacheSet < _RKL_REGEX_LRU_CACHE_SETS : 1)); + cacheSetsArray[cacheSet] = (RKLLRUCacheSet_t)(((cacheSetsArray[cacheSet] & (RKLLRUCacheSet_t)0xFFFFU) | (((RKLLRUCacheSet_t)0xFU) << (cacheWay * 4U))) & (~(((RKLLRUCacheSet_t)0x1111U) << (3U - cacheWay)))); +} + +#pragma mark Common, macro'ish compiled regular expression cache logic + +// These functions consolidate bits and pieces of code used to maintain, update, and access the 4-way set associative LRU cache and Regex Lookaside Cache. +RKL_STATIC_INLINE NSUInteger rkl_regexLookasideCacheIndexForPointerAndOptions (const void *ptr, RKLRegexOptions options) { return(((((NSUInteger)(ptr)) >> 4) + options + (options >> 4)) & _RKL_REGEX_LOOKASIDE_CACHE_MASK); } +RKL_STATIC_INLINE void rkl_setRegexLookasideCacheToCachedRegexForPointer (const RKLCachedRegex *cachedRegex, const void *ptr) { rkl_regexLookasideCache[rkl_regexLookasideCacheIndexForPointerAndOptions(ptr, cachedRegex->options)] = (cachedRegex - rkl_cachedRegexes); } +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexFromRegexLookasideCacheForString (const void *ptr, RKLRegexOptions options) { return(&rkl_cachedRegexes[rkl_regexLookasideCache[rkl_regexLookasideCacheIndexForPointerAndOptions(ptr, options)]]); } +RKL_STATIC_INLINE NSUInteger rkl_makeCacheSetHash ( CFHashCode regexHash, RKLRegexOptions options) { return((NSUInteger)regexHash ^ (NSUInteger)options); } +RKL_STATIC_INLINE NSUInteger rkl_cacheSetForRegexHashAndOptions ( CFHashCode regexHash, RKLRegexOptions options) { return((rkl_makeCacheSetHash(regexHash, options) % _RKL_REGEX_LRU_CACHE_SETS)); } +RKL_STATIC_INLINE NSUInteger rkl_cacheWayForCachedRegex (const RKLCachedRegex *cachedRegex) { return((cachedRegex - rkl_cachedRegexes) % _RKL_LRU_CACHE_SET_WAYS); } +RKL_STATIC_INLINE NSUInteger rkl_cacheSetForCachedRegex (const RKLCachedRegex *cachedRegex) { return(rkl_cacheSetForRegexHashAndOptions(cachedRegex->regexHash, cachedRegex->options)); } +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexForCacheSetAndWay ( NSUInteger cacheSet, NSUInteger cacheWay) { return(&rkl_cachedRegexes[((cacheSet * _RKL_LRU_CACHE_SET_WAYS) + cacheWay)]); } +RKL_STATIC_INLINE RKLCachedRegex *rkl_cachedRegexForRegexHashAndOptionsAndWay ( CFHashCode regexHash, RKLRegexOptions options, NSUInteger cacheWay) { return(rkl_cachedRegexForCacheSetAndWay(rkl_cacheSetForRegexHashAndOptions(regexHash, options), cacheWay)); } + +RKL_STATIC_INLINE void rkl_updateCachesWithCachedRegex(RKLCachedRegex *cachedRegex, const void *ptr, int hitOrMiss RKL_UNUSED_DTRACE_ARG, int status RKL_UNUSED_DTRACE_ARG) { + rkl_lastCachedRegex = cachedRegex; + rkl_setRegexLookasideCacheToCachedRegexForPointer(cachedRegex, ptr); + rkl_accessCacheSetWay(_RKL_REGEX_LRU_CACHE_SETS, rkl_cachedRegexCacheSets, rkl_cacheSetForCachedRegex(cachedRegex), rkl_cacheWayForCachedRegex(cachedRegex)); // Set the matching line as the most recently used. + rkl_dtrace_compiledRegexCache(&rkl_dtrace_regexUTF8[(cachedRegex - rkl_cachedRegexes)][0], cachedRegex->options, (int)cachedRegex->captureCount, hitOrMiss, status, NULL); +} + +RKL_STATIC_INLINE RKLCachedRegex *rkl_leastRecentlyUsedCachedRegexForRegexHashAndOptions(CFHashCode regexHash, RKLRegexOptions options) { + NSUInteger cacheSet = rkl_cacheSetForRegexHashAndOptions(regexHash, options); + return(rkl_cachedRegexForCacheSetAndWay(cacheSet, rkl_leastRecentlyUsedWayInSet(_RKL_REGEX_LRU_CACHE_SETS, rkl_cachedRegexCacheSets, cacheSet))); +} + +#pragma mark Regular expression lookup function + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called with rkl_cacheSpinLock already locked! +// ---------- + +static RKLCachedRegex *rkl_getCachedRegex(NSString *regexString, RKLRegexOptions options, NSError **error, id *exception) { + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + + RKLCachedRegex *cachedRegex = NULL; + CFHashCode regexHash = 0UL; + int32_t status = 0; + + RKLCDelayedAssert((rkl_cacheSpinLock != (OSSpinLock)0) && (regexString != NULL), exception, exitNow); + + // Fast path the common case where this regex is exactly the same one used last time. + // The pointer equality test is valid under these circumstances since the cachedRegex->regexString is an immutable copy. + // If the regexString argument is mutable, this test will fail, and we'll use the the slow path cache check below. + if(RKL_EXPECTED(rkl_lastCachedRegex != NULL, 1L) && RKL_EXPECTED(rkl_lastCachedRegex->regexString == (CFStringRef)regexString, 1L) && RKL_EXPECTED(rkl_lastCachedRegex->options == options, 1L) && RKL_EXPECTED(rkl_lastCachedRegex->icu_regex != NULL, 1L)) { + rkl_dtrace_compiledRegexCache(&rkl_dtrace_regexUTF8[(rkl_lastCachedRegex - rkl_cachedRegexes)][0], rkl_lastCachedRegex->options, (int)rkl_lastCachedRegex->captureCount, 1, 0, NULL); + return(rkl_lastCachedRegex); + } + + rkl_lastCachedRegex = NULL; // Make sure that rkl_lastCachedRegex is NULL in case there is some kind of error. + cachedRegex = rkl_cachedRegexFromRegexLookasideCacheForString(regexString, options); // Check the Regex Lookaside Cache to see if we can quickly find the correct Cached Regex for this regexString pointer + options. + if((RKL_EXPECTED(cachedRegex->regexString == (CFStringRef)regexString, 1L) || (RKL_EXPECTED(cachedRegex->regexString != NULL, 1L) && RKL_EXPECTED(CFEqual((CFTypeRef)regexString, (CFTypeRef)cachedRegex->regexString) == YES, 1L))) && RKL_EXPECTED(cachedRegex->options == options, 1L) && RKL_EXPECTED(cachedRegex->icu_regex != NULL, 1L)) { goto foundMatch; } // There was a Regex Lookaside Cache hit, jump to foundMatch: to quickly return the result. A Regex Lookaside Cache hit allows us to bypass calling CFHash(), which is a decent performance win. + else { cachedRegex = NULL; regexHash = CFHash((CFTypeRef)regexString); } // Regex Lookaside Cache miss. We need to call CFHash() to determine the cache set for this regex. + + NSInteger cacheWay = 0L; // Check each way of the set that this regex belongs to. + for(cacheWay = ((NSInteger)_RKL_LRU_CACHE_SET_WAYS - 1L); cacheWay > 0L; cacheWay--) { // Checking the ways in reverse (3, 2, 1, 0) finds a match "sooner" on average. + cachedRegex = rkl_cachedRegexForRegexHashAndOptionsAndWay(regexHash, options, (NSUInteger)cacheWay); + // Return the cached entry if it's a match. If regexString is mutable, the pointer equality test will fail, and CFEqual() is used to determine true equality with the immutable cachedRegex copy. CFEqual() performs a slow character by character check. + if(RKL_EXPECTED(cachedRegex->regexHash == regexHash, 0UL) && ((cachedRegex->regexString == (CFStringRef)regexString) || (RKL_EXPECTED(cachedRegex->regexString != NULL, 1L) && RKL_EXPECTED(CFEqual((CFTypeRef)regexString, (CFTypeRef)cachedRegex->regexString) == YES, 1L))) && RKL_EXPECTED(cachedRegex->options == options, 1L) && RKL_EXPECTED(cachedRegex->icu_regex != NULL, 1L)) { + foundMatch: // Control can transfer here (from above) via a Regex Lookaside Cache hit. + rkl_updateCachesWithCachedRegex(cachedRegex, regexString, 1, 0); + return(cachedRegex); + } + } + + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + // Code below this point is not as sensitive to speed since compiling a regular expression is an extremely expensive operation. + // The regex was not found in the cache. Get the cached regex for the least recently used line in the set, then clear the cached regex and create a new ICU regex in its place. + cachedRegex = rkl_leastRecentlyUsedCachedRegexForRegexHashAndOptions(regexHash, options); + rkl_clearCachedRegex(cachedRegex); + + if(RKL_EXPECTED((cachedRegex->regexString = CFStringCreateCopy(NULL, (CFStringRef)regexString)) == NULL, 0L)) { goto exitNow; } ; // Get a cheap immutable copy. + rkl_dtrace_getRegexUTF8(cachedRegex->regexString, &rkl_dtrace_regexUTF8[(cachedRegex - rkl_cachedRegexes)][0]); + cachedRegex->regexHash = regexHash; + cachedRegex->options = options; + + CFIndex regexStringU16Length = CFStringGetLength(cachedRegex->regexString); // In UTF16 code units. + UParseError parseError = (UParseError){-1, -1, {0}, {0}}; + RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE regexUniChar = NULL; + + if(RKL_EXPECTED(regexStringU16Length >= (CFIndex)INT_MAX, 0L)) { *exception = [NSException exceptionWithName:NSRangeException reason:@"Regex string length exceeds INT_MAX" userInfo:NULL]; goto exitNow; } + + // Try to quickly obtain regexString in UTF16 format. + if((regexUniChar = CFStringGetCharactersPtr(cachedRegex->regexString)) == NULL) { // We didn't get the UTF16 pointer quickly and need to perform a full conversion in a temp buffer. + RKL_STRONG_REF UniChar * RKL_GC_VOLATILE uniCharBuffer = NULL; + if(((size_t)regexStringU16Length * sizeof(UniChar)) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((uniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)alloca( (size_t)regexStringU16Length * sizeof(UniChar) )) == NULL, 0L)) { goto exitNow; } } // Try to use the stack. + else { if(RKL_EXPECTED((uniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc(&rkl_scratchBuffer[0], (size_t)regexStringU16Length * sizeof(UniChar), 0UL)) == NULL, 0L)) { goto exitNow; } } // Otherwise use the heap. + CFStringGetCharacters(cachedRegex->regexString, CFMakeRange(0L, regexStringU16Length), uniCharBuffer); // Convert regexString to UTF16. + regexUniChar = uniCharBuffer; + } + + // Create the ICU regex. + if(RKL_EXPECTED((cachedRegex->icu_regex = RKL_ICU_FUNCTION_APPEND(uregex_open)(regexUniChar, (int32_t)regexStringU16Length, options, &parseError, &status)) == NULL, 0L)) { goto exitNow; } + if(RKL_EXPECTED(status <= U_ZERO_ERROR, 1L)) { cachedRegex->captureCount = (NSInteger)RKL_ICU_FUNCTION_APPEND(uregex_groupCount)(cachedRegex->icu_regex, &status); } + if(RKL_EXPECTED(status <= U_ZERO_ERROR, 1L)) { rkl_updateCachesWithCachedRegex(cachedRegex, regexString, 0, status); } + +exitNow: + if(RKL_EXPECTED(rkl_scratchBuffer[0] != NULL, 0L)) { rkl_scratchBuffer[0] = rkl_free(&rkl_scratchBuffer[0]); } + if(RKL_EXPECTED(status > U_ZERO_ERROR, 0L)) { rkl_clearCachedRegex(cachedRegex); cachedRegex = rkl_lastCachedRegex = NULL; if(error != NULL) { *error = rkl_makeNSError((RKLUserInfoOptions)RKLUserInfoNone, regexString, options, &parseError, status, NULL, NSNotFoundRange, NULL, NULL, 0L, (RKLRegexEnumerationOptions)RKLRegexEnumerationNoOptions, @"There was an error compiling the regular expression."); } } + +#ifdef _RKL_DTRACE_ENABLED + if(RKL_EXPECTED(cachedRegex == NULL, 1L)) { char regexUTF8[_RKL_DTRACE_REGEXUTF8_SIZE]; const char *err = NULL; if(status != U_ZERO_ERROR) { err = RKL_ICU_FUNCTION_APPEND(u_errorName)(status); } rkl_dtrace_getRegexUTF8((CFStringRef)regexString, regexUTF8); rkl_dtrace_compiledRegexCache(regexUTF8, options, -1, -1, status, err); } +#endif // _RKL_DTRACE_ENABLED + + return(cachedRegex); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called with rkl_cacheSpinLock already locked! +// ---------- + +#pragma mark Set a cached regular expression to a NSStrings UTF-16 text + +static NSUInteger rkl_setCachedRegexToString(RKLCachedRegex *cachedRegex, const NSRange *range, int32_t *status, id *exception RKL_UNUSED_ASSERTION_ARG) { + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + + RKLCDelayedAssert((cachedRegex != NULL) && (cachedRegex->setToString != NULL) && ((range != NULL) && (NSEqualRanges(*range, NSNotFoundRange) == NO)) && (status != NULL), exception, exitNow); + RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE stringUniChar = NULL; +#ifdef _RKL_DTRACE_ENABLED + unsigned int lookupResultFlags = 0U; +#endif + + NSUInteger useFixedBuffer = (cachedRegex->setToLength < (CFIndex)_RKL_FIXED_LENGTH) ? 1UL : 0UL; + RKLBuffer *buffer = NULL; + + if(cachedRegex->setToNeedsConversion == 0U) { + RKLCDelayedAssert((cachedRegex->setToUniChar != NULL) && (cachedRegex->buffer == NULL), exception, exitNow); + if(RKL_EXPECTED((stringUniChar = (RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE)CFStringGetCharactersPtr(cachedRegex->setToString)) == NULL, 0L)) { cachedRegex->setToUniChar = NULL; cachedRegex->setToRange = NSNotFoundRange; cachedRegex->setToNeedsConversion = 1U; } + else { if(RKL_EXPECTED(cachedRegex->setToUniChar != stringUniChar, 0L)) { cachedRegex->setToRange = NSNotFoundRange; cachedRegex->setToUniChar = stringUniChar; } goto setRegexText; } + } + + buffer = cachedRegex->buffer; + + RKLCDelayedAssert((buffer == NULL) ? 1 : (((buffer == &rkl_lruFixedBuffer[0]) || (buffer == &rkl_lruFixedBuffer[1]) || (buffer == &rkl_lruFixedBuffer[2]) || (buffer == &rkl_lruFixedBuffer[3])) || + ((buffer == &rkl_lruDynamicBuffer[0]) || (buffer == &rkl_lruDynamicBuffer[1]) || (buffer == &rkl_lruDynamicBuffer[2]) || (buffer == &rkl_lruDynamicBuffer[3]))), exception, exitNow); + + if((buffer != NULL) && RKL_EXPECTED(cachedRegex->setToString == buffer->string, 1L) && RKL_EXPECTED(cachedRegex->setToHash == buffer->hash, 1L) && RKL_EXPECTED(cachedRegex->setToLength == buffer->length, 1L)) { + RKLCDelayedAssert((buffer->uniChar != NULL), exception, exitNow); + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLCacheHitLookupFlag | RKLConversionRequiredLookupFlag | (useFixedBuffer ? 0U : RKLDynamicBufferLookupFlag)); + if(cachedRegex->setToUniChar != buffer->uniChar) { cachedRegex->setToRange = NSNotFoundRange; cachedRegex->setToUniChar = buffer->uniChar; } + goto setRegexText; + } + + buffer = NULL; + cachedRegex->buffer = NULL; + + NSInteger cacheWay = 0L; + for(cacheWay = ((NSInteger)_RKL_LRU_CACHE_SET_WAYS - 1L); cacheWay > 0L; cacheWay--) { + if(useFixedBuffer) { buffer = &rkl_lruFixedBuffer[cacheWay]; } else { buffer = &rkl_lruDynamicBuffer[cacheWay]; } + if(RKL_EXPECTED(cachedRegex->setToString == buffer->string, 1L) && RKL_EXPECTED(cachedRegex->setToHash == buffer->hash, 1L) && RKL_EXPECTED(cachedRegex->setToLength == buffer->length, 1L)) { + RKLCDelayedAssert((buffer->uniChar != NULL), exception, exitNow); + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLCacheHitLookupFlag | RKLConversionRequiredLookupFlag | (useFixedBuffer ? 0U : RKLDynamicBufferLookupFlag)); + if(cachedRegex->setToUniChar != buffer->uniChar) { cachedRegex->setToRange = NSNotFoundRange; cachedRegex->setToUniChar = buffer->uniChar; } + cachedRegex->buffer = buffer; + goto setRegexText; + } + } + + buffer = NULL; + cachedRegex->setToUniChar = NULL; + cachedRegex->setToRange = NSNotFoundRange; + cachedRegex->buffer = NULL; + + RKLCDelayedAssert((cachedRegex->setToNeedsConversion == 1U) && (cachedRegex->buffer == NULL), exception, exitNow); + if(RKL_EXPECTED(cachedRegex->setToNeedsConversion == 1U, 1L) && RKL_EXPECTED((cachedRegex->setToUniChar = (RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE)CFStringGetCharactersPtr(cachedRegex->setToString)) != NULL, 0L)) { cachedRegex->setToNeedsConversion = 0U; cachedRegex->setToRange = NSNotFoundRange; goto setRegexText; } + + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLConversionRequiredLookupFlag | (useFixedBuffer ? 0U : RKLDynamicBufferLookupFlag)); + + if(useFixedBuffer) { buffer = &rkl_lruFixedBuffer [rkl_leastRecentlyUsedWayInSet(1UL, &rkl_lruFixedBufferCacheSet, 0UL)]; } + else { buffer = &rkl_lruDynamicBuffer[rkl_leastRecentlyUsedWayInSet(1UL, &rkl_lruDynamicBufferCacheSet, 0UL)]; } + + RKLCDelayedAssert((useFixedBuffer) ? ((buffer == &rkl_lruFixedBuffer[0]) || (buffer == &rkl_lruFixedBuffer[1]) || (buffer == &rkl_lruFixedBuffer[2]) || (buffer == &rkl_lruFixedBuffer[3])) : + ((buffer == &rkl_lruDynamicBuffer[0]) || (buffer == &rkl_lruDynamicBuffer[1]) || (buffer == &rkl_lruDynamicBuffer[2]) || (buffer == &rkl_lruDynamicBuffer[3])), exception, exitNow); + + rkl_clearBuffer(buffer, 0UL); + + RKLCDelayedAssert((buffer->string == NULL) && (cachedRegex->setToString != NULL), exception, exitNow); + if(RKL_EXPECTED((buffer->string = (CFStringRef)CFRetain((CFTypeRef)cachedRegex->setToString)) == NULL, 0L)) { goto exitNow; } + buffer->hash = cachedRegex->setToHash; + buffer->length = cachedRegex->setToLength; + + if(useFixedBuffer == 0UL) { + RKL_STRONG_REF void * RKL_GC_VOLATILE p = (RKL_STRONG_REF void * RKL_GC_VOLATILE)buffer->uniChar; + if(RKL_EXPECTED((buffer->uniChar = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc(&p, ((size_t)buffer->length * sizeof(UniChar)), 0UL)) == NULL, 0L)) { goto exitNow; } // Resize the buffer. + } + + RKLCDelayedAssert((buffer->string != NULL) && (buffer->uniChar != NULL), exception, exitNow); + CFStringGetCharacters(buffer->string, CFMakeRange(0L, buffer->length), (UniChar *)buffer->uniChar); // Convert to a UTF16 string. + + cachedRegex->setToUniChar = buffer->uniChar; + cachedRegex->setToRange = NSNotFoundRange; + cachedRegex->buffer = buffer; + +setRegexText: + if(buffer != NULL) { if(useFixedBuffer == 1UL) { rkl_accessCacheSetWay(1UL, &rkl_lruFixedBufferCacheSet, 0UL, (NSUInteger)(buffer - rkl_lruFixedBuffer)); } else { rkl_accessCacheSetWay(1UL, &rkl_lruDynamicBufferCacheSet, 0UL, (NSUInteger)(buffer - rkl_lruDynamicBuffer)); } } + + if(NSEqualRanges(cachedRegex->setToRange, *range) == NO) { + RKLCDelayedAssert((cachedRegex->icu_regex != NULL) && (cachedRegex->setToUniChar != NULL) && (NSMaxRange(*range) <= (NSUInteger)cachedRegex->setToLength) && (cachedRegex->setToRange.length <= INT_MAX), exception, exitNow); + cachedRegex->lastFindRange = cachedRegex->lastMatchRange = NSNotFoundRange; + cachedRegex->setToRange = *range; + RKL_ICU_FUNCTION_APPEND(uregex_setText)(cachedRegex->icu_regex, cachedRegex->setToUniChar + cachedRegex->setToRange.location, (int32_t)cachedRegex->setToRange.length, status); + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLSetTextLookupFlag); + if(RKL_EXPECTED(*status > U_ZERO_ERROR, 0L)) { rkl_dtrace_addLookupFlag(lookupResultFlags, RKLErrorLookupFlag); goto exitNow; } + } + + rkl_dtrace_utf16ConversionCache(lookupResultFlags, cachedRegex->setToString, cachedRegex->setToRange.location, cachedRegex->setToRange.length, cachedRegex->setToLength); + + return(1UL); + + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +exitNow: +#ifdef _RKL_DTRACE_ENABLED + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLErrorLookupFlag); + if(cachedRegex != NULL) { rkl_dtrace_utf16ConversionCache(lookupResultFlags, cachedRegex->setToString, cachedRegex->setToRange.location, cachedRegex->setToRange.length, cachedRegex->setToLength); } +#endif // _RKL_DTRACE_ENABLED + if(cachedRegex != NULL) { cachedRegex->buffer = NULL; cachedRegex->setToRange = NSNotFoundRange; cachedRegex->lastFindRange = NSNotFoundRange; cachedRegex->lastMatchRange = NSNotFoundRange; } + return(0UL); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called with rkl_cacheSpinLock already locked! +// ---------- + +#pragma mark Get a regular expression and set it to a NSStrings UTF-16 text + +static RKLCachedRegex *rkl_getCachedRegexSetToString(NSString *regexString, RKLRegexOptions options, NSString *matchString, NSUInteger *matchLengthPtr, NSRange *matchRange, NSError **error, id *exception, int32_t *status) { + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + + RKLCachedRegex *cachedRegex = NULL; + RKLCDelayedAssert((regexString != NULL) && (matchString != NULL) && (exception != NULL) && (status != NULL) && (matchLengthPtr != NULL), exception, exitNow); + + if(RKL_EXPECTED((cachedRegex = rkl_getCachedRegex(regexString, options, error, exception)) == NULL, 0L)) { goto exitNow; } + RKLCDelayedAssert(((cachedRegex >= rkl_cachedRegexes) && ((cachedRegex - rkl_cachedRegexes) < (ssize_t)_RKL_REGEX_CACHE_LINES)) && (cachedRegex != NULL) && (cachedRegex->icu_regex != NULL) && (cachedRegex->regexString != NULL) && (cachedRegex->captureCount >= 0L) && (cachedRegex == rkl_lastCachedRegex), exception, exitNow); + + // Optimize the case where the string to search (matchString) is immutable and the setToString immutable copy is the same string with its reference count incremented. + NSUInteger isSetTo = ((cachedRegex->setToString == (CFStringRef)matchString)) ? 1UL : 0UL; + CFIndex matchLength = ((cachedRegex->setToIsImmutable == 1U) && (isSetTo == 1UL)) ? cachedRegex->setToLength : CFStringGetLength((CFStringRef)matchString); + + *matchLengthPtr = (NSUInteger)matchLength; + if(matchRange->length == NSUIntegerMax) { matchRange->length = (NSUInteger)matchLength; } // For convenience, allow NSUIntegerMax == string length. + + if(RKL_EXPECTED((NSUInteger)matchLength < NSMaxRange(*matchRange), 0L)) { goto exitNow; } // The match range is out of bounds for the string. performRegexOp will catch and report the problem. + + RKLCDelayedAssert((isSetTo == 1UL) ? (cachedRegex->setToString != NULL) : 1, exception, exitNow); + + if(((cachedRegex->setToIsImmutable == 1U) ? isSetTo : (NSUInteger)((isSetTo == 1UL) && (cachedRegex->setToLength == matchLength) && (cachedRegex->setToHash == CFHash((CFTypeRef)matchString)))) == 0UL) { + if(cachedRegex->setToString != NULL) { rkl_clearCachedRegexSetTo(cachedRegex); } + + cachedRegex->setToString = (CFStringRef)CFRetain((CFTypeRef)matchString); + RKLCDelayedAssert(cachedRegex->setToString != NULL, exception, exitNow); + cachedRegex->setToUniChar = CFStringGetCharactersPtr(cachedRegex->setToString); + cachedRegex->setToNeedsConversion = (cachedRegex->setToUniChar == NULL) ? 1U : 0U; + cachedRegex->setToIsImmutable = (rkl_CFStringIsMutable(cachedRegex->setToString) == YES) ? 0U : 1U; // If RKL_FAST_MUTABLE_CHECK is not defined then setToIsImmutable will always be set to '0', or in other words mutable.. + cachedRegex->setToHash = CFHash((CFTypeRef)cachedRegex->setToString); + cachedRegex->setToRange = NSNotFoundRange; + cachedRegex->setToLength = matchLength; + + } + + if(RKL_EXPECTED(rkl_setCachedRegexToString(cachedRegex, matchRange, status, exception) == 0UL, 0L)) { cachedRegex = NULL; if(*exception == NULL) { *exception = (id)RKLCAssertDictionary(@"Failed to set up UTF16 buffer."); } goto exitNow; } + +exitNow: + return(cachedRegex); + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // IMPORTANT! This section of code is called almost every single time that any RegexKitLite functionality is used! It /MUST/ be very fast! + // ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +#pragma mark GCC cleanup __attribute__ functions that ensure the global rkl_cacheSpinLock is properly unlocked +#ifdef RKL_HAVE_CLEANUP + +// rkl_cleanup_cacheSpinLockStatus takes advantage of GCC's 'cleanup' variable attribute. When an 'auto' variable with the 'cleanup' attribute goes out of scope, +// GCC arranges to have the designated function called. In this case, we make sure that if rkl_cacheSpinLock was locked that it was also unlocked. +// If rkl_cacheSpinLock was locked, but the rkl_cacheSpinLockStatus unlocked flag was not set, we force rkl_cacheSpinLock unlocked with a call to OSSpinLockUnlock. +// This is not a panacea for preventing mutex usage errors. Old style ObjC exceptions will bypass the cleanup call, but newer C++ style ObjC exceptions should cause the cleanup function to be called during the stack unwind. + +// We do not depend on this cleanup function being called. It is used only as an extra safety net. It is probably a bug in RegexKitLite if it is ever invoked and forced to take some kind of protective action. + +volatile NSUInteger rkl_debugCacheSpinLockCount = 0UL; + +void rkl_debugCacheSpinLock (void) RKL_ATTRIBUTES(used, noinline, visibility("default")); +static void rkl_cleanup_cacheSpinLockStatus (volatile NSUInteger *rkl_cacheSpinLockStatusPtr) RKL_ATTRIBUTES(used); + +void rkl_debugCacheSpinLock(void) { + rkl_debugCacheSpinLockCount++; // This is here primarily to prevent the optimizer from optimizing away the function. +} + +static void rkl_cleanup_cacheSpinLockStatus(volatile NSUInteger *rkl_cacheSpinLockStatusPtr) { + static NSUInteger didPrintForcedUnlockWarning = 0UL, didPrintNotLockedWarning = 0UL; + NSUInteger rkl_cacheSpinLockStatus = *rkl_cacheSpinLockStatusPtr; + + if(RKL_EXPECTED((rkl_cacheSpinLockStatus & RKLUnlockedCacheSpinLock) == 0UL, 0L) && RKL_EXPECTED((rkl_cacheSpinLockStatus & RKLLockedCacheSpinLock) != 0UL, 1L)) { + if(rkl_cacheSpinLock != (OSSpinLock)0) { + if(didPrintForcedUnlockWarning == 0UL) { didPrintForcedUnlockWarning = 1UL; NSLog(@"[RegexKitLite] Unusual condition detected: Recorded that rkl_cacheSpinLock was locked, but for some reason it was not unlocked. Forcibly unlocking rkl_cacheSpinLock. Set a breakpoint at rkl_debugCacheSpinLock to debug. This warning is only printed once."); } + rkl_debugCacheSpinLock(); // Since this is an unusual condition, offer an attempt to catch it before we unlock. + OSSpinLockUnlock(&rkl_cacheSpinLock); + } else { + if(didPrintNotLockedWarning == 0UL) { didPrintNotLockedWarning = 1UL; NSLog(@"[RegexKitLite] Unusual condition detected: Recorded that rkl_cacheSpinLock was locked, but for some reason it was not unlocked, yet rkl_cacheSpinLock is currently not locked? Set a breakpoint at rkl_debugCacheSpinLock to debug. This warning is only printed once."); } + rkl_debugCacheSpinLock(); + } + } +} + +#endif // RKL_HAVE_CLEANUP + +// rkl_performDictionaryVarArgsOp is a front end to rkl_performRegexOp which converts a ', ...' varargs key/captures list and converts it in to a form that rkl_performRegexOp can use. +// All error checking of arguments is handled by rkl_performRegexOp. + +#pragma mark Front end function that handles varargs and calls rkl_performRegexOp with the marshaled results + +static id rkl_performDictionaryVarArgsOp(id self, SEL _cmd, RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, NSInteger capture, id matchString, NSRange *matchRange, NSString *replacementString, NSError **error, void *result, id firstKey, va_list varArgsList) { + id captureKeys[64]; + int captureKeyIndexes[64]; + NSUInteger captureKeysCount = 0UL; + + if(varArgsList != NULL) { + while(captureKeysCount < 62UL) { + id thisCaptureKey = (captureKeysCount == 0) ? firstKey : va_arg(varArgsList, id); + if(RKL_EXPECTED(thisCaptureKey == NULL, 0L)) { break; } + int thisCaptureKeyIndex = va_arg(varArgsList, int); + captureKeys[captureKeysCount] = thisCaptureKey; + captureKeyIndexes[captureKeysCount] = thisCaptureKeyIndex; + captureKeysCount++; + } + } + + return(rkl_performRegexOp(self, _cmd, regexOp, regexString, options, capture, matchString, matchRange, replacementString, error, result, captureKeysCount, captureKeys, captureKeyIndexes)); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// ---------- + +#pragma mark Primary internal function that Objective-C methods call to perform regular expression operations + +static id rkl_performRegexOp(id self, SEL _cmd, RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, NSInteger capture, id matchString, NSRange *matchRange, NSString *replacementString, NSError **error, void *result, NSUInteger captureKeysCount, id captureKeys[captureKeysCount], const int captureKeyIndexes[captureKeysCount]) { + volatile NSUInteger RKL_CLEANUP(rkl_cleanup_cacheSpinLockStatus) rkl_cacheSpinLockStatus = 0UL; + + NSUInteger replaceMutable = 0UL; + RKLRegexOp maskedRegexOp = (regexOp & RKLMaskOp); + BOOL dictionaryOp = ((maskedRegexOp == RKLDictionaryOfCapturesOp) || (maskedRegexOp == RKLArrayOfDictionariesOfCapturesOp)) ? YES : NO; + + if((error != NULL) && (*error != NULL)) { *error = NULL; } + + if(RKL_EXPECTED(regexString == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInvalidArgumentException, @"The regular expression argument is NULL."); } + if(RKL_EXPECTED(matchString == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInternalInconsistencyException, @"The match string argument is NULL."); } + if(RKL_EXPECTED(matchRange == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInternalInconsistencyException, @"The match range argument is NULL."); } + if((maskedRegexOp == RKLReplaceOp) && RKL_EXPECTED(replacementString == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInvalidArgumentException, @"The replacement string argument is NULL."); } + if((dictionaryOp == YES) && RKL_EXPECTED(captureKeys == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInvalidArgumentException, @"The keys argument is NULL."); } + if((dictionaryOp == YES) && RKL_EXPECTED(captureKeyIndexes == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInvalidArgumentException, @"The captures argument is NULL."); } + + id resultObject = NULL, exception = NULL; + int32_t status = U_ZERO_ERROR; + RKLCachedRegex *cachedRegex = NULL; + NSUInteger stringU16Length = 0UL, tmpIdx = 0UL; + NSRange stackRanges[2048]; + RKLFindAll findAll; + + // IMPORTANT! Once we have obtained the lock, code MUST exit via 'goto exitNow;' to unlock the lock! NO EXCEPTIONS! + // ---------- + OSSpinLockLock(&rkl_cacheSpinLock); // Grab the lock and get cache entry. + rkl_cacheSpinLockStatus |= RKLLockedCacheSpinLock; + rkl_dtrace_incrementEventID(); + + if(RKL_EXPECTED((cachedRegex = rkl_getCachedRegexSetToString(regexString, options, matchString, &stringU16Length, matchRange, error, &exception, &status)) == NULL, 0L)) { stringU16Length = (NSUInteger)CFStringGetLength((CFStringRef)matchString); } + if(RKL_EXPECTED(matchRange->length == NSUIntegerMax, 0L)) { matchRange->length = stringU16Length; } // For convenience. + if(RKL_EXPECTED(stringU16Length < NSMaxRange(*matchRange), 0L) && RKL_EXPECTED(exception == NULL, 1L)) { exception = (id)RKL_EXCEPTION(NSRangeException, @"Range or index out of bounds."); goto exitNow; } + if(RKL_EXPECTED(stringU16Length >= (NSUInteger)INT_MAX, 0L) && RKL_EXPECTED(exception == NULL, 1L)) { exception = (id)RKL_EXCEPTION(NSRangeException, @"String length exceeds INT_MAX."); goto exitNow; } + if(((maskedRegexOp == RKLRangeOp) || (maskedRegexOp == RKLArrayOfStringsOp)) && RKL_EXPECTED(cachedRegex != NULL, 1L) && (RKL_EXPECTED(capture < 0L, 0L) || RKL_EXPECTED(capture > cachedRegex->captureCount, 0L)) && RKL_EXPECTED(exception == NULL, 1L)) { exception = (id)RKL_EXCEPTION(NSInvalidArgumentException, @"The capture argument is not valid."); goto exitNow; } + + if((dictionaryOp == YES) && RKL_EXPECTED(cachedRegex != NULL, 1L) && RKL_EXPECTED(exception == NULL, 1L)) { + for(tmpIdx = 0UL; tmpIdx < captureKeysCount; tmpIdx++) { + if(RKL_EXPECTED(captureKeys[tmpIdx] == NULL, 0L)) { exception = (id)RKL_EXCEPTION(NSInvalidArgumentException, @"The capture key (key %lu of %lu) is NULL.", (unsigned long)(tmpIdx + 1UL), (unsigned long)captureKeysCount); break; } + if((RKL_EXPECTED(captureKeyIndexes[tmpIdx] < 0, 0L) || RKL_EXPECTED(captureKeyIndexes[tmpIdx] > cachedRegex->captureCount, 0L))) { exception = (id)RKL_EXCEPTION(NSInvalidArgumentException, @"The capture argument %d (capture %lu of %lu) for key '%@' is not valid.", captureKeyIndexes[tmpIdx], (unsigned long)(tmpIdx + 1UL), (unsigned long)captureKeysCount, captureKeys[tmpIdx]); break; } + } + } + + if(RKL_EXPECTED(cachedRegex == NULL, 0L) || RKL_EXPECTED(status > U_ZERO_ERROR, 0L) || RKL_EXPECTED(exception != NULL, 0L)) { goto exitNow; } + + RKLCDelayedAssert(((cachedRegex >= rkl_cachedRegexes) && ((cachedRegex - rkl_cachedRegexes) < (ssize_t)_RKL_REGEX_CACHE_LINES)) && (cachedRegex != NULL) && (cachedRegex->icu_regex != NULL) && (cachedRegex->regexString != NULL) && (cachedRegex->captureCount >= 0L) && (cachedRegex->setToString != NULL) && (cachedRegex->setToLength >= 0L) && (cachedRegex->setToUniChar != NULL) && ((CFIndex)NSMaxRange(cachedRegex->setToRange) <= cachedRegex->setToLength), &exception, exitNow); + RKLCDelayedAssert((cachedRegex->setToNeedsConversion == 0U) ? ((cachedRegex->setToNeedsConversion == 0U) && (cachedRegex->setToUniChar == CFStringGetCharactersPtr(cachedRegex->setToString))) : ((cachedRegex->buffer != NULL) && (cachedRegex->setToHash == cachedRegex->buffer->hash) && (cachedRegex->setToLength == cachedRegex->buffer->length) && (cachedRegex->setToUniChar == cachedRegex->buffer->uniChar)), &exception, exitNow); + + switch(maskedRegexOp) { + case RKLRangeOp: + if((RKL_EXPECTED(rkl_search(cachedRegex, matchRange, 0UL, &exception, &status) == NO, 0L)) || (RKL_EXPECTED(status > U_ZERO_ERROR, 0L))) { *(NSRange *)result = NSNotFoundRange; goto exitNow; } + if(RKL_EXPECTED(capture == 0L, 1L)) { *(NSRange *)result = cachedRegex->lastMatchRange; } else { if(RKL_EXPECTED(rkl_getRangeForCapture(cachedRegex, &status, (int32_t)capture, (NSRange *)result) > U_ZERO_ERROR, 0L)) { goto exitNow; } } + break; + + case RKLSplitOp: // Fall-thru... + case RKLArrayOfStringsOp: // Fall-thru... + case RKLCapturesArrayOp: // Fall-thru... + case RKLArrayOfCapturesOp: // Fall-thru... + case RKLDictionaryOfCapturesOp: // Fall-thru... + case RKLArrayOfDictionariesOfCapturesOp: + findAll = rkl_makeFindAll(stackRanges, *matchRange, 2048L, (2048UL * sizeof(NSRange)), 0UL, &rkl_scratchBuffer[0], &rkl_scratchBuffer[1], &rkl_scratchBuffer[2], &rkl_scratchBuffer[3], &rkl_scratchBuffer[4], 0L, capture, (((maskedRegexOp == RKLCapturesArrayOp) || (maskedRegexOp == RKLDictionaryOfCapturesOp)) ? 1L : NSIntegerMax)); + + if(RKL_EXPECTED(rkl_findRanges(cachedRegex, regexOp, &findAll, &exception, &status) == NO, 1L)) { + if(RKL_EXPECTED(findAll.found == 0L, 0L)) { resultObject = (maskedRegexOp == RKLDictionaryOfCapturesOp) ? [NSDictionary dictionary] : [NSArray array]; } + else { + if(dictionaryOp == YES) { resultObject = rkl_makeDictionary (cachedRegex, regexOp, &findAll, captureKeysCount, captureKeys, captureKeyIndexes, &exception); } + else { resultObject = rkl_makeArray (cachedRegex, regexOp, &findAll, &exception); } + } + } + + for(tmpIdx = 0UL; tmpIdx < _RKL_SCRATCH_BUFFERS; tmpIdx++) { if(RKL_EXPECTED(rkl_scratchBuffer[tmpIdx] != NULL, 0L)) { rkl_scratchBuffer[tmpIdx] = rkl_free(&rkl_scratchBuffer[tmpIdx]); } } + + break; + + case RKLReplaceOp: resultObject = rkl_replaceString(cachedRegex, matchString, stringU16Length, replacementString, (NSUInteger)CFStringGetLength((CFStringRef)replacementString), (NSInteger *)result, (replaceMutable = (((regexOp & RKLReplaceMutable) != 0) ? 1UL : 0UL)), &exception, &status); break; + + default: exception = RKLCAssertDictionary(@"Unknown regexOp code."); break; + } + +exitNow: + OSSpinLockUnlock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLUnlockedCacheSpinLock; // Warning about rkl_cacheSpinLockStatus never being read can be safely ignored. + + if(RKL_EXPECTED(status > U_ZERO_ERROR, 0L) && RKL_EXPECTED(exception == NULL, 0L)) { exception = rkl_NSExceptionForRegex(regexString, options, NULL, status); } // If we had a problem, prepare an exception to be thrown. + if(RKL_EXPECTED(exception != NULL, 0L)) { rkl_handleDelayedAssert(self, _cmd, exception); } // If there is an exception, throw it at this point. + // If we're working on a mutable string and there were successful matches/replacements, then we still have work to do. + // This is done outside the cache lock and with the objc replaceCharactersInRange:withString: method because Core Foundation + // does not assert that the string we are attempting to update is actually a mutable string, whereas Foundation ensures + // the object receiving the message is a mutable string and throws an exception if we're attempting to modify an immutable string. + if(RKL_EXPECTED(replaceMutable == 1UL, 0L) && RKL_EXPECTED(*((NSInteger *)result) > 0L, 1L) && RKL_EXPECTED(status == U_ZERO_ERROR, 1L) && RKL_EXPECTED(resultObject != NULL, 1L)) { [matchString replaceCharactersInRange:*matchRange withString:resultObject]; } + // If status < U_ZERO_ERROR, consider it an error, even though status < U_ZERO_ERROR is a 'warning' in ICU nomenclature. + // status > U_ZERO_ERROR are an exception and handled above. + // http://sourceforge.net/tracker/?func=detail&atid=990188&aid=2890810&group_id=204582 + if(RKL_EXPECTED(status < U_ZERO_ERROR, 0L) && RKL_EXPECTED(resultObject == NULL, 0L) && (error != NULL)) { + NSString *replacedString = NULL; + NSInteger replacedCount = 0L; + RKLUserInfoOptions userInfoOptions = RKLUserInfoNone; + if((maskedRegexOp == RKLReplaceOp) && (result != NULL)) { userInfoOptions |= RKLUserInfoReplacedCount; replacedString = resultObject; replacedCount = *((NSInteger *)result); } + if(matchRange != NULL) { userInfoOptions |= RKLUserInfoSubjectRange; } + *error = rkl_makeNSError(userInfoOptions, regexString, options, NULL, status, matchString, (matchRange != NULL) ? *matchRange : NSNotFoundRange, replacementString, replacedString, replacedCount, (RKLRegexEnumerationOptions)RKLRegexEnumerationNoOptions, @"The ICU library returned an unexpected error."); + } + return(resultObject); +} + +static void rkl_handleDelayedAssert(id self, SEL _cmd, id exception) { + if(RKL_EXPECTED(exception != NULL, 1L)) { + if([exception isKindOfClass:[NSException class]]) { [[NSException exceptionWithName:[exception name] reason:rkl_stringFromClassAndMethod(self, _cmd, [exception reason]) userInfo:[exception userInfo]] raise]; } + else { + id functionString = [exception objectForKey:@"function"], fileString = [exception objectForKey:@"file"], descriptionString = [exception objectForKey:@"description"], lineNumber = [exception objectForKey:@"line"]; + RKLCHardAbortAssert((functionString != NULL) && (fileString != NULL) && (descriptionString != NULL) && (lineNumber != NULL)); + [[NSAssertionHandler currentHandler] handleFailureInFunction:functionString file:fileString lineNumber:(NSInteger)[lineNumber longValue] description:descriptionString]; + } + } +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_performRegexOp() or rkl_findRanges(). +// ---------- + +#pragma mark Primary means of performing a search with a regular expression + +static NSUInteger rkl_search(RKLCachedRegex *cachedRegex, NSRange *searchRange, NSUInteger updateSearchRange, id *exception RKL_UNUSED_ASSERTION_ARG, int32_t *status) { + NSUInteger foundMatch = 0UL; + + if((NSEqualRanges(*searchRange, cachedRegex->lastFindRange) == YES) && ((cachedRegex->lastMatchRange.length > 0UL) || (cachedRegex->lastMatchRange.location == (NSUInteger)NSNotFound))) { foundMatch = ((cachedRegex->lastMatchRange.location == (NSUInteger)NSNotFound) ? 0UL : 1UL);} + else { // Only perform an expensive 'find' operation iff the current find range is different than the last find range. + NSUInteger findLocation = (searchRange->location - cachedRegex->setToRange.location); + RKLCDelayedAssert(((searchRange->location >= cachedRegex->setToRange.location)) && (NSRangeInsideRange(*searchRange, cachedRegex->setToRange) == YES) && (findLocation < INT_MAX) && (findLocation <= cachedRegex->setToRange.length), exception, exitNow); + + RKL_PREFETCH_UNICHAR(cachedRegex->setToUniChar, searchRange->location); // Spool up the CPU caches. + + // Using uregex_findNext can be a slight performance win. + NSUInteger useFindNext = (RKL_EXPECTED(searchRange->location == (NSMaxRange(cachedRegex->lastMatchRange) + ((RKL_EXPECTED(cachedRegex->lastMatchRange.length == 0UL, 0L) && RKL_EXPECTED(cachedRegex->lastMatchRange.location < NSMaxRange(cachedRegex->setToRange), 0L)) ? 1UL : 0UL)), 1L) ? 1UL : 0UL); + + cachedRegex->lastFindRange = *searchRange; + if(RKL_EXPECTED(useFindNext == 0UL, 0L)) { if(RKL_EXPECTED((RKL_ICU_FUNCTION_APPEND(uregex_find) (cachedRegex->icu_regex, (int32_t)findLocation, status) == NO), 0L) || RKL_EXPECTED(*status > U_ZERO_ERROR, 0L)) { goto finishedFind; } } + else { if(RKL_EXPECTED((RKL_ICU_FUNCTION_APPEND(uregex_findNext)(cachedRegex->icu_regex, status) == NO), 0L) || RKL_EXPECTED(*status > U_ZERO_ERROR, 0L)) { goto finishedFind; } } + foundMatch = 1UL; + + if(RKL_EXPECTED(rkl_getRangeForCapture(cachedRegex, status, 0, &cachedRegex->lastMatchRange) > U_ZERO_ERROR, 0L)) { goto finishedFind; } + RKLCDelayedAssert(NSRangeInsideRange(cachedRegex->lastMatchRange, *searchRange) == YES, exception, exitNow); + } + +finishedFind: + if(RKL_EXPECTED(*status > U_ZERO_ERROR, 0L)) { foundMatch = 0UL; cachedRegex->lastFindRange = NSNotFoundRange; } + + if(RKL_EXPECTED(foundMatch == 0UL, 0L)) { cachedRegex->lastFindRange = NSNotFoundRange; cachedRegex->lastMatchRange = NSNotFoundRange; if(RKL_EXPECTED(updateSearchRange == 1UL, 1L)) { *searchRange = NSMakeRange(NSMaxRange(*searchRange), 0UL); } } + else { + RKLCDelayedAssert(NSRangeInsideRange(cachedRegex->lastMatchRange, *searchRange) == YES, exception, exitNow); + if(RKL_EXPECTED(updateSearchRange == 1UL, 1L)) { + NSUInteger nextLocation = (NSMaxRange(cachedRegex->lastMatchRange) + ((RKL_EXPECTED(cachedRegex->lastMatchRange.length == 0UL, 0L) && RKL_EXPECTED(cachedRegex->lastMatchRange.location < NSMaxRange(cachedRegex->setToRange), 1L)) ? 1UL : 0UL)), locationDiff = nextLocation - searchRange->location; + RKLCDelayedAssert((((locationDiff > 0UL) || ((locationDiff == 0UL) && (cachedRegex->lastMatchRange.location == NSMaxRange(cachedRegex->setToRange)))) && (locationDiff <= searchRange->length)), exception, exitNow); + searchRange->location = nextLocation; + searchRange->length -= locationDiff; + } + } + +#ifndef NS_BLOCK_ASSERTIONS +exitNow: +#endif + return(foundMatch); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_performRegexOp() or rkl_performEnumerationUsingBlock(). +// ---------- + +#pragma mark Used to perform multiple searches at once and return the NSRange results in bulk + +static BOOL rkl_findRanges(RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, id *exception, int32_t *status) { + BOOL returnWithError = YES; + RKLCDelayedAssert((((cachedRegex != NULL) && (cachedRegex->icu_regex != NULL) && (cachedRegex->setToUniChar != NULL) && (cachedRegex->captureCount >= 0L) && (cachedRegex->setToRange.location != (NSUInteger)NSNotFound)) && (status != NULL) && ((findAll != NULL) && (findAll->found == 0L) && (findAll->addedSplitRanges == 0L) && ((findAll->capacity >= 0L) && (((findAll->capacity > 0L) || (findAll->size > 0UL)) ? ((findAll->ranges != NULL) && (findAll->capacity > 0L) && (findAll->size > 0UL)) : 1)) && ((findAll->capture >= 0L) && (findAll->capture <= cachedRegex->captureCount)))), exception, exitNow); + + NSInteger captureCount = cachedRegex->captureCount, findAllRangeIndexOfLastNonZeroLength = 0L; + NSUInteger lastLocation = findAll->findInRange.location; + RKLRegexOp maskedRegexOp = (regexOp & RKLMaskOp); + NSRange searchRange = findAll->findInRange; + + for(findAll->found = 0L; (findAll->found < findAll->findUpTo) && ((findAll->found < findAll->capacity) || (findAll->found == 0L)); findAll->found++) { + NSInteger loopCapture, shouldBreak = 0L; + + if(RKL_EXPECTED(findAll->found >= ((findAll->capacity - ((captureCount + 2L) * 4L)) - 4L), 0L)) { if(RKL_EXPECTED(rkl_growFindRanges(cachedRegex, lastLocation, findAll, exception) == 0UL, 0L)) { goto exitNow; } } + + RKLCDelayedAssert((searchRange.location != (NSUInteger)NSNotFound) && (NSRangeInsideRange(searchRange, cachedRegex->setToRange) == YES) && (NSRangeInsideRange(findAll->findInRange, cachedRegex->setToRange) == YES), exception, exitNow); + + // This fixes a 'bug' that is also present in ICU's uregex_split(). 'Bug', in this case, means that the results of a split operation can differ from those that perl's split() creates for the same input. + // "I|at|ice I eat rice" split using the regex "\b\s*" demonstrates the problem. ICU bug http://bugs.icu-project.org/trac/ticket/6826 + // ICU : "", "I", "|", "at", "|", "ice", "", "I", "", "eat", "", "rice" <- Results that RegexKitLite used to produce. + // PERL: "I", "|", "at", "|", "ice", "I", "eat", "rice" <- Results that RegexKitLite now produces. + do { if((rkl_search(cachedRegex, &searchRange, 1UL, exception, status) == NO) || (RKL_EXPECTED(*status > U_ZERO_ERROR, 0L))) { shouldBreak = 1L; } findAll->remainingRange = searchRange; } + while(RKL_EXPECTED((cachedRegex->lastMatchRange.location - lastLocation) == 0UL, 0L) && RKL_EXPECTED(cachedRegex->lastMatchRange.length == 0UL, 0L) && (maskedRegexOp == RKLSplitOp) && RKL_EXPECTED(shouldBreak == 0L, 1L)); + if(RKL_EXPECTED(shouldBreak == 1L, 0L)) { break; } + + RKLCDelayedAssert((searchRange.location != (NSUInteger)NSNotFound) && (NSRangeInsideRange(searchRange, cachedRegex->setToRange) == YES) && (NSRangeInsideRange(findAll->findInRange, cachedRegex->setToRange) == YES) && (NSRangeInsideRange(searchRange, findAll->findInRange) == YES), exception, exitNow); + RKLCDelayedAssert((NSRangeInsideRange(cachedRegex->lastFindRange, cachedRegex->setToRange) == YES) && (NSRangeInsideRange(cachedRegex->lastMatchRange, cachedRegex->setToRange) == YES) && (NSRangeInsideRange(cachedRegex->lastMatchRange, findAll->findInRange) == YES), exception, exitNow); + RKLCDelayedAssert((findAll->ranges != NULL) && (findAll->found >= 0L) && (findAll->capacity >= 0L) && ((findAll->found + (captureCount + 3L) + 1L) < (findAll->capacity - 2L)), exception, exitNow); + + NSInteger findAllRangesIndexForCapture0 = findAll->found; + switch(maskedRegexOp) { + case RKLArrayOfStringsOp: + if(findAll->capture == 0L) { findAll->ranges[findAll->found] = cachedRegex->lastMatchRange; } else { if(RKL_EXPECTED(rkl_getRangeForCapture(cachedRegex, status, (int32_t)findAll->capture, &findAll->ranges[findAll->found]) > U_ZERO_ERROR, 0L)) { goto exitNow; } } + break; + + case RKLSplitOp: // Fall-thru... + case RKLCapturesArrayOp: // Fall-thru... + case RKLDictionaryOfCapturesOp: // Fall-thru... + case RKLArrayOfDictionariesOfCapturesOp: // Fall-thru... + case RKLArrayOfCapturesOp: + findAll->ranges[findAll->found] = ((maskedRegexOp == RKLSplitOp) ? NSMakeRange(lastLocation, cachedRegex->lastMatchRange.location - lastLocation) : cachedRegex->lastMatchRange); + + for(loopCapture = 1L; loopCapture <= captureCount; loopCapture++) { + RKLCDelayedAssert((findAll->found >= 0L) && (findAll->found < (findAll->capacity - 2L)) && (loopCapture < INT_MAX), exception, exitNow); + if(RKL_EXPECTED(rkl_getRangeForCapture(cachedRegex, status, (int32_t)loopCapture, &findAll->ranges[++findAll->found]) > U_ZERO_ERROR, 0L)) { goto exitNow; } + } + break; + + default: if(*exception == NULL) { *exception = RKLCAssertDictionary(@"Unknown regexOp."); } goto exitNow; break; + } + + if(findAll->ranges[findAllRangesIndexForCapture0].length > 0UL) { findAllRangeIndexOfLastNonZeroLength = findAll->found + 1UL; } + lastLocation = NSMaxRange(cachedRegex->lastMatchRange); + } + + if(RKL_EXPECTED(*status > U_ZERO_ERROR, 0L)) { goto exitNow; } + + RKLCDelayedAssert((findAll->ranges != NULL) && (findAll->found >= 0L) && (findAll->found < (findAll->capacity - 2L)), exception, exitNow); + if(maskedRegexOp == RKLSplitOp) { + if(lastLocation != NSMaxRange(findAll->findInRange)) { findAll->addedSplitRanges++; findAll->ranges[findAll->found++] = NSMakeRange(lastLocation, NSMaxRange(findAll->findInRange) - lastLocation); findAllRangeIndexOfLastNonZeroLength = findAll->found; } + findAll->found = findAllRangeIndexOfLastNonZeroLength; + } + + RKLCDelayedAssert((findAll->ranges != NULL) && (findAll->found >= 0L) && (findAll->found < (findAll->capacity - 2L)), exception, exitNow); + returnWithError = NO; + +exitNow: + return(returnWithError); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_findRanges(). +// ---------- + +static NSUInteger rkl_growFindRanges(RKLCachedRegex *cachedRegex, NSUInteger lastLocation, RKLFindAll *findAll, id *exception RKL_UNUSED_ASSERTION_ARG) { + NSUInteger didGrowRanges = 0UL; + RKLCDelayedAssert((((cachedRegex != NULL) && (cachedRegex->captureCount >= 0L)) && ((findAll != NULL) && (findAll->capacity >= 0L) && (findAll->rangesScratchBuffer != NULL) && (findAll->found >= 0L) && (((findAll->capacity > 0L) || (findAll->size > 0UL) || (findAll->ranges != NULL)) ? ((findAll->capacity > 0L) && (findAll->size > 0UL) && (findAll->ranges != NULL) && (((size_t)findAll->capacity * sizeof(NSRange)) == findAll->size)) : 1))), exception, exitNow); + + // Attempt to guesstimate the required capacity based on: the total length needed to search / (length we've searched so far / ranges found so far). + NSInteger newCapacity = (findAll->capacity + (findAll->capacity / 2L)), estimate = (NSInteger)((float)cachedRegex->setToLength / (((float)lastLocation + 1.0f) / ((float)findAll->found + 1.0f))); + newCapacity = (((newCapacity + ((estimate > newCapacity) ? estimate : newCapacity)) / 2L) + ((cachedRegex->captureCount + 2L) * 4L) + 4L); + + NSUInteger needToCopy = ((*findAll->rangesScratchBuffer != findAll->ranges) && (findAll->ranges != NULL)) ? 1UL : 0UL; // If findAll->ranges is set to a stack allocation then we need to manually copy the data from the stack to the new heap allocation. + size_t newSize = ((size_t)newCapacity * sizeof(NSRange)); + RKL_STRONG_REF NSRange * RKL_GC_VOLATILE newRanges = NULL; + + if(RKL_EXPECTED((newRanges = (RKL_STRONG_REF NSRange * RKL_GC_VOLATILE)rkl_realloc((RKL_STRONG_REF void ** RKL_GC_VOLATILE)findAll->rangesScratchBuffer, newSize, 0UL)) == NULL, 0L)) { findAll->capacity = 0L; findAll->size = 0UL; findAll->ranges = NULL; *findAll->rangesScratchBuffer = rkl_free((RKL_STRONG_REF void ** RKL_GC_VOLATILE)findAll->rangesScratchBuffer); goto exitNow; } else { didGrowRanges = 1UL; } + if(needToCopy == 1UL) { memcpy(newRanges, findAll->ranges, findAll->size); } // If necessary, copy the existing data to the new heap allocation. + + findAll->capacity = newCapacity; + findAll->size = newSize; + findAll->ranges = newRanges; + +exitNow: + return(didGrowRanges); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_performRegexOp(). +// ---------- + +#pragma mark Convert bulk results from rkl_findRanges in to various NSArray types + +static NSArray *rkl_makeArray(RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, id *exception RKL_UNUSED_ASSERTION_ARG) { + NSUInteger createdStringsCount = 0UL, createdArraysCount = 0UL, transferredStringsCount = 0UL; + id * RKL_GC_VOLATILE matchedStrings = NULL, * RKL_GC_VOLATILE subcaptureArrays = NULL, emptyString = @""; + NSArray * RKL_GC_VOLATILE resultArray = NULL; + + RKLCDelayedAssert((cachedRegex != NULL) && ((findAll != NULL) && (findAll->found >= 0L) && (findAll->stringsScratchBuffer != NULL) && (findAll->arraysScratchBuffer != NULL)), exception, exitNow); + + size_t matchedStringsSize = ((size_t)findAll->found * sizeof(id)); + CFStringRef setToString = cachedRegex->setToString; + + if((findAll->stackUsed + matchedStringsSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((matchedStrings = (id * RKL_GC_VOLATILE)alloca(matchedStringsSize)) == NULL, 0L)) { goto exitNow; } findAll->stackUsed += matchedStringsSize; } + else { if(RKL_EXPECTED((matchedStrings = (id * RKL_GC_VOLATILE)rkl_realloc(findAll->stringsScratchBuffer, matchedStringsSize, (NSUInteger)RKLScannedOption)) == NULL, 0L)) { goto exitNow; } } + + { // This sub-block (and its local variables) is here for the benefit of the optimizer. + NSUInteger found = (NSUInteger)findAll->found; + const NSRange *rangePtr = findAll->ranges; + id *matchedStringsPtr = matchedStrings; + + for(createdStringsCount = 0UL; createdStringsCount < found; createdStringsCount++) { + NSRange range = *rangePtr++; + if(RKL_EXPECTED(((*matchedStringsPtr++ = RKL_EXPECTED(range.length == 0UL, 0L) ? emptyString : rkl_CreateStringWithSubstring((id)setToString, range)) == NULL), 0L)) { goto exitNow; } + } + } + + NSUInteger arrayCount = createdStringsCount; + id * RKL_GC_VOLATILE arrayObjects = matchedStrings; + + if((regexOp & RKLSubcapturesArray) != 0UL) { + RKLCDelayedAssert(((createdStringsCount % ((NSUInteger)cachedRegex->captureCount + 1UL)) == 0UL) && (createdArraysCount == 0UL), exception, exitNow); + + NSUInteger captureCount = ((NSUInteger)cachedRegex->captureCount + 1UL); + NSUInteger subcaptureArraysCount = (createdStringsCount / captureCount); + size_t subcaptureArraysSize = ((size_t)subcaptureArraysCount * sizeof(id)); + + if((findAll->stackUsed + subcaptureArraysSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((subcaptureArrays = (id * RKL_GC_VOLATILE)alloca(subcaptureArraysSize)) == NULL, 0L)) { goto exitNow; } findAll->stackUsed += subcaptureArraysSize; } + else { if(RKL_EXPECTED((subcaptureArrays = (id * RKL_GC_VOLATILE)rkl_realloc(findAll->arraysScratchBuffer, subcaptureArraysSize, (NSUInteger)RKLScannedOption)) == NULL, 0L)) { goto exitNow; } } + + { // This sub-block (and its local variables) is here for the benefit of the optimizer. + id *subcaptureArraysPtr = subcaptureArrays; + id *matchedStringsPtr = matchedStrings; + + for(createdArraysCount = 0UL; createdArraysCount < subcaptureArraysCount; createdArraysCount++) { + if(RKL_EXPECTED((*subcaptureArraysPtr++ = rkl_CreateArrayWithObjects((void **)matchedStringsPtr, captureCount)) == NULL, 0L)) { goto exitNow; } + matchedStringsPtr += captureCount; + transferredStringsCount += captureCount; + } + } + + RKLCDelayedAssert((transferredStringsCount == createdStringsCount), exception, exitNow); + arrayCount = createdArraysCount; + arrayObjects = subcaptureArrays; + } + + RKLCDelayedAssert((arrayObjects != NULL), exception, exitNow); + resultArray = rkl_CreateAutoreleasedArray((void **)arrayObjects, (NSUInteger)arrayCount); + +exitNow: + if(RKL_EXPECTED(resultArray == NULL, 0L) && (rkl_collectingEnabled() == NO)) { // If we did not create an array then we need to make sure that we release any objects we created. + NSUInteger x; + if(matchedStrings != NULL) { for(x = transferredStringsCount; x < createdStringsCount; x++) { if((matchedStrings[x] != NULL) && (matchedStrings[x] != emptyString)) { matchedStrings[x] = rkl_ReleaseObject(matchedStrings[x]); } } } + if(subcaptureArrays != NULL) { for(x = 0UL; x < createdArraysCount; x++) { if(subcaptureArrays[x] != NULL) { subcaptureArrays[x] = rkl_ReleaseObject(subcaptureArrays[x]); } } } + } + + return(resultArray); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_performRegexOp(). +// ---------- + +#pragma mark Convert bulk results from rkl_findRanges in to various NSDictionary types + +static id rkl_makeDictionary(RKLCachedRegex *cachedRegex, RKLRegexOp regexOp, RKLFindAll *findAll, NSUInteger captureKeysCount, id captureKeys[captureKeysCount], const int captureKeyIndexes[captureKeysCount], id *exception RKL_UNUSED_ASSERTION_ARG) { + NSUInteger matchedStringIndex = 0UL, createdStringsCount = 0UL, createdDictionariesCount = 0UL, matchedDictionariesCount = (findAll->found / (cachedRegex->captureCount + 1UL)), transferredDictionariesCount = 0UL; + id * RKL_GC_VOLATILE matchedStrings = NULL, * RKL_GC_VOLATILE matchedKeys = NULL, emptyString = @""; + id RKL_GC_VOLATILE returnObject = NULL; + NSDictionary ** RKL_GC_VOLATILE matchedDictionaries = NULL; + + RKLCDelayedAssert((cachedRegex != NULL) && ((findAll != NULL) && (findAll->found >= 0L) && (findAll->stringsScratchBuffer != NULL) && (findAll->dictionariesScratchBuffer != NULL) && (findAll->keysScratchBuffer != NULL) && (captureKeyIndexes != NULL)), exception, exitNow); + + CFStringRef setToString = cachedRegex->setToString; + + size_t matchedStringsSize = ((size_t)captureKeysCount * sizeof(void *)); + if((findAll->stackUsed + matchedStringsSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((matchedStrings = (id * RKL_GC_VOLATILE)alloca(matchedStringsSize)) == NULL, 0L)) { goto exitNow; } findAll->stackUsed += matchedStringsSize; } + else { if(RKL_EXPECTED((matchedStrings = (id * RKL_GC_VOLATILE)rkl_realloc(findAll->stringsScratchBuffer, matchedStringsSize, (NSUInteger)RKLScannedOption)) == NULL, 0L)) { goto exitNow; } } + + size_t matchedKeysSize = ((size_t)captureKeysCount * sizeof(void *)); + if((findAll->stackUsed + matchedKeysSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((matchedKeys = (id * RKL_GC_VOLATILE)alloca(matchedKeysSize)) == NULL, 0L)) { goto exitNow; } findAll->stackUsed += matchedKeysSize; } + else { if(RKL_EXPECTED((matchedKeys = (id * RKL_GC_VOLATILE)rkl_realloc(findAll->keysScratchBuffer, matchedKeysSize, (NSUInteger)RKLScannedOption)) == NULL, 0L)) { goto exitNow; } } + + size_t matchedDictionariesSize = ((size_t)matchedDictionariesCount * sizeof(NSDictionary *)); + if((findAll->stackUsed + matchedDictionariesSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((matchedDictionaries = (NSDictionary ** RKL_GC_VOLATILE)alloca(matchedDictionariesSize)) == NULL, 0L)) { goto exitNow; } findAll->stackUsed += matchedDictionariesSize; } + else { if(RKL_EXPECTED((matchedDictionaries = (NSDictionary ** RKL_GC_VOLATILE)rkl_realloc(findAll->dictionariesScratchBuffer, matchedDictionariesSize, (NSUInteger)RKLScannedOption)) == NULL, 0L)) { goto exitNow; } } + + { // This sub-block (and its local variables) is here for the benefit of the optimizer. + NSUInteger captureCount = cachedRegex->captureCount; + NSDictionary **matchedDictionariesPtr = matchedDictionaries; + + for(createdDictionariesCount = 0UL; createdDictionariesCount < matchedDictionariesCount; createdDictionariesCount++) { + RKLCDelayedAssert(((createdDictionariesCount * captureCount) < (NSUInteger)findAll->found), exception, exitNow); + RKL_STRONG_REF const NSRange * RKL_GC_VOLATILE rangePtr = &findAll->ranges[(createdDictionariesCount * (captureCount + 1UL))]; + for(matchedStringIndex = 0UL; matchedStringIndex < captureKeysCount; matchedStringIndex++) { + NSRange range = rangePtr[captureKeyIndexes[matchedStringIndex]]; + if(RKL_EXPECTED(range.location != NSNotFound, 0L)) { + if(RKL_EXPECTED(((matchedStrings[createdStringsCount] = RKL_EXPECTED(range.length == 0UL, 0L) ? emptyString : rkl_CreateStringWithSubstring((id)setToString, range)) == NULL), 0L)) { goto exitNow; } + matchedKeys[createdStringsCount] = captureKeys[createdStringsCount]; + createdStringsCount++; + } + } + RKLCDelayedAssert((matchedStringIndex <= captureCount), exception, exitNow); + if(RKL_EXPECTED(((*matchedDictionariesPtr++ = (NSDictionary * RKL_GC_VOLATILE)CFDictionaryCreate(NULL, (const void **)matchedKeys, (const void **)matchedStrings, (CFIndex)createdStringsCount, &rkl_transferOwnershipDictionaryKeyCallBacks, &rkl_transferOwnershipDictionaryValueCallBacks)) == NULL), 0L)) { goto exitNow; } + createdStringsCount = 0UL; + } + } + + if(createdDictionariesCount > 0UL) { + if((regexOp & RKLMaskOp) == RKLArrayOfDictionariesOfCapturesOp) { + RKLCDelayedAssert((matchedDictionaries != NULL) && (createdDictionariesCount > 0UL), exception, exitNow); + if((returnObject = rkl_CreateAutoreleasedArray((void **)matchedDictionaries, createdDictionariesCount)) == NULL) { goto exitNow; } + transferredDictionariesCount = createdDictionariesCount; + } else { + RKLCDelayedAssert((matchedDictionaries != NULL) && (createdDictionariesCount == 1UL), exception, exitNow); + if((returnObject = rkl_CFAutorelease(matchedDictionaries[0])) == NULL) { goto exitNow; } + transferredDictionariesCount = 1UL; + } + } + +exitNow: + RKLCDelayedAssert((createdDictionariesCount <= transferredDictionariesCount) && ((transferredDictionariesCount > 0UL) ? (createdStringsCount == 0UL) : 1), exception, exitNow2); +#ifndef NS_BLOCK_ASSERTIONS +exitNow2: +#endif + + if(rkl_collectingEnabled() == NO) { // Release any objects, if necessary. + NSUInteger x; + if(matchedStrings != NULL) { for(x = 0UL; x < createdStringsCount; x++) { if((matchedStrings[x] != NULL) && (matchedStrings[x] != emptyString)) { matchedStrings[x] = rkl_ReleaseObject(matchedStrings[x]); } } } + if(matchedDictionaries != NULL) { for(x = transferredDictionariesCount; x < createdDictionariesCount; x++) { if((matchedDictionaries[x] != NULL)) { matchedDictionaries[x] = rkl_ReleaseObject(matchedDictionaries[x]); } } } + } + + return(returnObject); +} + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// IMPORTANT! Should only be called from rkl_performRegexOp(). +// ---------- + +#pragma mark Perform "search and replace" operations on strings using ICUs uregex_*replace* functions + +static NSString *rkl_replaceString(RKLCachedRegex *cachedRegex, id searchString, NSUInteger searchU16Length, NSString *replacementString, NSUInteger replacementU16Length, NSInteger *replacedCountPtr, NSUInteger replaceMutable, id *exception, int32_t *status) { + RKL_STRONG_REF UniChar * RKL_GC_VOLATILE tempUniCharBuffer = NULL; + RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE replacementUniChar = NULL; + uint64_t searchU16Length64 = (uint64_t)searchU16Length, replacementU16Length64 = (uint64_t)replacementU16Length; + int32_t resultU16Length = 0, tempUniCharBufferU16Capacity = 0, needU16Capacity = 0; + id RKL_GC_VOLATILE resultObject = NULL; + NSInteger replacedCount = -1L; + + if((RKL_EXPECTED(replacementU16Length64 >= (uint64_t)INT_MAX, 0L) || RKL_EXPECTED(((searchU16Length64 / 2ULL) + (replacementU16Length64 * 2ULL)) >= (uint64_t)INT_MAX, 0L))) { *exception = [NSException exceptionWithName:NSRangeException reason:@"Replacement string length exceeds INT_MAX." userInfo:NULL]; goto exitNow; } + + RKLCDelayedAssert((searchU16Length64 < (uint64_t)INT_MAX) && (replacementU16Length64 < (uint64_t)INT_MAX) && (((searchU16Length64 / 2ULL) + (replacementU16Length64 * 2ULL)) < (uint64_t)INT_MAX), exception, exitNow); + + // Zero order approximation of the buffer sizes for holding the replaced string or split strings and split strings pointer offsets. As UTF16 code units. + tempUniCharBufferU16Capacity = (int32_t)(16UL + (searchU16Length + (searchU16Length / 2UL)) + (replacementU16Length * 2UL)); + RKLCDelayedAssert((tempUniCharBufferU16Capacity < INT_MAX) && (tempUniCharBufferU16Capacity > 0), exception, exitNow); + + // Buffer sizes converted from native units to bytes. + size_t stackSize = 0UL, replacementSize = ((size_t)replacementU16Length * sizeof(UniChar)), tempUniCharBufferSize = ((size_t)tempUniCharBufferU16Capacity * sizeof(UniChar)); + + // For the various buffers we require, we first try to allocate from the stack if we're not over the RKL_STACK_LIMIT. If we are, switch to using the heap for the buffer. + if((stackSize + tempUniCharBufferSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((tempUniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)alloca(tempUniCharBufferSize)) == NULL, 0L)) { goto exitNow; } stackSize += tempUniCharBufferSize; } + else { if(RKL_EXPECTED((tempUniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc(&rkl_scratchBuffer[0], tempUniCharBufferSize, 0UL)) == NULL, 0L)) { goto exitNow; } } + + // Try to get the pointer to the replacement strings UTF16 data. If we can't, allocate some buffer space, then covert to UTF16. + if((replacementUniChar = CFStringGetCharactersPtr((CFStringRef)replacementString)) == NULL) { + RKL_STRONG_REF UniChar * RKL_GC_VOLATILE uniCharBuffer = NULL; + if((stackSize + replacementSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((uniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)alloca(replacementSize)) == NULL, 0L)) { goto exitNow; } stackSize += replacementSize; } + else { if(RKL_EXPECTED((uniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc(&rkl_scratchBuffer[1], replacementSize, 0UL)) == NULL, 0L)) { goto exitNow; } } + CFStringGetCharacters((CFStringRef)replacementString, CFMakeRange(0L, replacementU16Length), uniCharBuffer); // Convert to a UTF16 string. + replacementUniChar = uniCharBuffer; + } + + resultU16Length = rkl_replaceAll(cachedRegex, replacementUniChar, (int32_t)replacementU16Length, tempUniCharBuffer, tempUniCharBufferU16Capacity, &replacedCount, &needU16Capacity, exception, status); + RKLCDelayedAssert((resultU16Length <= tempUniCharBufferU16Capacity) && (needU16Capacity >= resultU16Length) && (needU16Capacity >= 0), exception, exitNow); + if(RKL_EXPECTED((needU16Capacity + 4) >= INT_MAX, 0L)) { *exception = [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Replaced string length exceeds INT_MAX." userInfo:NULL]; goto exitNow; } + + if(RKL_EXPECTED(*status == U_BUFFER_OVERFLOW_ERROR, 0L)) { // Our buffer guess(es) were too small. Resize the buffers and try again. + // rkl_replaceAll will turn a status of U_STRING_NOT_TERMINATED_WARNING in to a U_BUFFER_OVERFLOW_ERROR. + // As an extra precaution, we pad out the amount needed by an extra four characters "just in case". + // http://lists.apple.com/archives/Cocoa-dev/2010/Jan/msg01011.html + needU16Capacity += 4; + tempUniCharBufferSize = ((size_t)(tempUniCharBufferU16Capacity = needU16Capacity + 4) * sizeof(UniChar)); // Use needU16Capacity. Bug 2890810. + if((stackSize + tempUniCharBufferSize) < (size_t)_RKL_STACK_LIMIT) { if(RKL_EXPECTED((tempUniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)alloca(tempUniCharBufferSize)) == NULL, 0L)) { goto exitNow; } stackSize += tempUniCharBufferSize; } // Warning about stackSize can be safely ignored. + else { if(RKL_EXPECTED((tempUniCharBuffer = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc(&rkl_scratchBuffer[0], tempUniCharBufferSize, 0UL)) == NULL, 0L)) { goto exitNow; } } + + *status = U_ZERO_ERROR; // Make sure the status var is cleared and try again. + resultU16Length = rkl_replaceAll(cachedRegex, replacementUniChar, (int32_t)replacementU16Length, tempUniCharBuffer, tempUniCharBufferU16Capacity, &replacedCount, &needU16Capacity, exception, status); + RKLCDelayedAssert((resultU16Length <= tempUniCharBufferU16Capacity) && (needU16Capacity >= resultU16Length) && (needU16Capacity >= 0), exception, exitNow); + } + + // If status != U_ZERO_ERROR, consider it an error, even though status < U_ZERO_ERROR is a 'warning' in ICU nomenclature. + // http://sourceforge.net/tracker/?func=detail&atid=990188&aid=2890810&group_id=204582 + if(RKL_EXPECTED(*status != U_ZERO_ERROR, 0L)) { goto exitNow; } // Something went wrong. + + RKLCDelayedAssert((replacedCount >= 0L), exception, exitNow); + if(RKL_EXPECTED(resultU16Length == 0, 0L)) { resultObject = @""; } // Optimize the case where the replaced text length == 0 with a @"" string. + else if(RKL_EXPECTED((NSUInteger)resultU16Length == searchU16Length, 0L) && RKL_EXPECTED(replacedCount == 0L, 1L)) { // Optimize the case where the replacement == original by creating a copy. Very fast if self is immutable. + if(replaceMutable == 0UL) { resultObject = rkl_CFAutorelease(CFStringCreateCopy(NULL, (CFStringRef)searchString)); } // .. but only if this is not replacing a mutable self. Warning about potential leak can be safely ignored. + } else { resultObject = rkl_CFAutorelease(CFStringCreateWithCharacters(NULL, tempUniCharBuffer, (CFIndex)resultU16Length)); } // otherwise, create a new string. Warning about potential leak can be safely ignored. + + // If replaceMutable == 1UL, we don't do the replacement here. We wait until after we return and unlock the cache lock. + // This is because we may be trying to mutate an immutable string object. + if((replaceMutable == 1UL) && RKL_EXPECTED(replacedCount > 0L, 1L)) { // We're working on a mutable string and there were successful matches with replaced text, so there's work to do. + if(cachedRegex->buffer != NULL) { rkl_clearBuffer(cachedRegex->buffer, 0UL); cachedRegex->buffer = NULL; } + NSUInteger idx = 0UL; + for(idx = 0UL; idx < _RKL_LRU_CACHE_SET_WAYS; idx++) { + RKLBuffer *buffer = ((NSUInteger)cachedRegex->setToLength < _RKL_FIXED_LENGTH) ? &rkl_lruFixedBuffer[idx] : &rkl_lruDynamicBuffer[idx]; + if(RKL_EXPECTED(cachedRegex->setToString == buffer->string, 0L) && (cachedRegex->setToLength == buffer->length) && (cachedRegex->setToHash == buffer->hash)) { rkl_clearBuffer(buffer, 0UL); } + } + rkl_clearCachedRegexSetTo(cachedRegex); // Flush any cached information about this string since it will mutate. + } + +exitNow: + if(RKL_EXPECTED(status == NULL, 0L) || RKL_EXPECTED(*status != U_ZERO_ERROR, 0L) || RKL_EXPECTED(exception == NULL, 0L) || RKL_EXPECTED(*exception != NULL, 0L)) { replacedCount = -1L; } + if(rkl_scratchBuffer[0] != NULL) { rkl_scratchBuffer[0] = rkl_free(&rkl_scratchBuffer[0]); } + if(rkl_scratchBuffer[1] != NULL) { rkl_scratchBuffer[1] = rkl_free(&rkl_scratchBuffer[1]); } + if(replacedCountPtr != NULL) { *replacedCountPtr = replacedCount; } + return(resultObject); +} // The two warnings about potential leaks can be safely ignored. + +// IMPORTANT! Should only be called from rkl_replaceString(). +// ---------- +// Modified version of the ICU libraries uregex_replaceAll() that keeps count of the number of replacements made. + +static int32_t rkl_replaceAll(RKLCachedRegex *cachedRegex, RKL_STRONG_REF const UniChar * RKL_GC_VOLATILE replacementUniChar, int32_t replacementU16Length, UniChar *replacedUniChar, int32_t replacedU16Capacity, NSInteger *replacedCount, int32_t *needU16Capacity, id *exception RKL_UNUSED_ASSERTION_ARG, int32_t *status) { + int32_t u16Length = 0, initialReplacedU16Capacity = replacedU16Capacity; + NSUInteger bufferOverflowed = 0UL; + NSInteger replaced = -1L; + RKLCDelayedAssert((cachedRegex != NULL) && (replacementUniChar != NULL) && (replacedUniChar != NULL) && (replacedCount != NULL) && (needU16Capacity != NULL) && (status != NULL) && (replacementU16Length >= 0) && (replacedU16Capacity >= 0), exception, exitNow); + + cachedRegex->lastFindRange = cachedRegex->lastMatchRange = NSNotFoundRange; // Clear the cached find information for this regex so a subsequent find works correctly. + RKL_ICU_FUNCTION_APPEND(uregex_reset)(cachedRegex->icu_regex, 0, status); + + // Work around for ICU uregex_reset() bug, see http://bugs.icu-project.org/trac/ticket/6545 + // http://sourceforge.net/tracker/index.php?func=detail&aid=2105213&group_id=204582&atid=990188 + if(RKL_EXPECTED(cachedRegex->setToRange.length == 0UL, 0L) && (*status == U_INDEX_OUTOFBOUNDS_ERROR)) { *status = U_ZERO_ERROR; } + replaced = 0L; + // This loop originally came from ICU source/i18n/uregex.cpp, uregex_replaceAll. + // There is a bug in that code which causes the size of the buffer required for the replaced text to not be calculated correctly. + // This contains a work around using the variable bufferOverflowed. + // ICU bug: http://bugs.icu-project.org/trac/ticket/6656 + // http://sourceforge.net/tracker/index.php?func=detail&aid=2408447&group_id=204582&atid=990188 + while(RKL_ICU_FUNCTION_APPEND(uregex_findNext)(cachedRegex->icu_regex, status)) { + replaced++; + u16Length += RKL_ICU_FUNCTION_APPEND(uregex_appendReplacement)(cachedRegex->icu_regex, replacementUniChar, replacementU16Length, &replacedUniChar, &replacedU16Capacity, status); + if(RKL_EXPECTED(*status == U_BUFFER_OVERFLOW_ERROR, 0L)) { bufferOverflowed = 1UL; *status = U_ZERO_ERROR; } + } + if(RKL_EXPECTED(*status == U_BUFFER_OVERFLOW_ERROR, 0L)) { bufferOverflowed = 1UL; *status = U_ZERO_ERROR; } + if(RKL_EXPECTED(*status <= U_ZERO_ERROR, 1L)) { u16Length += RKL_ICU_FUNCTION_APPEND(uregex_appendTail)(cachedRegex->icu_regex, &replacedUniChar, &replacedU16Capacity, status); } + + // Try to work around a status of U_STRING_NOT_TERMINATED_WARNING. For now, we treat it as a "Buffer Overflow" error. + // As an extra precaution, in rkl_replaceString, we pad out the amount needed by an extra four characters "just in case". + // http://lists.apple.com/archives/Cocoa-dev/2010/Jan/msg01011.html + if(RKL_EXPECTED(*status == U_STRING_NOT_TERMINATED_WARNING, 0L)) { *status = U_BUFFER_OVERFLOW_ERROR; } + + // Check for status <= U_ZERO_ERROR (a 'warning' in ICU nomenclature) rather than just status == U_ZERO_ERROR. + // Under just the right circumstances, status might be equal to U_STRING_NOT_TERMINATED_WARNING. When this occurred, + // rkl_replaceString would never get the U_BUFFER_OVERFLOW_ERROR status, and thus never grow the buffer to the size needed. + // http://sourceforge.net/tracker/?func=detail&atid=990188&aid=2890810&group_id=204582 + if(RKL_EXPECTED(bufferOverflowed == 1UL, 0L) && RKL_EXPECTED(*status <= U_ZERO_ERROR, 1L)) { *status = U_BUFFER_OVERFLOW_ERROR; } + +#ifndef NS_BLOCK_ASSERTIONS +exitNow: +#endif // NS_BLOCK_ASSERTIONS + if(RKL_EXPECTED(replacedCount != NULL, 1L)) { *replacedCount = replaced; } + if(RKL_EXPECTED(needU16Capacity != NULL, 1L)) { *needU16Capacity = u16Length; } // Use needU16Capacity to return the number of characters that are needed for the completely replaced string. Bug 2890810. + return(initialReplacedU16Capacity - replacedU16Capacity); // Return the number of characters of replacedUniChar that were used. +} + +#pragma mark Internal function used to check if a regular expression is valid. + +static NSUInteger rkl_isRegexValid(id self, SEL _cmd, NSString *regex, RKLRegexOptions options, NSInteger *captureCountPtr, NSError **error) { + volatile NSUInteger RKL_CLEANUP(rkl_cleanup_cacheSpinLockStatus) rkl_cacheSpinLockStatus = 0UL; + + RKLCachedRegex *cachedRegex = NULL; + NSUInteger gotCachedRegex = 0UL; + NSInteger captureCount = -1L; + id exception = NULL; + + if((error != NULL) && (*error != NULL)) { *error = NULL; } + if(RKL_EXPECTED(regex == NULL, 0L)) { RKL_RAISE_EXCEPTION(NSInvalidArgumentException, @"The regular expression argument is NULL."); } + + OSSpinLockLock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLLockedCacheSpinLock; + rkl_dtrace_incrementEventID(); + if(RKL_EXPECTED((cachedRegex = rkl_getCachedRegex(regex, options, error, &exception)) != NULL, 1L)) { gotCachedRegex = 1UL; captureCount = cachedRegex->captureCount; } + cachedRegex = NULL; + OSSpinLockUnlock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLUnlockedCacheSpinLock; // Warning about rkl_cacheSpinLockStatus never being read can be safely ignored. + + if(captureCountPtr != NULL) { *captureCountPtr = captureCount; } + if(RKL_EXPECTED(exception != NULL, 0L)) { rkl_handleDelayedAssert(self, _cmd, exception); } + return(gotCachedRegex); +} + +#pragma mark Functions used for clearing and releasing resources for various internal data structures + +static void rkl_clearStringCache(void) { + RKLCAbortAssert(rkl_cacheSpinLock != (OSSpinLock)0); + rkl_lastCachedRegex = NULL; + NSUInteger x = 0UL; + for(x = 0UL; x < _RKL_SCRATCH_BUFFERS; x++) { if(rkl_scratchBuffer[x] != NULL) { rkl_scratchBuffer[x] = rkl_free(&rkl_scratchBuffer[x]); } } + for(x = 0UL; x < _RKL_REGEX_CACHE_LINES; x++) { rkl_clearCachedRegex(&rkl_cachedRegexes[x]); } + for(x = 0UL; x < _RKL_LRU_CACHE_SET_WAYS; x++) { rkl_clearBuffer(&rkl_lruFixedBuffer[x], 0UL); rkl_clearBuffer(&rkl_lruDynamicBuffer[x], 1UL); } +} + +static void rkl_clearBuffer(RKLBuffer *buffer, NSUInteger freeDynamicBuffer) { + RKLCAbortAssert(buffer != NULL); + if(RKL_EXPECTED(buffer == NULL, 0L)) { return; } + if(RKL_EXPECTED(freeDynamicBuffer == 1UL, 0L) && RKL_EXPECTED(buffer->uniChar != NULL, 1L)) { RKL_STRONG_REF void * RKL_GC_VOLATILE p = (RKL_STRONG_REF void * RKL_GC_VOLATILE)buffer->uniChar; buffer->uniChar = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_free(&p); } + if(RKL_EXPECTED(buffer->string != NULL, 1L)) { CFRelease((CFTypeRef)buffer->string); buffer->string = NULL; } + buffer->length = 0L; + buffer->hash = 0UL; +} + +static void rkl_clearCachedRegex(RKLCachedRegex *cachedRegex) { + RKLCAbortAssert(cachedRegex != NULL); + if(RKL_EXPECTED(cachedRegex == NULL, 0L)) { return; } + rkl_clearCachedRegexSetTo(cachedRegex); + if(rkl_lastCachedRegex == cachedRegex) { rkl_lastCachedRegex = NULL; } + if(cachedRegex->icu_regex != NULL) { RKL_ICU_FUNCTION_APPEND(uregex_close)(cachedRegex->icu_regex); cachedRegex->icu_regex = NULL; cachedRegex->captureCount = -1L; } + if(cachedRegex->regexString != NULL) { CFRelease((CFTypeRef)cachedRegex->regexString); cachedRegex->regexString = NULL; cachedRegex->options = 0U; cachedRegex->regexHash = 0UL; } +} + +static void rkl_clearCachedRegexSetTo(RKLCachedRegex *cachedRegex) { + RKLCAbortAssert(cachedRegex != NULL); + if(RKL_EXPECTED(cachedRegex == NULL, 0L)) { return; } + if(RKL_EXPECTED(cachedRegex->icu_regex != NULL, 1L)) { int32_t status = 0; RKL_ICU_FUNCTION_APPEND(uregex_setText)(cachedRegex->icu_regex, &rkl_emptyUniCharString[0], 0, &status); } + if(RKL_EXPECTED(cachedRegex->setToString != NULL, 1L)) { CFRelease((CFTypeRef)cachedRegex->setToString); cachedRegex->setToString = NULL; } + cachedRegex->lastFindRange = cachedRegex->lastMatchRange = cachedRegex->setToRange = NSNotFoundRange; + cachedRegex->setToIsImmutable = cachedRegex->setToNeedsConversion = 0U; + cachedRegex->setToUniChar = NULL; + cachedRegex->setToHash = 0UL; + cachedRegex->setToLength = 0L; + cachedRegex->buffer = NULL; +} + +#pragma mark Internal functions used to implement NSException and NSError functionality and userInfo NSDictionaries + +// Helps to keep things tidy. +#define addKeyAndObject(objs, keys, i, k, o) ({id _o=(o), _k=(k); if((_o != NULL) && (_k != NULL)) { objs[i] = _o; keys[i] = _k; i++; } }) + +static NSDictionary *rkl_userInfoDictionary(RKLUserInfoOptions userInfoOptions, NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status, NSString *matchString, NSRange matchRange, NSString *replacementString, NSString *replacedString, NSInteger replacedCount, RKLRegexEnumerationOptions enumerationOptions, ...) { + va_list varArgsList; + va_start(varArgsList, enumerationOptions); + if(regexString == NULL) { regexString = @""; } + + id objects[64], keys[64]; + NSUInteger count = 0UL; + + NSString * RKL_GC_VOLATILE errorNameString = [NSString stringWithUTF8String:RKL_ICU_FUNCTION_APPEND(u_errorName)(status)]; + + addKeyAndObject(objects, keys, count, RKLICURegexRegexErrorKey, regexString); + addKeyAndObject(objects, keys, count, RKLICURegexRegexOptionsErrorKey, [NSNumber numberWithUnsignedInt:options]); + addKeyAndObject(objects, keys, count, RKLICURegexErrorCodeErrorKey, [NSNumber numberWithInt:status]); + addKeyAndObject(objects, keys, count, RKLICURegexErrorNameErrorKey, errorNameString); + + if(matchString != NULL) { addKeyAndObject(objects, keys, count, RKLICURegexSubjectStringErrorKey, matchString); } + if((userInfoOptions & RKLUserInfoSubjectRange) != 0UL) { addKeyAndObject(objects, keys, count, RKLICURegexSubjectRangeErrorKey, [NSValue valueWithRange:matchRange]); } + if(replacementString != NULL) { addKeyAndObject(objects, keys, count, RKLICURegexReplacementStringErrorKey, replacementString); } + if(replacedString != NULL) { addKeyAndObject(objects, keys, count, RKLICURegexReplacedStringErrorKey, replacedString); } + if((userInfoOptions & RKLUserInfoReplacedCount) != 0UL) { addKeyAndObject(objects, keys, count, RKLICURegexReplacedCountErrorKey, [NSNumber numberWithInteger:replacedCount]); } + if((userInfoOptions & RKLUserInfoRegexEnumerationOptions) != 0UL) { addKeyAndObject(objects, keys, count, RKLICURegexEnumerationOptionsErrorKey, [NSNumber numberWithUnsignedInteger:enumerationOptions]); } + + if((parseError != NULL) && (parseError->line != -1)) { + NSString *preContextString = [NSString stringWithCharacters:&parseError->preContext[0] length:(NSUInteger)RKL_ICU_FUNCTION_APPEND(u_strlen)(&parseError->preContext[0])]; + NSString *postContextString = [NSString stringWithCharacters:&parseError->postContext[0] length:(NSUInteger)RKL_ICU_FUNCTION_APPEND(u_strlen)(&parseError->postContext[0])]; + + addKeyAndObject(objects, keys, count, RKLICURegexLineErrorKey, [NSNumber numberWithInt:parseError->line]); + addKeyAndObject(objects, keys, count, RKLICURegexOffsetErrorKey, [NSNumber numberWithInt:parseError->offset]); + addKeyAndObject(objects, keys, count, RKLICURegexPreContextErrorKey, preContextString); + addKeyAndObject(objects, keys, count, RKLICURegexPostContextErrorKey, postContextString); + addKeyAndObject(objects, keys, count, @"NSLocalizedFailureReason", ([NSString stringWithFormat:@"The error %@ occurred at line %d, column %d: %@<>%@", errorNameString, parseError->line, parseError->offset, preContextString, postContextString])); + } else { + addKeyAndObject(objects, keys, count, @"NSLocalizedFailureReason", ([NSString stringWithFormat:@"The error %@ occurred.", errorNameString])); + } + + while(count < 62UL) { id obj = va_arg(varArgsList, id), key = va_arg(varArgsList, id); if((obj != NULL) && (key != NULL)) { addKeyAndObject(objects, keys, count, key, obj); } else { break; } } + va_end(varArgsList); + + return([NSDictionary dictionaryWithObjects:&objects[0] forKeys:&keys[0] count:count]); +} + +static NSError *rkl_makeNSError(RKLUserInfoOptions userInfoOptions, NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status, NSString *matchString, NSRange matchRange, NSString *replacementString, NSString *replacedString, NSInteger replacedCount, RKLRegexEnumerationOptions enumerationOptions, NSString *errorDescription) { + if(errorDescription == NULL) { errorDescription = (status == U_ZERO_ERROR) ? @"No description of this error is available." : [NSString stringWithFormat:@"ICU regular expression error #%d, %s.", status, RKL_ICU_FUNCTION_APPEND(u_errorName)(status)]; } + return([NSError errorWithDomain:RKLICURegexErrorDomain code:(NSInteger)status userInfo:rkl_userInfoDictionary(userInfoOptions, regexString, options, parseError, status, matchString, matchRange, replacementString, replacedString, replacedCount, enumerationOptions, errorDescription, @"NSLocalizedDescription", NULL)]); +} + +static NSException *rkl_NSExceptionForRegex(NSString *regexString, RKLRegexOptions options, const UParseError *parseError, int32_t status) { + return([NSException exceptionWithName:RKLICURegexException reason:[NSString stringWithFormat:@"ICU regular expression error #%d, %s.", status, RKL_ICU_FUNCTION_APPEND(u_errorName)(status)] userInfo:rkl_userInfoDictionary((RKLUserInfoOptions)RKLUserInfoNone, regexString, options, parseError, status, NULL, NSNotFoundRange, NULL, NULL, 0L, (RKLRegexEnumerationOptions)RKLRegexEnumerationNoOptions, NULL)]); +} + +static NSDictionary *rkl_makeAssertDictionary(const char *function, const char *file, int line, NSString *format, ...) { + va_list varArgsList; + va_start(varArgsList, format); + NSString * RKL_GC_VOLATILE formatString = [[[NSString alloc] initWithFormat:format arguments:varArgsList] autorelease]; + va_end(varArgsList); + NSString * RKL_GC_VOLATILE functionString = [NSString stringWithUTF8String:function], *fileString = [NSString stringWithUTF8String:file]; + return([NSDictionary dictionaryWithObjectsAndKeys:formatString, @"description", functionString, @"function", fileString, @"file", [NSNumber numberWithInt:line], @"line", NSInternalInconsistencyException, @"exceptionName", NULL]); +} + +static NSString *rkl_stringFromClassAndMethod(id object, SEL selector, NSString *format, ...) { + va_list varArgsList; + va_start(varArgsList, format); + NSString * RKL_GC_VOLATILE formatString = [[[NSString alloc] initWithFormat:format arguments:varArgsList] autorelease]; + va_end(varArgsList); + Class objectsClass = (object == NULL) ? NULL : [object class]; + return([NSString stringWithFormat:@"*** %c[%@ %@]: %@", (object == objectsClass) ? '+' : '-', (objectsClass == NULL) ? @"" : NSStringFromClass(objectsClass), (selector == NULL) ? @":NULL:" : NSStringFromSelector(selector), formatString]); +} + +#ifdef _RKL_BLOCKS_ENABLED + +//////////// +#pragma mark - +#pragma mark Objective-C ^Blocks Support +#pragma mark - +//////////// + +// Prototypes + +static id rkl_performEnumerationUsingBlock(id self, SEL _cmd, + RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, + id matchString, NSRange matchRange, + RKLBlockEnumerationOp blockEnumerationOp, RKLRegexEnumerationOptions enumerationOptions, + NSInteger *replacedCountPtr, NSUInteger *errorFreePtr, + NSError **error, + void (^stringsAndRangesBlock)(NSInteger capturedCount, NSString * const capturedStrings[capturedCount], const NSRange capturedStringRanges[capturedCount], volatile BOOL * const stop), + NSString *(^replaceStringsAndRangesBlock)(NSInteger capturedCount, NSString * const capturedStrings[capturedCount], const NSRange capturedStringRanges[capturedCount], volatile BOOL * const stop) + ) RKL_NONNULL_ARGS(1,2,4,6); + +// This is an object meant for internal use only. It wraps and abstracts various functionality to simplify ^Blocks support. + +@interface RKLBlockEnumerationHelper : NSObject { + @public + RKLCachedRegex cachedRegex; + RKLBuffer buffer; + RKL_STRONG_REF void * RKL_GC_VOLATILE scratchBuffer[_RKL_SCRATCH_BUFFERS]; + NSUInteger needToFreeBufferUniChar:1; +} +- (id)initWithRegex:(NSString *)initRegexString options:(RKLRegexOptions)initOptions string:(NSString *)initString range:(NSRange)initRange error:(NSError **)initError; +@end + +@implementation RKLBlockEnumerationHelper + +- (id)initWithRegex:(NSString *)initRegexString options:(RKLRegexOptions)initOptions string:(NSString *)initString range:(NSRange)initRange error:(NSError **)initError +{ + volatile NSUInteger RKL_CLEANUP(rkl_cleanup_cacheSpinLockStatus) rkl_cacheSpinLockStatus = 0UL; + + int32_t status = U_ZERO_ERROR; + id exception = NULL; + RKLCachedRegex *retrievedCachedRegex = NULL; + +#ifdef _RKL_DTRACE_ENABLED + NSUInteger thisDTraceEventID = 0UL; + unsigned int lookupResultFlags = 0U; +#endif + + if(RKL_EXPECTED((self = [super init]) == NULL, 0L)) { goto errorExit; } + + RKLCDelayedAssert((initRegexString != NULL) && (initString != NULL), &exception, errorExit); + + // IMPORTANT! Once we have obtained the lock, code MUST exit via 'goto exitNow;' to unlock the lock! NO EXCEPTIONS! + // ---------- + OSSpinLockLock(&rkl_cacheSpinLock); // Grab the lock and get cache entry. + rkl_cacheSpinLockStatus |= RKLLockedCacheSpinLock; + rkl_dtrace_incrementAndGetEventID(thisDTraceEventID); + + if(RKL_EXPECTED((retrievedCachedRegex = rkl_getCachedRegex(initRegexString, initOptions, initError, &exception)) == NULL, 0L)) { goto exitNow; } + RKLCDelayedAssert(((retrievedCachedRegex >= rkl_cachedRegexes) && ((retrievedCachedRegex - &rkl_cachedRegexes[0]) < (ssize_t)_RKL_REGEX_CACHE_LINES)) && (retrievedCachedRegex != NULL) && (retrievedCachedRegex->icu_regex != NULL) && (retrievedCachedRegex->regexString != NULL) && (retrievedCachedRegex->captureCount >= 0L) && (retrievedCachedRegex == rkl_lastCachedRegex), &exception, exitNow); + + if(RKL_EXPECTED(retrievedCachedRegex == NULL, 0L) || RKL_EXPECTED(status > U_ZERO_ERROR, 0L) || RKL_EXPECTED(exception != NULL, 0L)) { goto exitNow; } + + if(RKL_EXPECTED((cachedRegex.icu_regex = RKL_ICU_FUNCTION_APPEND(uregex_clone)(retrievedCachedRegex->icu_regex, &status)) == NULL, 0L) || RKL_EXPECTED(status != U_ZERO_ERROR, 0L)) { goto exitNow; } + if(RKL_EXPECTED((cachedRegex.regexString = (CFStringRef)CFRetain((CFTypeRef)retrievedCachedRegex->regexString)) == NULL, 0L)) { goto exitNow; } + cachedRegex.options = initOptions; + cachedRegex.captureCount = retrievedCachedRegex->captureCount; + cachedRegex.regexHash = retrievedCachedRegex->regexHash; + + RKLCDelayedAssert((cachedRegex.icu_regex != NULL) && (cachedRegex.regexString != NULL) && (cachedRegex.captureCount >= 0L), &exception, exitNow); + +exitNow: + if((rkl_cacheSpinLockStatus & RKLLockedCacheSpinLock) != 0UL) { // In case we arrive at exitNow: without obtaining the rkl_cacheSpinLock. + OSSpinLockUnlock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLUnlockedCacheSpinLock; // Warning about rkl_cacheSpinLockStatus never being read can be safely ignored. + } + + if(RKL_EXPECTED(self == NULL, 0L) || RKL_EXPECTED(retrievedCachedRegex == NULL, 0L) || RKL_EXPECTED(cachedRegex.icu_regex == NULL, 0L) || RKL_EXPECTED(status != U_ZERO_ERROR, 0L) || RKL_EXPECTED(exception != NULL, 0L)) { goto errorExit; } + retrievedCachedRegex = NULL; // Since we no longer hold the lock, ensure that nothing accesses the retrieved cache regex after this point. + + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLEnumerationBufferLookupFlag); + + if(RKL_EXPECTED((buffer.string = CFStringCreateCopy(NULL, (CFStringRef)initString)) == NULL, 0L)) { goto errorExit; } + buffer.hash = CFHash((CFTypeRef)buffer.string); + buffer.length = CFStringGetLength(buffer.string); + + if((buffer.uniChar = (UniChar *)CFStringGetCharactersPtr(buffer.string)) == NULL) { + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLConversionRequiredLookupFlag); + if(RKL_EXPECTED((buffer.uniChar = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc((RKL_STRONG_REF void ** RKL_GC_VOLATILE)&buffer.uniChar, ((size_t)buffer.length * sizeof(UniChar)), 0UL)) == NULL, 0L)) { goto errorExit; } // Resize the buffer. + needToFreeBufferUniChar = rkl_collectingEnabled() ? 0U : 1U; + CFStringGetCharacters(buffer.string, CFMakeRange(0L, buffer.length), (UniChar *)buffer.uniChar); // Convert to a UTF16 string. + } + + if(RKL_EXPECTED((cachedRegex.setToString = (CFStringRef)CFRetain((CFTypeRef)buffer.string)) == NULL, 0L)) { goto errorExit; } + cachedRegex.setToHash = buffer.hash; + cachedRegex.setToLength = buffer.length; + cachedRegex.setToUniChar = buffer.uniChar; + cachedRegex.buffer = &buffer; + + RKLCDelayedAssert((cachedRegex.icu_regex != NULL) && (cachedRegex.setToUniChar != NULL) && (cachedRegex.setToLength < INT_MAX) && (NSMaxRange(initRange) <= (NSUInteger)cachedRegex.setToLength) && (NSMaxRange(initRange) < INT_MAX), &exception, errorExit); + cachedRegex.lastFindRange = cachedRegex.lastMatchRange = NSNotFoundRange; + cachedRegex.setToRange = initRange; + RKL_ICU_FUNCTION_APPEND(uregex_setText)(cachedRegex.icu_regex, cachedRegex.setToUniChar + cachedRegex.setToRange.location, (int32_t)cachedRegex.setToRange.length, &status); + if(RKL_EXPECTED(status > U_ZERO_ERROR, 0L)) { goto errorExit; } + + rkl_dtrace_addLookupFlag(lookupResultFlags, RKLSetTextLookupFlag); + rkl_dtrace_utf16ConversionCacheWithEventID(thisDTraceEventID, lookupResultFlags, initString, cachedRegex.setToRange.location, cachedRegex.setToRange.length, cachedRegex.setToLength); + + return(self); + +errorExit: + if(RKL_EXPECTED(self != NULL, 1L)) { [self autorelease]; } + if(RKL_EXPECTED(status > U_ZERO_ERROR, 0L) && RKL_EXPECTED(exception == NULL, 0L)) { exception = rkl_NSExceptionForRegex(initRegexString, initOptions, NULL, status); } // If we had a problem, prepare an exception to be thrown. + if(RKL_EXPECTED(status < U_ZERO_ERROR, 0L) && (initError != NULL)) { *initError = rkl_makeNSError((RKLUserInfoOptions)RKLUserInfoNone, initRegexString, initOptions, NULL, status, initString, initRange, NULL, NULL, 0L, (RKLRegexEnumerationOptions)RKLRegexEnumerationNoOptions, @"The ICU library returned an unexpected error."); } + if(RKL_EXPECTED(exception != NULL, 0L)) { rkl_handleDelayedAssert(self, _cmd, exception); } + + return(NULL); +} + +#ifdef __OBJC_GC__ +- (void)finalize +{ + rkl_clearCachedRegex(&cachedRegex); + rkl_clearBuffer(&buffer, (needToFreeBufferUniChar != 0U) ? 1LU : 0LU); + NSUInteger tmpIdx = 0UL; // The rkl_free() below is "probably" a no-op when GC is on, but better to be safe than sorry... + for(tmpIdx = 0UL; tmpIdx < _RKL_SCRATCH_BUFFERS; tmpIdx++) { if(RKL_EXPECTED(scratchBuffer[tmpIdx] != NULL, 0L)) { scratchBuffer[tmpIdx] = rkl_free(&scratchBuffer[tmpIdx]); } } + [super finalize]; +} +#endif // __OBJC_GC__ + +- (void)dealloc +{ + rkl_clearCachedRegex(&cachedRegex); + rkl_clearBuffer(&buffer, (needToFreeBufferUniChar != 0U) ? 1LU : 0LU); + NSUInteger tmpIdx = 0UL; + for(tmpIdx = 0UL; tmpIdx < _RKL_SCRATCH_BUFFERS; tmpIdx++) { if(RKL_EXPECTED(scratchBuffer[tmpIdx] != NULL, 0L)) { scratchBuffer[tmpIdx] = rkl_free(&scratchBuffer[tmpIdx]); } } + [super dealloc]; +} + +@end + +// IMPORTANT! This code is critical path code. Because of this, it has been written for speed, not clarity. +// ---------- +// +// Return value: BOOL. Per "Error Handling Programming Guide" wrt/ NSError, return NO on error / failure, and set *error to an NSError object. +// +// rkl_performEnumerationUsingBlock reference counted / manual memory management notes: +// +// When running using reference counting, rkl_performEnumerationUsingBlock() creates a CFMutableArray called autoreleaseArray, which is -autoreleased. +// autoreleaseArray uses the rkl_transferOwnershipArrayCallBacks CFArray callbacks which do not perform a -retain/CFRetain() when objects are added, but do perform a -release/CFRelease() when an object is removed. +// +// A special class, RKLBlockEnumerationHelper, is used to manage the details of creating a private instantiation of the ICU regex (via uregex_clone()) and setting up the details of the UTF-16 buffer required by the ICU regex engine. +// The instantiated RKLBlockEnumerationHelper is not autoreleased, but added to autoreleaseArray. When rkl_performEnumerationUsingBlock() exits, it calls CFArrayRemoveAllValues(autoreleaseArray), which empties the array. +// This has the effect of immediately -releasing the instantiated RKLBlockEnumerationHelper object, and all the memory used to hold the ICU regex and UTF-16 conversion buffer. +// This means the memory is reclaimed immediately and we do not have to wait until the autorelease pool pops. +// +// If we are performing a "string replacement" operation, we create a temporary NSMutableString named mutableReplacementString to hold the replaced strings results. mutableReplacementString is also added to autoreleaseArray so that it +// can be properly released on an error. +// +// Temporary strings that are created during the enumeration of matches are added to autoreleaseArray. +// The strings are added by doing a CFArrayReplaceValues(), which simultaneously releases the previous iterations temporary strings while adding the current iterations temporary strings to the array. +// +// autoreleaseArray always has a reference to any "live" and in use objects. If anything "Goes Wrong", at any point, for any reason (ie, exception is thrown), autoreleaseArray is in the current NSAutoreleasePool +// and will automatically be released when that pool pops. This ensures that we don't leak anything even when things go seriously sideways. This also allows us to keep the total amount of memory in use +// down to a minimum, which can be substantial if the user is enumerating a large string, for example a regex of '\w+' on a 500K+ text file. +// +// The only 'caveat' is that the user needs to -retain any strings that they want to use past the point at which their ^block returns. Logically, it is as if the following takes place: +// +// for(eachMatchOfRegexInStringToSearch) { +// NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; +// callUsersBlock(capturedCount, capturedStrings, capturedStringRanges, stop); +// [pool release]; +// } +// +// But in reality, no NSAutoreleasePool is created, it's all slight of hand done via the CFMutableArray autoreleaseArray. +// +// rkl_performEnumerationUsingBlock garbage collected / automatic memory management notes: +// +// When RegexKitLite is built with -fobjc-gc or -fobjc-gc-only, and (in the case of -fobjc-gc) RegexKitLite determines that GC is active at execution time, then rkl_performEnumerationUsingBlock essentially +// skips all of the above reference counted autoreleaseArray stuff. +// +// rkl_performEnumerationUsingBlock and RKLRegexEnumerationReleaseStringReturnedByReplacementBlock notes +// +// Under reference counting, this enumeration option allows the user to return a non-autoreleased string, and then have RegexKitLite send the object a -release message once it's done with it. +// The primary reason to do this is to immediately reclaim the memory used by the string holding the replacement text. +// Just in case the user returns one of the strings we passed via capturedStrings[], we check to see if the string return by the block is any of the strings we created and passed via capturedStrings[]. +// If it is one of our strings, we do not send the string a -release since that would over release it. It is assumed that the user will /NOT/ add a -retain to our strings in this case. +// Under GC, RKLRegexEnumerationReleaseStringReturnedByReplacementBlock is ignored and no -release messages are sent. +// + +#pragma mark Primary internal function that Objective-C ^Blocks related methods call to perform regular expression operations + +static id rkl_performEnumerationUsingBlock(id self, SEL _cmd, + RKLRegexOp regexOp, NSString *regexString, RKLRegexOptions options, + id matchString, NSRange matchRange, + RKLBlockEnumerationOp blockEnumerationOp, RKLRegexEnumerationOptions enumerationOptions, + NSInteger *replacedCountPtr, NSUInteger *errorFreePtr, + NSError **error, + void (^stringsAndRangesBlock)(NSInteger capturedCount, NSString * const capturedStrings[capturedCount], const NSRange capturedStringRanges[capturedCount], volatile BOOL * const stop), + NSString *(^replaceStringsAndRangesBlock)(NSInteger capturedCount, NSString * const capturedStrings[capturedCount], const NSRange capturedStringRanges[capturedCount], volatile BOOL * const stop)) { + NSMutableArray * RKL_GC_VOLATILE autoreleaseArray = NULL; + RKLBlockEnumerationHelper * RKL_GC_VOLATILE blockEnumerationHelper = NULL; + NSMutableString * RKL_GC_VOLATILE mutableReplacementString = NULL; + RKL_STRONG_REF UniChar * RKL_GC_VOLATILE blockEnumerationHelperUniChar = NULL; + NSUInteger errorFree = NO; + id exception = NULL, returnObject = NULL; + CFRange autoreleaseReplaceRange = CFMakeRange(0L, 0L); + int32_t status = U_ZERO_ERROR; + RKLRegexOp maskedRegexOp = (regexOp & RKLMaskOp); + volatile BOOL shouldStop = NO; + NSInteger replacedCount = -1L; + NSRange lastMatchedRange = NSNotFoundRange; + NSUInteger stringU16Length = 0UL; + + BOOL performStringReplacement = (blockEnumerationOp == RKLBlockEnumerationReplaceOp) ? YES : NO; + + if((error != NULL) && (*error != NULL)) { *error = NULL; } + + if(RKL_EXPECTED(regexString == NULL, 0L)) { exception = (id)RKL_EXCEPTION(NSInvalidArgumentException, @"The regular expression argument is NULL."); goto exitNow; } + if(RKL_EXPECTED(matchString == NULL, 0L)) { exception = (id)RKL_EXCEPTION(NSInternalInconsistencyException, @"The match string argument is NULL."); goto exitNow; } + + if((((enumerationOptions & RKLRegexEnumerationCapturedStringsNotRequired) != 0UL) && ((enumerationOptions & RKLRegexEnumerationFastCapturedStringsXXX) != 0UL)) || + (((enumerationOptions & RKLRegexEnumerationReleaseStringReturnedByReplacementBlock) != 0UL) && (blockEnumerationOp != RKLBlockEnumerationReplaceOp)) || + ((enumerationOptions & (~((RKLRegexEnumerationOptions)(RKLRegexEnumerationCapturedStringsNotRequired | RKLRegexEnumerationReleaseStringReturnedByReplacementBlock | RKLRegexEnumerationFastCapturedStringsXXX)))) != 0UL)) { + exception = (id)RKL_EXCEPTION(NSInvalidArgumentException, @"The RKLRegexEnumerationOptions argument is not valid."); + goto exitNow; + } + + stringU16Length = (NSUInteger)CFStringGetLength((CFStringRef)matchString); + + if(RKL_EXPECTED(matchRange.length == NSUIntegerMax, 1L)) { matchRange.length = stringU16Length; } // For convenience. + if(RKL_EXPECTED(stringU16Length < NSMaxRange(matchRange), 0L)) { exception = (id)RKL_EXCEPTION(NSRangeException, @"Range or index out of bounds."); goto exitNow; } + if(RKL_EXPECTED(stringU16Length >= (NSUInteger)INT_MAX, 0L)) { exception = (id)RKL_EXCEPTION(NSRangeException, @"String length exceeds INT_MAX."); goto exitNow; } + + RKLCDelayedAssert((self != NULL) && (_cmd != NULL) && ((blockEnumerationOp == RKLBlockEnumerationMatchOp) ? (((regexOp == RKLCapturesArrayOp) || (regexOp == RKLSplitOp)) && (stringsAndRangesBlock != NULL) && (replaceStringsAndRangesBlock == NULL)) : 1) && ((blockEnumerationOp == RKLBlockEnumerationReplaceOp) ? ((regexOp == RKLCapturesArrayOp) && (stringsAndRangesBlock == NULL) && (replaceStringsAndRangesBlock != NULL)) : 1) , &exception, exitNow); + + if((rkl_collectingEnabled() == NO) && RKL_EXPECTED((autoreleaseArray = rkl_CFAutorelease(CFArrayCreateMutable(NULL, 0L, &rkl_transferOwnershipArrayCallBacks))) == NULL, 0L)) { goto exitNow; } // Warning about potential leak of Core Foundation object can be safely ignored. + if(RKL_EXPECTED((blockEnumerationHelper = [[RKLBlockEnumerationHelper alloc] initWithRegex:regexString options:options string:matchString range:matchRange error:error]) == NULL, 0L)) { goto exitNow; } // Warning about potential leak of blockEnumerationHelper can be safely ignored. + if(autoreleaseArray != NULL) { CFArrayAppendValue((CFMutableArrayRef)autoreleaseArray, blockEnumerationHelper); autoreleaseReplaceRange.location++; } // We do not autorelease blockEnumerationHelper, but instead add it to autoreleaseArray. + + if(performStringReplacement == YES) { + if(RKL_EXPECTED((mutableReplacementString = [[NSMutableString alloc] init]) == NULL, 0L)) { goto exitNow; } // Warning about potential leak of mutableReplacementString can be safely ignored. + if(autoreleaseArray != NULL) { CFArrayAppendValue((CFMutableArrayRef)autoreleaseArray, mutableReplacementString); autoreleaseReplaceRange.location++; } // We do not autorelease mutableReplacementString, but instead add it to autoreleaseArray. + } + + // RKLBlockEnumerationHelper creates an immutable copy of the string to match (matchString) which we reference via blockEnumerationHelperString. We use blockEnumerationHelperString when creating the captured strings from a match. + // This protects us against the user mutating matchString while we are in the middle of enumerating matches. + NSString * RKL_GC_VOLATILE blockEnumerationHelperString = (NSString *)blockEnumerationHelper->buffer.string, ** RKL_GC_VOLATILE capturedStrings = NULL, *emptyString = @""; + CFMutableStringRef * RKL_GC_VOLATILE fastCapturedStrings = NULL; + NSInteger captureCountBlockArgument = (blockEnumerationHelper->cachedRegex.captureCount + 1L); + size_t capturedStringsCapacity = ((size_t)captureCountBlockArgument + 4UL); + size_t capturedRangesCapacity = (((size_t)captureCountBlockArgument + 4UL) * 5UL); + NSRange *capturedRanges = NULL; + + lastMatchedRange = NSMakeRange(matchRange.location, 0UL); + blockEnumerationHelperUniChar = blockEnumerationHelper->buffer.uniChar; + + RKLCDelayedAssert((blockEnumerationHelperString != NULL) && (blockEnumerationHelperUniChar != NULL) && (captureCountBlockArgument > 0L) && (capturedStringsCapacity > 0UL) && (capturedRangesCapacity > 0UL), &exception, exitNow); + + if((capturedStrings = (NSString ** RKL_GC_VOLATILE)alloca(sizeof(NSString *) * capturedStringsCapacity)) == NULL) { goto exitNow; } // Space to hold the captured strings from a match. + if((capturedRanges = (NSRange *) alloca(sizeof(NSRange) * capturedRangesCapacity)) == NULL) { goto exitNow; } // Space to hold the NSRanges of the captured strings from a match. + +#ifdef NS_BLOCK_ASSERTIONS + { // Initialize the padded capturedStrings and capturedRanges to values that should tickle a fault if they are ever used. + size_t idx = 0UL; + for(idx = captureCountBlockArgument; idx < capturedStringsCapacity; idx++) { capturedStrings[idx] = (NSString *)RKLIllegalPointer; } + for(idx = captureCountBlockArgument; idx < capturedRangesCapacity; idx++) { capturedRanges[idx] = RKLIllegalRange; } + } +#else + { // Initialize all of the capturedStrings and capturedRanges to values that should tickle a fault if they are ever used. + size_t idx = 0UL; + for(idx = 0UL; idx < capturedStringsCapacity; idx++) { capturedStrings[idx] = (NSString *)RKLIllegalPointer; } + for(idx = 0UL; idx < capturedRangesCapacity; idx++) { capturedRanges[idx] = RKLIllegalRange; } + } +#endif + + if((enumerationOptions & RKLRegexEnumerationFastCapturedStringsXXX) != 0UL) { + RKLCDelayedAssert(((enumerationOptions & RKLRegexEnumerationCapturedStringsNotRequired) == 0UL), &exception, exitNow); + size_t idx = 0UL; + if((fastCapturedStrings = (CFMutableStringRef * RKL_GC_VOLATILE)alloca(sizeof(NSString *) * capturedStringsCapacity)) == NULL) { goto exitNow; } // Space to hold the "fast" captured strings from a match. + + for(idx = 0UL; idx < (size_t)captureCountBlockArgument; idx++) { + if((fastCapturedStrings[idx] = CFStringCreateMutableWithExternalCharactersNoCopy(NULL, NULL, 0L, 0L, kCFAllocatorNull)) == NULL) { goto exitNow; } + if(autoreleaseArray != NULL) { CFArrayAppendValue((CFMutableArrayRef)autoreleaseArray, fastCapturedStrings[idx]); autoreleaseReplaceRange.location++; } // We do not autorelease mutableReplacementString, but instead add it to autoreleaseArray. + capturedStrings[idx] = (NSString *)fastCapturedStrings[idx]; + } + } + + RKLFindAll findAll = rkl_makeFindAll(capturedRanges, matchRange, (NSInteger)capturedRangesCapacity, (capturedRangesCapacity * sizeof(NSRange)), 0UL, &blockEnumerationHelper->scratchBuffer[0], &blockEnumerationHelper->scratchBuffer[1], &blockEnumerationHelper->scratchBuffer[2], &blockEnumerationHelper->scratchBuffer[3], &blockEnumerationHelper->scratchBuffer[4], 0L, 0L, 1L); + + NSString ** RKL_GC_VOLATILE capturedStringsBlockArgument = NULL; // capturedStringsBlockArgument is what we pass to the 'capturedStrings[]' argument of the users ^block. Will pass NULL if the user doesn't want the captured strings created automatically. + if((enumerationOptions & RKLRegexEnumerationCapturedStringsNotRequired) == 0UL) { capturedStringsBlockArgument = capturedStrings; } // If the user wants the captured strings automatically created, set to capturedStrings. + + replacedCount = 0L; + while(RKL_EXPECTED(rkl_findRanges(&blockEnumerationHelper->cachedRegex, regexOp, &findAll, &exception, &status) == NO, 1L) && RKL_EXPECTED(findAll.found > 0L, 1L) && RKL_EXPECTED(exception == NULL, 1L) && RKL_EXPECTED(status == U_ZERO_ERROR, 1L)) { + if(performStringReplacement == YES) { + NSUInteger lastMatchedMaxLocation = (lastMatchedRange.location + lastMatchedRange.length); + NSRange previousUnmatchedRange = NSMakeRange(lastMatchedMaxLocation, findAll.ranges[0].location - lastMatchedMaxLocation); + RKLCDelayedAssert((NSMaxRange(previousUnmatchedRange) <= stringU16Length) && (NSRangeInsideRange(previousUnmatchedRange, matchRange) == YES), &exception, exitNow); + if(RKL_EXPECTED(previousUnmatchedRange.length > 0UL, 1L)) { CFStringAppendCharacters((CFMutableStringRef)mutableReplacementString, blockEnumerationHelperUniChar + previousUnmatchedRange.location, (CFIndex)previousUnmatchedRange.length); } + } + + findAll.found -= findAll.addedSplitRanges; + + NSInteger passCaptureCountBlockArgument = ((findAll.found == 0L) && (findAll.addedSplitRanges == 1L) && (maskedRegexOp == RKLSplitOp)) ? 1L : findAll.found, capturedStringsIdx = passCaptureCountBlockArgument; + RKLCDelayedHardAssert(passCaptureCountBlockArgument <= captureCountBlockArgument, &exception, exitNow); + if(capturedStringsBlockArgument != NULL) { // Only create the captured strings if the user has requested them. + BOOL hadError = NO; // Loop over all the strings rkl_findRanges found. If rkl_CreateStringWithSubstring() returns NULL due to an error, set returnBool to NO, and break out of the for() loop. + + for(capturedStringsIdx = 0L; capturedStringsIdx < passCaptureCountBlockArgument; capturedStringsIdx++) { + RKLCDelayedHardAssert(capturedStringsIdx < captureCountBlockArgument, &exception, exitNow); + if((enumerationOptions & RKLRegexEnumerationFastCapturedStringsXXX) != 0UL) { + // Analyzer report of "Dereference of null pointer" can be safely ignored for the next line. Bug filed: http://llvm.org/bugs/show_bug.cgi?id=6150 + CFStringSetExternalCharactersNoCopy(fastCapturedStrings[capturedStringsIdx], &blockEnumerationHelperUniChar[findAll.ranges[capturedStringsIdx].location], (CFIndex)findAll.ranges[capturedStringsIdx].length, (CFIndex)findAll.ranges[capturedStringsIdx].length); + } else { + if((capturedStrings[capturedStringsIdx] = (findAll.ranges[capturedStringsIdx].length == 0UL) ? emptyString : rkl_CreateStringWithSubstring(blockEnumerationHelperString, findAll.ranges[capturedStringsIdx])) == NULL) { hadError = YES; break; } + } + } + if(((enumerationOptions & RKLRegexEnumerationFastCapturedStringsXXX) == 0UL) && RKL_EXPECTED(autoreleaseArray != NULL, 1L)) { CFArrayReplaceValues((CFMutableArrayRef)autoreleaseArray, autoreleaseReplaceRange, (const void **)capturedStrings, capturedStringsIdx); autoreleaseReplaceRange.length = capturedStringsIdx; } // Add to autoreleaseArray all the strings the for() loop created. + if(RKL_EXPECTED(hadError == YES, 0L)) { goto exitNow; } // hadError == YES will be set if rkl_CreateStringWithSubstring() returned NULL. + } + // For safety, set any capturedRanges and capturedStrings up to captureCountBlockArgument + 1 to values that indicate that they are not valid. + // These values are chosen such that they should tickle any misuse by users. + // capturedStringsIdx is initialized to passCaptureCountBlockArgument, but if capturedStringsBlockArgument != NULL, it is reset to 0 by the loop that creates strings. + // If the loop that creates strings has an error, execution should transfer to exitNow and this will never get run. + // Again, this is for safety for users that do not check the passed block argument 'captureCount' and instead depend on something like [regex captureCount]. + for(; capturedStringsIdx < captureCountBlockArgument + 1L; capturedStringsIdx++) { RKLCDelayedAssert((capturedStringsIdx < (NSInteger)capturedStringsCapacity) && (capturedStringsIdx < (NSInteger)capturedRangesCapacity), &exception, exitNow); capturedRanges[capturedStringsIdx] = RKLIllegalRange; capturedStrings[capturedStringsIdx] = (NSString *)RKLIllegalPointer; } + + RKLCDelayedAssert((passCaptureCountBlockArgument > 0L) && (NSMaxRange(capturedRanges[0]) <= stringU16Length) && (capturedRanges[0].location < NSIntegerMax) && (capturedRanges[0].length < NSIntegerMax), &exception, exitNow); + + switch(blockEnumerationOp) { + case RKLBlockEnumerationMatchOp: stringsAndRangesBlock(passCaptureCountBlockArgument, capturedStringsBlockArgument, capturedRanges, &shouldStop); break; + + case RKLBlockEnumerationReplaceOp: { + NSString *blockReturnedReplacementString = replaceStringsAndRangesBlock(passCaptureCountBlockArgument, capturedStringsBlockArgument, capturedRanges, &shouldStop); + + if(RKL_EXPECTED(blockReturnedReplacementString != NULL, 1L)) { + CFStringAppend((CFMutableStringRef)mutableReplacementString, (CFStringRef)blockReturnedReplacementString); + BOOL shouldRelease = (((enumerationOptions & RKLRegexEnumerationReleaseStringReturnedByReplacementBlock) != 0UL) && (capturedStringsBlockArgument != NULL) && (rkl_collectingEnabled() == NO)) ? YES : NO; + if(shouldRelease == YES) { NSInteger idx = 0L; for(idx = 0L; idx < passCaptureCountBlockArgument; idx++) { if(capturedStrings[idx] == blockReturnedReplacementString) { shouldRelease = NO; break; } } } + if(shouldRelease == YES) { [blockReturnedReplacementString release]; } + } + } + break; + + default: exception = RKLCAssertDictionary(@"Unknown blockEnumerationOp code."); goto exitNow; break; + } + + replacedCount++; + findAll.addedSplitRanges = 0L; // rkl_findRanges() expects findAll.addedSplitRanges to be 0 on entry. + findAll.found = 0L; // rkl_findRanges() expects findAll.found to be 0 on entry. + findAll.findInRange = findAll.remainingRange; // Ask rkl_findRanges() to search the part of the string after the current match. + lastMatchedRange = findAll.ranges[0]; + + if(RKL_EXPECTED(shouldStop != NO, 0L)) { break; } + } + errorFree = YES; + +exitNow: + if(RKL_EXPECTED(errorFree == NO, 0L)) { replacedCount = -1L; } + if((blockEnumerationOp == RKLBlockEnumerationReplaceOp) && RKL_EXPECTED(errorFree == YES, 1L)) { + RKLCDelayedAssert(replacedCount >= 0L, &exception, exitNow2); + if(RKL_EXPECTED(replacedCount == 0UL, 0L)) { + RKLCDelayedAssert((blockEnumerationHelper != NULL) && (blockEnumerationHelper->buffer.string != NULL), &exception, exitNow2); + returnObject = rkl_CreateStringWithSubstring((id)blockEnumerationHelper->buffer.string, matchRange); + if(rkl_collectingEnabled() == NO) { returnObject = rkl_CFAutorelease(returnObject); } + } + else { + NSUInteger lastMatchedMaxLocation = (lastMatchedRange.location + lastMatchedRange.length); + NSRange previousUnmatchedRange = NSMakeRange(lastMatchedMaxLocation, NSMaxRange(matchRange) - lastMatchedMaxLocation); + RKLCDelayedAssert((NSMaxRange(previousUnmatchedRange) <= stringU16Length) && (NSRangeInsideRange(previousUnmatchedRange, matchRange) == YES), &exception, exitNow2); + + if(RKL_EXPECTED(previousUnmatchedRange.length > 0UL, 1L)) { CFStringAppendCharacters((CFMutableStringRef)mutableReplacementString, blockEnumerationHelperUniChar + previousUnmatchedRange.location, (CFIndex)previousUnmatchedRange.length); } + returnObject = rkl_CFAutorelease(CFStringCreateCopy(NULL, (CFStringRef)mutableReplacementString)); // Warning about potential leak of Core Foundation object can be safely ignored. + } + } + +#ifndef NS_BLOCK_ASSERTIONS +exitNow2: +#endif // NS_BLOCK_ASSERTIONS + if(RKL_EXPECTED(autoreleaseArray != NULL, 1L)) { CFArrayRemoveAllValues((CFMutableArrayRef)autoreleaseArray); } // Causes blockEnumerationHelper to be released immediately, freeing all of its resources (such as a large UTF-16 conversion buffer). + if(RKL_EXPECTED(exception != NULL, 0L)) { rkl_handleDelayedAssert(self, _cmd, exception); } // If there is an exception, throw it at this point. + if(((errorFree == NO) || ((errorFree == YES) && (returnObject == NULL))) && (error != NULL) && (*error == NULL)) { + RKLUserInfoOptions userInfoOptions = (RKLUserInfoSubjectRange | RKLUserInfoRegexEnumerationOptions); + NSString *replacedString = NULL; + if(blockEnumerationOp == RKLBlockEnumerationReplaceOp) { userInfoOptions |= RKLUserInfoReplacedCount; if(RKL_EXPECTED(errorFree == YES, 1L)) { replacedString = returnObject; } } + *error = rkl_makeNSError(userInfoOptions, regexString, options, NULL, status, (blockEnumerationHelper != NULL) ? (blockEnumerationHelper->buffer.string != NULL) ? (NSString *)blockEnumerationHelper->buffer.string : matchString : matchString, matchRange, NULL, replacedString, replacedCount, enumerationOptions, @"An unexpected error occurred."); + } + if(replacedCountPtr != NULL) { *replacedCountPtr = replacedCount; } + if(errorFreePtr != NULL) { *errorFreePtr = errorFree; } + return(returnObject); +} // The two warnings about potential leaks can be safely ignored. + +#endif // _RKL_BLOCKS_ENABLED + +//////////// +#pragma mark - +#pragma mark Objective-C Public Interface +#pragma mark - +//////////// + +@implementation NSString (RegexKitLiteAdditions) + +#pragma mark +clearStringCache + ++ (void)RKL_METHOD_PREPEND(clearStringCache) +{ + volatile NSUInteger RKL_CLEANUP(rkl_cleanup_cacheSpinLockStatus) rkl_cacheSpinLockStatus = 0UL; + OSSpinLockLock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLLockedCacheSpinLock; + rkl_clearStringCache(); + OSSpinLockUnlock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLUnlockedCacheSpinLock; // Warning about rkl_cacheSpinLockStatus never being read can be safely ignored. +} + +#pragma mark +captureCountForRegex: + ++ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex +{ + NSInteger captureCount = -1L; + rkl_isRegexValid(self, _cmd, regex, RKLNoOptions, &captureCount, NULL); + return(captureCount); +} + ++ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error +{ + NSInteger captureCount = -1L; + rkl_isRegexValid(self, _cmd, regex, options, &captureCount, error); + return(captureCount); +} + +#pragma mark -captureCount: + +- (NSInteger)RKL_METHOD_PREPEND(captureCount) +{ + NSInteger captureCount = -1L; + rkl_isRegexValid(self, _cmd, self, RKLNoOptions, &captureCount, NULL); + return(captureCount); +} + +- (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error +{ + NSInteger captureCount = -1L; + rkl_isRegexValid(self, _cmd, self, options, &captureCount, error); + return(captureCount); +} + +#pragma mark -componentsSeparatedByRegex: + +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex +{ + NSRange range = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLSplitOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLSplitOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLSplitOp, regex, options, 0L, self, &range, NULL, error, NULL, 0UL, NULL, NULL)); +} + +#pragma mark -isMatchedByRegex: + +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex +{ + NSRange result = NSNotFoundRange, range = NSMaxiumRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &result, 0UL, NULL, NULL); + return((result.location == (NSUInteger)NSNotFound) ? NO : YES); +} + +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range +{ + NSRange result = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &result, 0UL, NULL, NULL); + return((result.location == (NSUInteger)NSNotFound) ? NO : YES); +} + +- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error +{ + NSRange result = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, options, 0L, self, &range, NULL, error, &result, 0UL, NULL, NULL); + return((result.location == (NSUInteger)NSNotFound) ? NO : YES); +} + +#pragma mark -isRegexValid + +- (BOOL)RKL_METHOD_PREPEND(isRegexValid) +{ + return(rkl_isRegexValid(self, _cmd, self, RKLNoOptions, NULL, NULL) == 1UL ? YES : NO); +} + +- (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error +{ + return(rkl_isRegexValid(self, _cmd, self, options, NULL, error) == 1UL ? YES : NO); +} + +#pragma mark -flushCachedRegexData + +- (void)RKL_METHOD_PREPEND(flushCachedRegexData) +{ + volatile NSUInteger RKL_CLEANUP(rkl_cleanup_cacheSpinLockStatus) rkl_cacheSpinLockStatus = 0UL; + + CFIndex selfLength = CFStringGetLength((CFStringRef)self); + CFHashCode selfHash = CFHash((CFTypeRef)self); + + OSSpinLockLock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLLockedCacheSpinLock; + rkl_dtrace_incrementEventID(); + + NSUInteger idx; + for(idx = 0UL; idx < _RKL_REGEX_CACHE_LINES; idx++) { + RKLCachedRegex *cachedRegex = &rkl_cachedRegexes[idx]; + if((cachedRegex->setToString != NULL) && ( (cachedRegex->setToString == (CFStringRef)self) || ((cachedRegex->setToLength == selfLength) && (cachedRegex->setToHash == selfHash)) ) ) { rkl_clearCachedRegexSetTo(cachedRegex); } + } + for(idx = 0UL; idx < _RKL_LRU_CACHE_SET_WAYS; idx++) { RKLBuffer *buffer = &rkl_lruFixedBuffer[idx]; if((buffer->string != NULL) && ((buffer->string == (CFStringRef)self) || ((buffer->length == selfLength) && (buffer->hash == selfHash)))) { rkl_clearBuffer(buffer, 0UL); } } + for(idx = 0UL; idx < _RKL_LRU_CACHE_SET_WAYS; idx++) { RKLBuffer *buffer = &rkl_lruDynamicBuffer[idx]; if((buffer->string != NULL) && ((buffer->string == (CFStringRef)self) || ((buffer->length == selfLength) && (buffer->hash == selfHash)))) { rkl_clearBuffer(buffer, 0UL); } } + + OSSpinLockUnlock(&rkl_cacheSpinLock); + rkl_cacheSpinLockStatus |= RKLUnlockedCacheSpinLock; // Warning about rkl_cacheSpinLockStatus never being read can be safely ignored. +} + +#pragma mark -rangeOfRegex: + +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex +{ + NSRange result = NSNotFoundRange, range = NSMaxiumRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &result, 0UL, NULL, NULL); + return(result); +} + +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture +{ + NSRange result = NSNotFoundRange, range = NSMaxiumRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, capture, self, &range, NULL, NULL, &result, 0UL, NULL, NULL); + return(result); +} + +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range +{ + NSRange result = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &result, 0UL, NULL, NULL); + return(result); +} + +- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error +{ + NSRange result = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, options, capture, self, &range, NULL, error, &result, 0UL, NULL, NULL); + return(result); +} + +#pragma mark -stringByMatching: + +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex +{ + NSRange matchedRange = NSNotFoundRange, range = NSMaxiumRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &matchedRange, 0UL, NULL, NULL); + return((matchedRange.location == (NSUInteger)NSNotFound) ? NULL : rkl_CFAutorelease(CFStringCreateWithSubstring(NULL, (CFStringRef)self, CFMakeRange(matchedRange.location, matchedRange.length)))); // Warning about potential leak can be safely ignored. +} // Warning about potential leak can be safely ignored. + +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture +{ + NSRange matchedRange = NSNotFoundRange, range = NSMaxiumRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, capture, self, &range, NULL, NULL, &matchedRange, 0UL, NULL, NULL); + return((matchedRange.location == (NSUInteger)NSNotFound) ? NULL : rkl_CFAutorelease(CFStringCreateWithSubstring(NULL, (CFStringRef)self, CFMakeRange(matchedRange.location, matchedRange.length)))); // Warning about potential leak can be safely ignored. +} // Warning about potential leak can be safely ignored. + +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range +{ + NSRange matchedRange = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, &matchedRange, 0UL, NULL, NULL); + return((matchedRange.location == (NSUInteger)NSNotFound) ? NULL : rkl_CFAutorelease(CFStringCreateWithSubstring(NULL, (CFStringRef)self, CFMakeRange(matchedRange.location, matchedRange.length)))); // Warning about potential leak can be safely ignored. +} // Warning about potential leak can be safely ignored. + +- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error +{ + NSRange matchedRange = NSNotFoundRange; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLRangeOp, regex, options, capture, self, &range, NULL, error, &matchedRange, 0UL, NULL, NULL); + return((matchedRange.location == (NSUInteger)NSNotFound) ? NULL : rkl_CFAutorelease(CFStringCreateWithSubstring(NULL, (CFStringRef)self, CFMakeRange(matchedRange.location, matchedRange.length)))); // Warning about potential leak can be safely ignored. +} // Warning about potential leak can be safely ignored. + +#pragma mark -stringByReplacingOccurrencesOfRegex: + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement +{ + NSRange searchRange = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLReplaceOp, regex, RKLNoOptions, 0L, self, &searchRange, replacement, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLReplaceOp, regex, RKLNoOptions, 0L, self, &searchRange, replacement, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLReplaceOp, regex, options, 0L, self, &searchRange, replacement, error, NULL, 0UL, NULL, NULL)); +} + +#pragma mark -componentsMatchedByRegex: + +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex +{ + NSRange searchRange = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLArrayOfStringsOp, regex, RKLNoOptions, 0L, self, &searchRange, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture +{ + NSRange searchRange = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLArrayOfStringsOp, regex, RKLNoOptions, capture, self, &searchRange, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLArrayOfStringsOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLArrayOfStringsOp, regex, options, capture, self, &range, NULL, error, NULL, 0UL, NULL, NULL)); +} + +#pragma mark -captureComponentsMatchedByRegex: + +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex +{ + NSRange searchRange = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, RKLNoOptions, 0L, self, &searchRange, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, options, 0L, self, &range, NULL, error, NULL, 0UL, NULL, NULL)); +} + +#pragma mark -arrayOfCaptureComponentsMatchedByRegex: + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex +{ + NSRange searchRange = NSMaxiumRange; + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLArrayOfCapturesOp | RKLSubcapturesArray), regex, RKLNoOptions, 0L, self, &searchRange, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLArrayOfCapturesOp | RKLSubcapturesArray), regex, RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, 0UL, NULL, NULL)); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLArrayOfCapturesOp | RKLSubcapturesArray), regex, options, 0L, self, &range, NULL, error, NULL, 0UL, NULL, NULL)); +} + +#pragma mark -dictionaryByMatchingRegex: + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... +{ + NSRange searchRange = NSMaxiumRange; + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLDictionaryOfCapturesOp, regex, (RKLRegexOptions)RKLNoOptions, 0L, self, &searchRange, NULL, NULL, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... +{ + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLDictionaryOfCapturesOp, regex, (RKLRegexOptions)RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... +{ + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLDictionaryOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList +{ + return(rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLDictionaryOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, firstKey, varArgsList)); +} + +- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLDictionaryOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, count, keys, captures)); +} + +#pragma mark -arrayOfDictionariesByMatchingRegex: + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... +{ + NSRange searchRange = NSMaxiumRange; + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLArrayOfDictionariesOfCapturesOp, regex, (RKLRegexOptions)RKLNoOptions, 0L, self, &searchRange, NULL, NULL, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... +{ + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLArrayOfDictionariesOfCapturesOp, regex, (RKLRegexOptions)RKLNoOptions, 0L, self, &range, NULL, NULL, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... +{ + id returnObject = NULL; + va_list varArgsList; + va_start(varArgsList, firstKey); + returnObject = rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLArrayOfDictionariesOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, firstKey, varArgsList); + va_end(varArgsList); + return(returnObject); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList +{ + return(rkl_performDictionaryVarArgsOp(self, _cmd, (RKLRegexOp)RKLArrayOfDictionariesOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, firstKey, varArgsList)); +} + +- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count +{ + return(rkl_performRegexOp(self, _cmd, (RKLRegexOp)RKLArrayOfDictionariesOfCapturesOp, regex, options, 0L, self, &range, NULL, error, NULL, count, keys, captures)); +} + +#ifdef _RKL_BLOCKS_ENABLED + +//////////// +#pragma mark - +#pragma mark ^Blocks Related NSString Methods + +#pragma mark -enumerateStringsMatchedByRegex:usingBlock: + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = NO; + rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, (RKLRegexOptions)RKLNoOptions, self, NSMaxiumRange, (RKLBlockEnumerationOp)RKLBlockEnumerationMatchOp, 0UL, NULL, &errorFree, NULL, block, NULL); + return(errorFree == NO ? NO : YES); +} + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = NO; + rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, options, self, range, (RKLBlockEnumerationOp)RKLBlockEnumerationMatchOp, enumerationOptions, NULL, &errorFree, error, block, NULL); + return(errorFree == NO ? NO : YES); +} + +#pragma mark -enumerateStringsSeparatedByRegex:usingBlock: + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = NO; + rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLSplitOp, regex, (RKLRegexOptions)RKLNoOptions, self, NSMaxiumRange, (RKLBlockEnumerationOp)RKLBlockEnumerationMatchOp, 0UL, NULL, &errorFree, NULL, block, NULL); + return(errorFree == NO ? NO : YES); +} + +- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = NO; + rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLSplitOp, regex, options, self, range, (RKLBlockEnumerationOp)RKLBlockEnumerationMatchOp, enumerationOptions, NULL, &errorFree, error, block, NULL); + return(errorFree == NO ? NO : YES); +} + +#pragma mark -stringByReplacingOccurrencesOfRegex:usingBlock: + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + return(rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, (RKLRegexOptions)RKLNoOptions, self, NSMaxiumRange, (RKLBlockEnumerationOp)RKLBlockEnumerationReplaceOp, 0UL, NULL, NULL, NULL, NULL, block)); +} + +- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + return(rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, options, self, range, (RKLBlockEnumerationOp)RKLBlockEnumerationReplaceOp, enumerationOptions, NULL, NULL, error, NULL, block)); +} + +#endif // _RKL_BLOCKS_ENABLED + +@end + +//////////// +#pragma mark - +@implementation NSMutableString (RegexKitLiteAdditions) + +#pragma mark -replaceOccurrencesOfRegex: + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement +{ + NSRange searchRange = NSMaxiumRange; + NSInteger replacedCount = -1L; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLReplaceOp | RKLReplaceMutable), regex, RKLNoOptions, 0L, self, &searchRange, replacement, NULL, (void **)((void *)&replacedCount), 0UL, NULL, NULL); + return(replacedCount); +} + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange +{ + NSInteger replacedCount = -1L; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLReplaceOp | RKLReplaceMutable), regex, RKLNoOptions, 0L, self, &searchRange, replacement, NULL, (void **)((void *)&replacedCount), 0UL, NULL, NULL); + return(replacedCount); +} + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error +{ + NSInteger replacedCount = -1L; + rkl_performRegexOp(self, _cmd, (RKLRegexOp)(RKLReplaceOp | RKLReplaceMutable), regex, options, 0L, self, &searchRange, replacement, error, (void **)((void *)&replacedCount), 0UL, NULL, NULL); + return(replacedCount); +} + +#ifdef _RKL_BLOCKS_ENABLED + +//////////// +#pragma mark - +#pragma mark ^Blocks Related NSMutableString Methods + +#pragma mark -replaceOccurrencesOfRegex:usingBlock: + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = 0UL; + NSInteger replacedCount = -1L; + NSString *replacedString = rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, RKLNoOptions, self, NSMaxiumRange, (RKLBlockEnumerationOp)RKLBlockEnumerationReplaceOp, 0UL, &replacedCount, &errorFree, NULL, NULL, block); + if((errorFree == YES) && (replacedCount > 0L)) { [self replaceCharactersInRange:NSMakeRange(0UL, [self length]) withString:replacedString]; } + return(replacedCount); +} + +- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block +{ + NSUInteger errorFree = 0UL; + NSInteger replacedCount = -1L; + NSString *replacedString = rkl_performEnumerationUsingBlock(self, _cmd, (RKLRegexOp)RKLCapturesArrayOp, regex, options, self, range, (RKLBlockEnumerationOp)RKLBlockEnumerationReplaceOp, enumerationOptions, &replacedCount, &errorFree, error, NULL, block); + if((errorFree == YES) && (replacedCount > 0L)) { [self replaceCharactersInRange:range withString:replacedString]; } + return(replacedCount); +} + +#endif // _RKL_BLOCKS_ENABLED + +@end diff --git a/ISF Editor/SyphonVVBufferPoolAdditions.h b/ISF Editor/SyphonVVBufferPoolAdditions.h new file mode 100644 index 00000000..231529f7 --- /dev/null +++ b/ISF Editor/SyphonVVBufferPoolAdditions.h @@ -0,0 +1,54 @@ +// +// SyphonVVBufferPoolAdditions.h +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/25/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import +//#import +#import +#import +#import + + + + +// i'm defining this arbitrary constant as the value "100". the VVBufferBackID type declared in the VVBufferPool framework is a convenience variable- it doesn't affect the functionality of the backend at all, and exists to make it easier to quickly create ad-hoc bridges between this framework and other graphic APIs. +#define VVBufferBackID_Syphon 100 + + + + +@interface VVBufferPool (VVBufferPoolAdditions) + + +- (VVBuffer *) allocBufferForSyphonClient:(SyphonClient *)c; + + +@end + + + + + + + + + + + + +@interface VVBuffer (VVBufferAdditions) + + +- (SyphonImage *) syphonImage; +//- (void) setSyphonImage:(SyphonImage *)n; + + +@end + + +void VVBuffer_ReleaseSyphonImage(id b, void *c); + diff --git a/ISF Editor/SyphonVVBufferPoolAdditions.m b/ISF Editor/SyphonVVBufferPoolAdditions.m new file mode 100644 index 00000000..8653d973 --- /dev/null +++ b/ISF Editor/SyphonVVBufferPoolAdditions.m @@ -0,0 +1,116 @@ +// +// SyphonVVBufferPoolAdditions.m +// ISF Syphon Filter Tester +// +// Created by bagheera on 11/25/13. +// Copyright (c) 2013 zoidberg. All rights reserved. +// + +#import "SyphonVVBufferPoolAdditions.h" + + + + +@implementation VVBufferPool (VVBufferPoolAdditions) + + +- (VVBuffer *) allocBufferForSyphonClient:(SyphonClient *)c { + if (deleted) + return nil; + if (c == nil) { + NSLog(@"\t\terr: passed nil img %s",__func__); + return nil; + } + // probably not necessary, but ensures that nothing else uses the GL context while we are- unlock as soon as we're done working with the context + pthread_mutex_lock(&contextLock); + // get a new image from the client! + SyphonImage *newImage = [c newFrameImageForContext:[context CGLContextObj]]; + pthread_mutex_unlock(&contextLock); + + NSRect newSrcRect = NSMakeRect(0,0,0,0); + newSrcRect.size = [newImage textureSize]; + + /* make and configure the buffer i'll be returning. syphon actually created the GL texture, + so instead of asking the VVBufferPool framework to allocate a texture, we're just going to + create a VVBuffer instance, populate it with the properties of the texture created by Syphon, + and then set up the VVBuffer to retain the underlying SyphonImage resource (which will be freed + when the VVBuffer is released) */ + VVBuffer *returnMe = [[VVBuffer alloc] initWithPool:self]; + [VVBufferPool timestampThisBuffer:returnMe]; // timestamp the buffer. if done judiciously, can help with tracking "new" content + VVBufferDescriptor *desc = [returnMe descriptorPtr]; // get the buffer's descriptor. this is a ptr to a C structure which contains the basic properties of the buffer. C struct because its contents are used to compare buffers/locate "free" buffers in the pool, and as such its contents need to be immediately accessible + desc->type = VVBufferType_Tex; // it's a GL texture resources (there are other values in this typdef representing other types of resources) + desc->target = GL_TEXTURE_RECTANGLE_EXT; // this is what kind of texture it is (rect or 2d) + desc->internalFormat = VVBufferIF_RGBA8; // the GL texture internal format (tex will be created with this property- if tex is created externally, this should match the tex's actual properties) + desc->pixelFormat = VVBufferPF_BGRA; // the GL texture pixel format (tex will be created with this property- if tex is created externally, this should match the tex's actual properties) + desc->pixelType = VVBufferPT_U_Int_8888_Rev; // the GL texture pixel type (tex will be created with this property- if tex is created externally, this should match the tex's actual properties) + desc->cpuBackingType = VVBufferCPUBack_None; // what kind of CPU backing there is- none, internal (created/freed by this framework/API), or external (created/freed by another API) + desc->gpuBackingType = VVBufferGPUBack_External; // what kind of GPU backing there is- none, internal (created/freed by this framework/API), or external (created/freed by another API) + desc->name = [newImage textureName]; // the actual GL texture name. this is what you bind when you want to draw a texture. + desc->texRangeFlag = NO; // reserved, set to NO for now. + desc->texClientStorageFlag = NO; // reserved, set to NO for now. + desc->msAmount = 0; // only used with renderbuffers doing multi-sample anti-aliasing. ignored with textures, set to 0. + desc->localSurfaceID = 0; // only used when working with associating textures with IOSurfaces- set to 0. + + [returnMe setPreferDeletion:YES]; // we want to make sure that this buffer isn't pooled (the VVBuffer is just a wrapper around a syphon-created and syphon-controlled GL resource- it doesn't belong in this buffer pool) + [returnMe setSize:[newImage textureSize]]; // set the buffer's size. the "size" is the size of the GL resource, and is always in pixels. + [returnMe setSrcRect:newSrcRect]; // set the buffer's "srcRect". the "srcRect" is the area of the GL resource that is used to describe the image this VVBuffer represents. the units are always in pixels (even if the buffer is a GL_TEXTURE_2D, and its tex coords are normalized). this is used to describe images that don't occupy the full region of a texture, and do zero-cost cropping. the srcRect is respected by everything in this framework. + [returnMe setBackingSize:[newImage textureSize]]; // the backing size is the size (in pixels) of whatever's backing the GL resource. there's no CPU backing in this case- just set it to be the same as the buffer's "size". + [returnMe setBackingID:VVBufferBackID_Syphon]; // set the backing ID to indicate that this buffer was created by wrapping a syphon image. + + // set up the buffer i'm returning to use this callback when it's released- we'll free the SyphonImage in this callback + [returnMe setBackingReleaseCallback:VVBuffer_ReleaseSyphonImage]; + // make sure the buffer i'm returning retains the image from the client! + [returnMe setBackingReleaseCallbackContextObject:newImage]; + + // the 'newImage' we got from the syphon client was retained, so release it + [newImage release]; + return returnMe; +} + + +@end + + + + + + + + + + + + + + + + + +@implementation VVBuffer (VVBufferAdditions) + + +- (SyphonImage *) syphonImage { + SyphonImage *syphonImage = ((long)backingID==VVBufferBackID_Syphon) ? backingReleaseCallbackContext : nil; + return syphonImage; +} +/* +- (void) setSyphonImage:(SyphonImage *)n { + SyphonImage *syphonImage = (descriptor.backingType==VVBufferBack_Syphon) ? backingReleaseCallbackContext : nil; + VVRELEASE(syphonImage); + backingReleaseCallback = VVBuffer_ReleaseSyphonImage; + backingReleaseCallbackContext = n; + if (n != nil) + [n retain]; +} +*/ + + +@end + + + +void VVBuffer_ReleaseSyphonImage(id b, void *c) { + SyphonImage *tmpImg = c; + if (tmpImg != nil) + [tmpImg release]; +} diff --git a/ISF Editor/SyphonVideoSource.h b/ISF Editor/SyphonVideoSource.h new file mode 100644 index 00000000..15696701 --- /dev/null +++ b/ISF Editor/SyphonVideoSource.h @@ -0,0 +1,14 @@ +#import +#import "VideoSource.h" +#import + + + + +@interface SyphonVideoSource : VideoSource { + SyphonClient *propClient; +} + +- (void) loadServerWithServerDescription:(NSDictionary *)n; + +@end diff --git a/ISF Editor/SyphonVideoSource.m b/ISF Editor/SyphonVideoSource.m new file mode 100644 index 00000000..626375b9 --- /dev/null +++ b/ISF Editor/SyphonVideoSource.m @@ -0,0 +1,114 @@ +#import "SyphonVideoSource.h" +#import "SyphonVVBufferPoolAdditions.h" + + + + +@implementation SyphonVideoSource + + +/*===================================================================================*/ +#pragma mark --------------------- init/dealloc +/*------------------------------------*/ + + +- (id) init { + if (self = [super init]) { + // register for notifications when syphon servers change + for (NSString *notificationName in [NSArray arrayWithObjects:SyphonServerAnnounceNotification, SyphonServerUpdateNotification, SyphonServerRetireNotification,nil]) { + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(syphonServerChangeNotification:) + name:notificationName + object:nil]; + } + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super prepareToBeDeleted]; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + [super dealloc]; +} + + +/*===================================================================================*/ +#pragma mark --------------------- superclass overrides +/*------------------------------------*/ + + +- (NSArray *) arrayOfSourceMenuItems { + NSMutableArray *returnMe = nil; + SyphonServerDirectory *sd = [SyphonServerDirectory sharedDirectory]; + NSArray *servers = (sd==nil) ? nil : [sd servers]; + if (servers != nil) { + for (NSDictionary *serverDict in servers) { + if (returnMe == nil) + returnMe = MUTARRAY; + NSString *serverName = [NSString stringWithFormat:@"%@-%@",[serverDict objectForKey:SyphonServerDescriptionAppNameKey],[serverDict objectForKey:SyphonServerDescriptionNameKey]]; + NSMenuItem *tmpItem = [[NSMenuItem alloc] initWithTitle:serverName action:nil keyEquivalent:@""]; + [tmpItem setRepresentedObject:serverDict]; + [returnMe addObject:tmpItem]; + [tmpItem release]; + } + } + return returnMe; +} +- (void) _stop { + VVRELEASE(propClient); +} +- (VVBuffer *) allocBuffer { + VVBuffer *newBuffer = nil; + + OSSpinLockLock(&propLock); + if (propClient!=nil && [propClient hasNewFrame]) { + newBuffer = [_globalVVBufferPool allocBufferForSyphonClient:propClient]; + } + OSSpinLockUnlock(&propLock); + + return newBuffer; +} + + +/*===================================================================================*/ +#pragma mark --------------------- misc +/*------------------------------------*/ + + +- (void) loadServerWithServerDescription:(NSDictionary *)n { + if ([self propRunning]) + [self stop]; + if (n==nil) + return; + + OSSpinLockLock(&propLock); + propClient = [[SyphonClient alloc] + initWithServerDescription:n + options:nil + newFrameHandler:nil]; + OSSpinLockUnlock(&propLock); + + [self start]; +} +- (void) syphonServerChangeNotification:(NSNotification *)note { + //NSLog(@"%s",__func__); + id localDelegate = nil; + OSSpinLockLock(&propLock); + localDelegate = (propDelegate==nil) ? nil : [(id)propDelegate retain]; + OSSpinLockUnlock(&propLock); + + if (localDelegate != nil) { + [localDelegate listOfStaticSourcesUpdated:self]; + [localDelegate release]; + localDelegate = nil; + } +} + + +@end diff --git a/ISF Editor/UnselectableTableView.h b/ISF Editor/UnselectableTableView.h new file mode 100644 index 00000000..09dc6dd3 --- /dev/null +++ b/ISF Editor/UnselectableTableView.h @@ -0,0 +1,5 @@ +#import + +@interface UnselectableTableView : NSTableView + +@end diff --git a/ISF Editor/UnselectableTableView.m b/ISF Editor/UnselectableTableView.m new file mode 100644 index 00000000..2f771c80 --- /dev/null +++ b/ISF Editor/UnselectableTableView.m @@ -0,0 +1,25 @@ +#import "UnselectableTableView.h" + +@implementation UnselectableTableView + +/* source: http://www.corbinstreehouse.com/blog/2014/04/nstableview-tips-not-delaying-the-first-responder/ + + Now normally when you try to directly click on one of the NSTextFields the table will first select + the row. Then a second click will allow you to start editing. For most tables, this is the behavior + you want. For something like what I have, I want to avoid this, and allow the first responder to + go through. This can easily be done by subclassing NSTableView and overriding: + + - (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event { + return YES; // no delay + } + NSTableView’s default logic is a bit complex that allows things to go through or not based on several + properties. This method is declared in NSResponder.h, and it is sent up the responder chain when + the text field itself attempts to become first responder. When NSTableView gets it, it does some + determination to determine if it should go through or not. If it wasn’t an already selected row, + it returns NO; this causes the table to get the mouseDown: and do the selection logic. I don’t + care what control was clicked; I want it to go through without selecting, and always return YES. */ +- (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event { + return YES; // no delay +} + +@end diff --git a/ISF Editor/VVBufferSpriteGLView.h b/ISF Editor/VVBufferSpriteGLView.h new file mode 100644 index 00000000..d1ee723b --- /dev/null +++ b/ISF Editor/VVBufferSpriteGLView.h @@ -0,0 +1,26 @@ +#import +#import +#import +#import + + + + +@interface VVBufferSpriteGLView : VVSpriteGLView { + VVSizingMode sizingMode; + + VVSprite *bgSprite; + + OSSpinLock retainDrawLock; + VVBuffer *retainDrawBuffer; +} + +- (void) redraw; +/// Draws the passd buffer +- (void) drawBuffer:(VVBuffer *)b; +/// Sets the GL context to share- this is generally done automatically (using the global buffer pool's shared context), but if you want to override it and use a different context...this is how. +- (void) setSharedGLContext:(NSOpenGLContext *)c; + +@property (assign,readwrite) VVSizingMode sizingMode; + +@end diff --git a/ISF Editor/VVBufferSpriteGLView.m b/ISF Editor/VVBufferSpriteGLView.m new file mode 100644 index 00000000..a6c38ff7 --- /dev/null +++ b/ISF Editor/VVBufferSpriteGLView.m @@ -0,0 +1,143 @@ +#import "VVBufferSpriteGLView.h" + + + + +@implementation VVBufferSpriteGLView + + +- (void) generalInit { + [super generalInit]; + + sizingMode = VVSizingModeFit; + bgSprite = nil; + retainDrawLock = OS_SPINLOCK_INIT; + retainDrawBuffer = nil; + + bgSprite = [spriteManager makeNewSpriteAtBottomForRect:NSMakeRect(0,0,1,1)]; + if (bgSprite != nil) { + [bgSprite setDelegate:self]; + [bgSprite setActionCallback:@selector(actionBgSprite:)]; + [bgSprite setDrawCallback:@selector(drawBgSprite:)]; + } +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + + OSSpinLockLock(&retainDrawLock); + VVRELEASE(retainDrawBuffer); + OSSpinLockUnlock(&retainDrawLock); + + [super dealloc]; +} + +- (void) updateSprites { + [super updateSprites]; + + [bgSprite setRect:[self backingBounds]]; + + spritesNeedUpdate = NO; +} + +- (void) actionBgSprite:(VVSprite *)s { + NSLog(@"%s",__func__); +} +- (void) drawBgSprite:(VVSprite *)s { + //NSLog(@"%s",__func__); + + OSSpinLockLock(&retainDrawLock); + VVBuffer *drawBuffer = (retainDrawBuffer==nil) ? nil : [retainDrawBuffer retain]; + OSSpinLockUnlock(&retainDrawLock); + + GLuint target = (drawBuffer==nil) ? GL_TEXTURE_RECTANGLE_EXT : [drawBuffer target]; + if (initialized) { + CGLContextObj cgl_ctx = [[self openGLContext] CGLContextObj]; + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + //glBlendFunc(GL_ONE, GL_ZERO); + //glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST); + glDisable(GL_DEPTH_TEST); + glClearColor(0.0, 0.0, 0.0, 1.0); + + glEnable(target); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + // bilinear filtering stuff + //glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + //glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + //glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + // set up the view to draw + NSRect bounds = [self backingBounds]; + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glViewport(0, 0, (GLsizei) bounds.size.width, (GLsizei) bounds.size.height); + //if (flipped) + glOrtho(bounds.origin.x, bounds.origin.x+bounds.size.width, bounds.origin.y, bounds.origin.y+bounds.size.height, 1.0, -1.0); + //else + // glOrtho(bounds.origin.x, bounds.origin.x+bounds.size.width, bounds.origin.y+bounds.size.height, bounds.origin.y, 1.0, -1.0); + //glEnable(GL_BLEND); + //glBlendFunc(GL_SRC_ALPHA,GL_DST_ALPHA); + //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glDisable(GL_BLEND); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + // clear the view + glClearColor(0.0,0.0,0.0,0.0); + glClear(GL_COLOR_BUFFER_BIT); + + + if (drawBuffer != nil) { + //NSSize bufferSize = [b size]; + //BOOL bufferFlipped = [b flipped]; + NSRect destRect = [VVSizingTool + //rectThatFitsRect:NSMakeRect(0,0,bufferSize.width,bufferSize.height) + rectThatFitsRect:[drawBuffer srcRect] + inRect:bounds + sizingMode:sizingMode]; + + + GLDRAWTEXQUADMACRO([drawBuffer name],[drawBuffer target],[drawBuffer flipped],[drawBuffer glReadySrcRect],destRect); + } + // flush! + glFlush(); + + glDisable(target); + } + + VVRELEASE(drawBuffer); +} + + +- (void) redraw { + [self performDrawing:[self bounds]]; +} +- (void) drawBuffer:(VVBuffer *)b { + //NSLog(@"%s",__func__); + OSSpinLockLock(&retainDrawLock); + VVRELEASE(retainDrawBuffer); + retainDrawBuffer = (b==nil) ? nil : [b retain]; + OSSpinLockUnlock(&retainDrawLock); + + [self redraw]; +} +- (void) setSharedGLContext:(NSOpenGLContext *)c { + NSOpenGLContext *newCtx = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:c]; + [self setOpenGLContext:newCtx]; + [newCtx setView:self]; + [newCtx release]; + newCtx = nil; +} + + +@synthesize sizingMode; + + +@end diff --git a/ISF Editor/VVKQueueCenter.h b/ISF Editor/VVKQueueCenter.h new file mode 100644 index 00000000..40335821 --- /dev/null +++ b/ISF Editor/VVKQueueCenter.h @@ -0,0 +1,86 @@ +#import +#import +#import +#import +#import + + + + +/* + +let's give credit where credit's due: + +i learned how kqueues work by reading stuff online and looking at other +peoples' uses of kqueues. this class (and my understanding of kqueues) +was shaped significantly by the "UKKQueue" class, by M. Uli Kusterer. + +if you don't want to write your own cocoa implementation of kqueues, you +should really look for this class- it's well-written, does much more than +this paltry, bare-bones implementation, and is highly functional. + +thanks, Uli! + +*/ + + + + +@protocol VVKQueueCenterDelegate +- (void) file:(NSString *)p changed:(u_int)fflag; +@end + + + + +extern id _mainVVKQueueCenter; + + + + +@interface VVKQueueCenter : NSObject { + int kqueueFD; + + MutLockArray *entries; // stores the entries that the center is currently observing + MutLockArray *entryChanges; // stores changes to the entries (changes are accumulated here and then applied on a specific thread) + + BOOL threadHaltFlag; + BOOL currentlyProcessing; +} + ++ (id) mainCenter; + ++ (void) addObserver:(id)o forPath:(NSString *)p; ++ (void) removeObserver:(id)o; ++ (void) removeObserver:(id)o forPath:(NSString *)p; + +- (void) addObserver:(id)o forPath:(NSString *)p; +- (void) removeObserver:(id)o; +- (void) removeObserver:(id)o forPath:(NSString *)p; + +@end + + + + + + +@interface VVKQueueEntry : NSObject { + NSString *path; + NSNumber *fd; + OSSpinLock delegateLock; + ObjectHolder *delegate; + + BOOL addFlag; // used to indicate if we want to add or remove this entry- ignored once the entry is stored in the 'entries' array in the center +} + ++ (id) createWithDelegate:(id)d path:(NSString *)p; +- (id) initWithDelegate:(id)d path:(NSString *)p; + +@property (retain,readwrite) NSString *path; +@property (retain,readwrite,setter=setFD:) NSNumber *fd; +@property (assign,readwrite) id delegate; +@property (assign,readwrite) BOOL addFlag; + +@end + diff --git a/ISF Editor/VVKQueueCenter.m b/ISF Editor/VVKQueueCenter.m new file mode 100644 index 00000000..bad61c3a --- /dev/null +++ b/ISF Editor/VVKQueueCenter.m @@ -0,0 +1,369 @@ +#import "VVKQueueCenter.h" + + + + +id _mainVVKQueueCenter = nil; + + + + +@interface VVKQueueCenter () +- (void) updateEntries; +- (BOOL) startConnectionForPathIfNeeded:(NSString *)p fileDescriptor:(int)fd; +- (void) closeConnectionForPathIfNeeded:(NSString *)p fileDescriptor:(int)fd; +@end + + + + +@implementation VVKQueueCenter + + ++ (void) initialize { + _mainVVKQueueCenter = [[VVKQueueCenter alloc] init]; +} ++ (id) mainCenter { + return _mainVVKQueueCenter; +} ++ (void) addObserver:(id)o forPath:(NSString *)p { + [_mainVVKQueueCenter addObserver:o forPath:p]; +} ++ (void) removeObserver:(id)o { + [_mainVVKQueueCenter removeObserver:o]; +} ++ (void) removeObserver:(id)o forPath:(NSString *)p { + [_mainVVKQueueCenter removeObserver:o forPath:p]; +} +- (id) init { + self = [super init]; + if (self != nil) { + kqueueFD = -1; + entries = [[MutLockArray alloc] init]; + entryChanges = [[MutLockArray alloc] init]; + threadHaltFlag = NO; + currentlyProcessing = NO; + + kqueueFD = kqueue(); + if (kqueueFD == -1) { + NSLog(@"\t\terr: couldn't create kqueueFD: %d",kqueueFD); + goto BAIL; + } + + [NSThread detachNewThreadSelector:@selector(threadLaunch:) toTarget:self withObject:nil]; + } + return self; + BAIL: + [self release]; + return nil; +} +- (void) dealloc { + threadHaltFlag = YES; + while (currentlyProcessing) + pthread_yield_np(); + if (kqueueFD != -1) + close(kqueueFD); + VVRELEASE(entries); + VVRELEASE(entryChanges); + [super dealloc]; +} + + +- (void) threadLaunch:(id)sender { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + USE_CUSTOM_ASSERTION_HANDLER + + int poolCount = 0; + int fileDescriptor = kqueueFD; + + //if ([VVStatChecker maxFileHandlerCount]==0) + // [VVStatChecker computeMaxFileHandlerCount]; + + currentlyProcessing = YES; + while (!threadHaltFlag) { + int n; + struct kevent event; + struct timespec timeout = {1,0}; + + [self updateEntries]; + + n = kevent(kqueueFD, NULL, 0, &event, 1, &timeout); + + if ([entryChanges count]>0) + [self updateEntries]; + + if (n > 0) { + //NSLog(@"\t\tfound event"); + if (event.filter == EVFILT_VNODE) { + if (event.fflags) { + NSString *path = [[(NSString *)event.udata retain] autorelease]; + // find all the entries matching the path + NSMutableArray *entriesToPing = nil; + [entries rdlock]; + for (VVKQueueEntry *entry in [entries array]) { + NSString *entryPath = [entry path]; + if (entryPath!=nil && [entryPath isEqualToString:path]) { + if (entriesToPing == nil) + entriesToPing = MUTARRAY; + [entriesToPing addObject:entry]; + } + } + [entries unlock]; + // if there are entries to ping- do so now! + for (VVKQueueEntry *entry in entriesToPing) { + [[entry delegate] file:path changed:event.fflags]; + } + } + } + } + + // purge an entries with nil delegates (which will happen if the delegate was freed but not remvoed as an observer) + NSMutableIndexSet *indexesToDelete = nil; + [entries wrlock]; + NSInteger tmpIndex = 0; + for (VVKQueueEntry *entry in [entries array]) { + if ([entry delegate]==nil) { + if (indexesToDelete == nil) + indexesToDelete = [[[NSMutableIndexSet alloc] init] autorelease]; + [indexesToDelete addIndex:tmpIndex]; + } + ++tmpIndex; + } + if (indexesToDelete != nil) + [entries removeObjectsAtIndexes:indexesToDelete]; + [entries unlock]; + + + ++poolCount; + if (poolCount > 1) { + [pool release]; + pool = [[NSAutoreleasePool alloc] init]; + poolCount = 0; + } + } + + close(fileDescriptor); + currentlyProcessing = NO; + + [pool release]; +} + + +- (void) addObserver:(id)o forPath:(NSString *)p { + // make an entry + VVKQueueEntry *newEntry = [VVKQueueEntry createWithDelegate:o path:p]; + if (newEntry == nil) + return; + // we want this entry to be an "add" + [newEntry setAddFlag:YES]; + // add it to the array of changes + [entryChanges lockAddObject:newEntry]; +} +- (void) removeObserver:(id)o { + // make an entry + VVKQueueEntry *newEntry = [VVKQueueEntry createWithDelegate:o path:nil]; + if (newEntry == nil) + return; + // we want this entry to be an "remove" + [newEntry setAddFlag:NO]; + // add it to the array of changes + [entryChanges lockAddObject:newEntry]; +} +- (void) removeObserver:(id)o forPath:(NSString *)p { + // make an entry + VVKQueueEntry *newEntry = [VVKQueueEntry createWithDelegate:o path:p]; + if (newEntry == nil) + return; + // we want this entry to be an "remove" + [newEntry setAddFlag:NO]; + // add it to the array of changes + [entryChanges lockAddObject:newEntry]; +} + + +- (void) updateEntries { + // copy the contents of 'entryChanges', then clear it out + [entryChanges wrlock]; + NSMutableArray *tmpChanges = [entryChanges createArrayCopy]; + [entryChanges removeAllObjects]; + [entryChanges unlock]; + + // run through the copied entries, applying their changes + for (VVKQueueEntry *tmpEntry in tmpChanges) { + NSString *tmpPath = [tmpEntry path]; + id tmpDelegate = [tmpEntry delegate]; + // if we're supposed to be adding this entry... + if ([tmpEntry addFlag]) { + // calculate and set the entry's file descriptor... + int fileDescriptor = open([tmpPath fileSystemRepresentation], O_EVTONLY, 0); + if (fileDescriptor < 0) { + NSLog(@"error: entries count %ld on failure to opening rep. for path to watch, %s : %@",[entries lockCount],__func__,tmpPath); + continue; + } + [tmpEntry setFD:NUMINT(fileDescriptor)]; + + // start the connection + [self startConnectionForPathIfNeeded:tmpPath fileDescriptor:fileDescriptor]; + + // add the entry to the array of entries AFTER STARTING THE CONNECTION (order is important) + [entries lockAddObject:tmpEntry]; + } + else { + // remove the entry (or entries!) from the array of entries BEFORE CLOSING THE CONNECTION (order is important) + + NSMutableIndexSet *indexesToRemove = nil; + NSArray *entriesToRemove = nil; + NSInteger tmpIndex = 0; + [entries wrlock]; + // if there's no "path", then we want to remove all existing entries that match the tmp entry's delegate + if (tmpPath == nil) { + for (VVKQueueEntry *existingEntry in [entries array]) { + if ([existingEntry delegate] == tmpDelegate) { + if (indexesToRemove == nil) + indexesToRemove = [[[NSMutableIndexSet alloc] init] autorelease]; + [indexesToRemove addIndex:tmpIndex]; + } + ++tmpIndex; + } + } + // else there's a "path"- we want to remove only the entries that are an exact match to the tmp entry's delegate/path + else { + for (VVKQueueEntry *existingEntry in [entries array]) { + id existingDelegate = [existingEntry delegate]; + NSString *existingPath = [existingEntry path]; + if (existingDelegate==tmpDelegate && existingPath!=nil && [existingPath isEqualToString:tmpPath]) { + if (indexesToRemove == nil) + indexesToRemove = [[[NSMutableIndexSet alloc] init] autorelease]; + [indexesToRemove addIndex:tmpIndex]; + } + ++tmpIndex; + } + } + // copy the entries we're about to remove (we want their FDs), then remove them from the array of entries + if (indexesToRemove != nil) { + entriesToRemove = [entries objectsAtIndexes:indexesToRemove]; + [entries removeObjectsAtIndexes:indexesToRemove]; + } + [entries unlock]; + + // run through the array of entries we just removed from the array, closing the connection for each + for (VVKQueueEntry *entryToRemove in entriesToRemove) { + // close the connection AFTER REMOVING THE ENTRIES FROM THE ARRAY (order is important) + [self closeConnectionForPathIfNeeded:[entryToRemove path] fileDescriptor:[[entryToRemove fd] intValue]]; + } + } + } +} +- (BOOL) startConnectionForPathIfNeeded:(NSString *)p fileDescriptor:(int)fd { + //NSLog(@"%s",__func__); + if (p == nil) + return NO; + + BOOL needsStart = YES; + // Go through the paths array + // If a match is found, BAIL + [entries rdlock]; + for (VVKQueueEntry *entry in [entries array]) { + NSString *entryPath = [entry path]; + if (entryPath!=nil && [entryPath isEqualToString:p]) { + needsStart = NO; + break; + } + } + [entries unlock]; + + if (needsStart) { + //NSLog(@"\t\t %@ with fd %ld", p, fd); + struct kevent event; + struct timespec tmpTime = {0,0}; + EV_SET(&event, + fd, + EVFILT_VNODE, + EV_ADD | EV_ENABLE | EV_CLEAR, + NOTE_RENAME | NOTE_WRITE | NOTE_DELETE | NOTE_ATTRIB, + 0, + [p copy]); + + kevent(kqueueFD, &event, 1, NULL, 0, &tmpTime); + } + + return needsStart; +} +- (void) closeConnectionForPathIfNeeded:(NSString *)p fileDescriptor:(int)fd { + //NSLog(@"%s",__func__); + if (p == nil) + return; + + BOOL needsClose = YES; + // Go through the paths array + // If a match is found, BAIL + [entries rdlock]; + for (VVKQueueEntry *entry in [entries array]) { + NSString *entryPath = [entry path]; + if (entryPath!=nil && [entryPath isEqualToString:p]) { + needsClose = NO; + break; + } + } + [entries unlock]; + + if (needsClose) { + //NSLog(@"\t\tclosing %@ with fd %ld", p, fd); + close(fd); + } +} + + +@end + + + +#pragma mark - +#pragma mark - + + + +@implementation VVKQueueEntry + + ++ (id) createWithDelegate:(id)d path:(NSString *)p { + return [[[VVKQueueEntry alloc] initWithDelegate:d path:p] autorelease]; +} +- (id) initWithDelegate:(id)d path:(NSString *)p { + self = [super init]; + if (self != nil) { + path = nil; + fd = nil; + delegateLock = OS_SPINLOCK_INIT; + delegate = nil; + [self setDelegate:d]; + [self setPath:p]; + } + return self; +} +- (void) dealloc { + [self setPath:nil]; + [self setFD:nil]; + [self setDelegate:nil]; + [super dealloc]; +} +@synthesize path; +@synthesize fd; +- (void) setDelegate:(id)n { + OSSpinLockLock(&delegateLock); + VVRELEASE(delegate); + if (n!=nil && [(id)n respondsToSelector:@selector(file:changed:)]) + delegate = [[ObjectHolder alloc] initWithZWRObject:n]; + OSSpinLockUnlock(&delegateLock); +} +- (id) delegate { + OSSpinLockLock(&delegateLock); + id returnMe = [delegate object]; + OSSpinLockUnlock(&delegateLock); + return returnMe; +} +@synthesize addFlag; + + +@end \ No newline at end of file diff --git a/ISF Editor/VVMetadataItem.h b/ISF Editor/VVMetadataItem.h new file mode 100644 index 00000000..0495a653 --- /dev/null +++ b/ISF Editor/VVMetadataItem.h @@ -0,0 +1,53 @@ +/* + + To Do: + • Add support for aliases + • Additonal fallback for non-disk based files + +*/ + +#import + + +@interface VVMetadataItem : NSObject { + BOOL isFileURL; + + // if possible, use MDItemRef- it uses spotlight services to get info from a disk-based file + + MDItemRef _item; + + // -or- + + // if an MDItemRef is not available for the path (say the file is on a disk that has not been indexed) + // then I can fall-back on using a combintion of FSRef / NSWorkspace / NSFileManager / Launch Services to get *some* of the same file data + + NSDictionary *_attributes; // file attributes to store + +} ++ (id) createWithPath:(NSString *)p; +- (id) initWithPath:(NSString *)p; + ++ (id) createWithMDItemRef:(MDItemRef)md; +- (id) initWithMDItemRef:(MDItemRef)md; + +// This method is the fallback in case the drive is not spotlight indexed +// Instead of using an MDItemRef to retrieve meta data / track a file it uses a combination of workspace & filemanager +// methods to determine the most common file attributes +- (void) loadAttributesFromFilePath:(NSString *)p; +- (void) addTypeTreeForUTI:(NSString *)p; + +// calls MDItemCopyAttribute + autorelease +- (id) valueForAttribute:(id)attribute; + +// calls MDItemCopyAttributes + autorelease +- (NSDictionary *) valuesForAttributes:(NSArray *)attributes; + +// calls MDItemCopyAttributeNames +- (NSArray *) attributes; + +// For easy access to the most common file attributes- +// returns the [self valueForAttribute:kMDItemPath] +- (NSString *) path; +// returns the [self valueForAttribute:kMDItemDisplayName] +- (NSString *) displayName; +@end diff --git a/ISF Editor/VVMetadataItem.m b/ISF Editor/VVMetadataItem.m new file mode 100644 index 00000000..ce3e3864 --- /dev/null +++ b/ISF Editor/VVMetadataItem.m @@ -0,0 +1,380 @@ +#import "VVMetadataItem.h" +#import +//#import "NSFileManagerAdditions.h" + +static NSMutableDictionary *_UTITable = NULL; + +@implementation VVMetadataItem + ++ (void) initialize { + //NSLog(@"%s",__func__); + if (_UTITable != nil) + return; + _UTITable = [[NSMutableDictionary dictionaryWithCapacity:0] retain]; +} + ++ (id) createWithPath:(NSString *)p { + //return [[[VVMetadataItem alloc] initWithPath:p] autorelease]; + if (p==nil) + return nil; + + VVMetadataItem *returnMe = [[VVMetadataItem alloc] initWithPath:p]; + if (returnMe == nil) + return nil; + return [returnMe autorelease]; +} + +- (id) initWithPath:(NSString *)p { + //NSLog(@"%s",__func__); + if (p == nil) + goto BAIL; + + NSFileManager *fm = [[NSFileManager alloc] init]; + if (![fm fileExistsAtPath:p]) { + [fm release]; + goto BAIL; + } + + [fm release]; + + if (self = [super init]) { + //NSLog(@"\t\tloading path : %@", p); + // If it is disk based.. + _item = MDItemCreate(NULL, (CFStringRef)p); + //_item = NULL; + + // If the meta data object doesn't work, make a fake attributes dict with whatever information I do have + if (_item==NULL) { + NSLog(@"err: meta data item was null for path %@",p); + [self loadAttributesFromFilePath:p]; + } + // If the meta data item fails to return for content type or path, use the fallback + else if (([self valueForKey:@"kMDItemContentType"]==nil)|| + ([[self valueForKey:@"kMDItemContentType"] isEqualToString:@""])|| + ([self valueForKey:@"kMDItemPath"]==nil)|| + ([[self valueForKey:@"kMDItemPath"] isEqualToString:@""])) { + NSLog(@"err: MDItem created but no content type detected at path - %@",p); + CFRelease(_item); + _item = NULL; + //[self performSelectorOnMainThread:@selector(loadAttributesFromFilePath:) withObject:p waitUntilDone:YES]; + [self loadAttributesFromFilePath:p]; + //NSLog(@"\t\tattribs: %@", [self valuesForAttributes:[self attributes]]); + } + + + return self; + } +BAIL: + if (self != nil) + [self release]; + return nil; +} + ++ (id) createWithMDItemRef:(MDItemRef)md { + VVMetadataItem *returnMe = [[VVMetadataItem alloc] initWithMDItemRef:md]; + if (returnMe == nil) + return nil; + return [returnMe autorelease]; +} + +- (id) initWithMDItemRef:(MDItemRef)md { + if (md == NULL) + goto BAIL; + + if (self = [super init]) { + //NSLog(@"\t\tloading path : %@", p); + // If it is disk based.. + _item = md; + CFRetain(_item); + + return self; + } +BAIL: + [self release]; + return nil; +} + +- (void) loadAttributesFromFilePath:(NSString *)p { + if (p==nil) + return; + //NSLog(@"%s - %@",__func__, p); + NSFileManager *fm = [[NSFileManager alloc] init]; + NSMutableDictionary *tmpDict = [NSMutableDictionary dictionaryWithCapacity:0]; + + // MDItem can only work if the drive the file is on was indexed with spotlight + // This is the fallback method- uses a combination of NSWorkspace / NSFileManager / FSRef's + // to get / track the basic information needed and makes it available using the same keys as MDItem would use + + Boolean isDirectory = false; + NSString *contentType = nil; + NSWorkspace *ws = [[[NSWorkspace alloc] init] autorelease]; + + // Try to create a url from this and if it works see if it has a fileReferenceURL + CFURLRef filePathURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)p, kCFURLPOSIXPathStyle, NO); + + // If that fails, this might not be a disk based file + // Use this fallback for the path / name / content type / etc. + if ((filePathURL == NULL) || ([(NSURL *)filePathURL fileReferenceURL] == nil)) { + [tmpDict setObject:p forKey:@"kMDItemPath"]; + [tmpDict setObject:[p lastPathComponent] forKey:@"kMDItemFSName"]; + [tmpDict setObject:[p lastPathComponent] forKey:@"kMDItemDisplayName"]; + contentType = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[p pathExtension], kUTTypeContent) autorelease]; + } + else { + // Add the file name and display name.. use the actual file name + NSString *displayName = nil; + + displayName = [fm displayNameAtPath:p]; + + if ((displayName == nil)||([displayName isEqualToString:@""])) + displayName = [p lastPathComponent]; + + [tmpDict setObject:p forKey:@"kMDItemPath"]; + [tmpDict setObject:displayName forKey:@"kMDItemDisplayName"]; + [tmpDict setObject:displayName forKey:@"kMDItemFSName"]; + + contentType = [ws typeOfFile:p error:nil]; + + // If NSWorkspace fails, try using the UTI services directly + if (contentType == nil) { + if (isDirectory) { + contentType = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[p pathExtension], kUTTypeDirectory) autorelease]; + } + else { + contentType = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[p pathExtension], kUTTypeContent) autorelease]; + } + } + } + + // NSWorkspace / Launch servies gives me the most accurate UTI string + // However, it will not give me the whole UTI tree.. + if (contentType != nil) { + [tmpDict setObject:contentType forKey:@"kMDItemContentType"]; + //NSLog(@"\t\tUTI: %@ for extension: %@",contentType, [p pathExtension]); + + NSArray *contentKindTree = [_UTITable objectForKey:contentType]; + + if (contentKindTree==nil) { + //[self addTypeTreeForUIT:contentType]; + // If this is the main thread generate the + if ([NSThread isMainThread]) { + [self addTypeTreeForUTI:contentType]; + contentKindTree = [_UTITable objectForKey:contentType]; + } + else { + [self performSelectorOnMainThread:@selector(addTypeTreeForUTI:) withObject:contentType waitUntilDone:NO]; + contentKindTree = [_UTITable objectForKey:contentType]; + } + + } + if (contentKindTree != nil) { + //NSLog(@"\t\tcontentKindTree: %@",contentKindTree); + [tmpDict setObject:contentKindTree forKey:@"kMDItemContentTypeTree"]; + } + else { + [tmpDict setObject:[NSArray arrayWithObject:contentType] forKey:@"kMDItemContentTypeTree"]; + } + // If I successfully got a content type, use localizedDescriptionForType: to get the Kind + /* + NSString *contentKind = [ws localizedDescriptionForType:contentType]; + if (contentKind != nil) { + //NSLog(@"\t\tkind: %@",contentKind); + [tmpDict setObject:contentKind forKey:@"kMDItemKind"]; + } + */ + } + //NSLog(@"\t\t%@",tmpDict); + _attributes = [[NSDictionary dictionaryWithDictionary:tmpDict] retain]; + [fm release]; + + if (filePathURL!=NULL) { + CFRelease(filePathURL); + filePathURL = NULL; + } +} + +- (void) dealloc { + //NSLog(@"%s",__func__); + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + if (_item!=NULL) { + CFRelease(_item); + _item = NULL; + } + VVRELEASE(_attributes); + [super dealloc]; +} + +// required for using this with predicates +- (id) valueForKey:(NSString *)k { + return [self valueForAttribute:k]; +} + +// calls MDItemCopyAttribute + autorelease +- (id) valueForAttribute:(id)attribute { + if (attribute == nil) { + return nil; + } + id returnMe = nil; + + if (_item!=NULL) { + returnMe = [(id)MDItemCopyAttribute(_item, (CFStringRef)attribute) autorelease]; + } + // if the MDItem is NULL, use the fallback attributes / fsref + // use the fsref to get the item path & file system name - this technique auto-updates along with the changes + else { + /* + if ([attribute isEqualToString:@"kMDItemPath"]) { + CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault, &_fsRef); + if (url != NULL) { + returnMe = [(NSString*)CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle) autorelease]; + CFRelease(url); + } + } + else if ([attribute isEqualToString:@"kMDItemFSName"]) { + CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault, &_fsRef); + if (url != NULL) { + returnMe = [(NSString*)CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle) autorelease]; + returnMe = [returnMe lastPathComponent]; + CFRelease(url); + } + } + */ + } + + if ((returnMe == nil)&&(_attributes != nil)) { + //NSLog(@"\t\trequested %@",attribute); + returnMe = [_attributes objectForKey:attribute]; + } + + return returnMe; +} + +// calls MDItemCopyAttributes + autorelease +- (NSDictionary *) valuesForAttributes:(NSArray *)attributes { + if (attributes == nil) { + return nil; + } + NSDictionary *returnMe = nil; + + if (_item!=NULL) { + returnMe = (NSDictionary *)MDItemCopyAttributes(_item, (CFArrayRef)attributes); + if (returnMe) + [returnMe autorelease]; + } + else if (_attributes!=nil) { + NSArray *objs = [_attributes objectsForKeys:attributes notFoundMarker:[NSNull null]]; + if ([objs count] == [attributes count]) { + returnMe = [NSDictionary dictionaryWithObjects:objs forKeys:attributes]; + } + else { + returnMe = [NSDictionary dictionary]; + NSLog(@"err: VVMetadataItem: valuesForAttributes: %lu count did not match %@",(unsigned long)[objs count], attributes); + } + } + + return returnMe; +} + +// calls MDItemCopyAttributeNames +// note that this does not always return all the available attributes! eg. kMDItemPath, kMDItemFSName +- (NSArray *) attributes { + NSArray *returnMe = nil; + + if (_item!=NULL) + returnMe = [(NSArray *)MDItemCopyAttributeNames(_item) autorelease]; + else if (_attributes!=nil) + returnMe = [_attributes allKeys]; + + return returnMe; +} + +// A method for quickly getting the path (the most common file information) +- (NSString *) path { + return [self valueForAttribute:@"kMDItemPath"]; +} +// A method for getting the display name +- (NSString *) displayName { + return [self valueForAttribute:@"kMDItemDisplayName"]; +} + +- (void) addTypeTreeForUTI:(NSString *)p { + if (p == nil) { + return; + } + + NSMutableArray *returnMe = [NSMutableArray arrayWithCapacity:0]; + id type = nil; + NSString *lastType = nil; + + // Add the main type to the array + type = [[p copy] autorelease]; + [returnMe addObject: type]; + //[type release]; + + // Now walk up the tree + // If we hit public.executable or public.item or the type becomes nil we've reached the end + while ((type != nil)&&([type isEqualToString:@"public.executable"]==NO)&&([type isEqualToString:@"public.item"]==NO)) { + // Use UTTypeCopyDeclaration to get the next batch of UTI's in the tree + if ([type isKindOfClass:[NSString class]]==NO) { + NSLog(@"err: TYPE WAS NOT A STRING : %@", type); + } + + if (lastType==nil) { + + } + else if ([lastType isEqualToString:type]) { + NSLog(@"err: last type was the same - breaking"); + break; + } + else { + //NSLog(@"\t\t\tlast type was %@",lastType); + } + + VVRELEASE(lastType); + lastType = [type copy]; + + //NSLog(@"\t\tnow checking %@",type); + + NSDictionary *contentDeclaration = (NSDictionary *)UTTypeCopyDeclaration((CFStringRef) type); + + if (contentDeclaration) { + type = [(NSDictionary *)contentDeclaration objectForKey:@"UTTypeConformsTo"]; + + // The value returned for "UTTypeConformsTo" can be a string or an array + // If it is an array, copy all of the values in the array + // If it is a string, just copy the string + if (type != nil) { + //NSLog(@"\t\tfound UTIs: %@",type); + if ([type isKindOfClass:[NSArray class]]) { + for (NSString *typeString in (NSArray *)type) { + NSString *tmpString = [typeString copy]; + [returnMe addObject:tmpString]; + [tmpString release]; + } + type = [returnMe lastObject]; + } + else if ([type isKindOfClass:[NSString class]]) { + //NSLog(@"\t\tfound UTI: %@",type); + NSString *tmpString = [type copy]; + [returnMe addObject:tmpString]; + [tmpString release]; + type = tmpString; + } + else { + type = nil; + } + } + CFRelease(contentDeclaration); + //[(NSDictionary *)contentDeclaration autorelease]; + } + else { + //NSLog(@"\t\tcontentDeclaration was nil"); + type = nil; + } + } + //NSLog(@"\t\t%@",returnMe); + [_UTITable setObject:returnMe forKey:p]; + VVRELEASE(lastType); + //return returnMe; +} +@end diff --git a/ISF Editor/VideoSource.h b/ISF Editor/VideoSource.h new file mode 100644 index 00000000..212d71f9 --- /dev/null +++ b/ISF Editor/VideoSource.h @@ -0,0 +1,41 @@ +#import +#import +#import + + + + +@protocol VideoSourceDelegate +- (void) listOfStaticSourcesUpdated:(id)ds; +@end + + + + +@interface VideoSource : NSObject { + BOOL deleted; + + //OSSpinLock lastBufferLock; + //VVBuffer *lastBuffer; + + OSSpinLock propLock; + BOOL propRunning; + id propDelegate; +} + +- (void) prepareToBeDeleted; +- (VVBuffer *) allocBuffer; +- (NSArray *) arrayOfSourceMenuItems; + +- (void) start; +- (void) _start; +- (void) stop; +- (void) _stop; + +//- (void) render; +//- (void) _render; + +- (BOOL) propRunning; +- (void) setPropDelegate:(id)n; + +@end diff --git a/ISF Editor/VideoSource.m b/ISF Editor/VideoSource.m new file mode 100644 index 00000000..4568562f --- /dev/null +++ b/ISF Editor/VideoSource.m @@ -0,0 +1,90 @@ +#import "VideoSource.h" + + + + +@implementation VideoSource + + +- (id) init { + if (self = [super init]) { + deleted = NO; + /* + lastBufferLock = OS_SPINLOCK_INIT; + lastBuffer = nil; + */ + propLock = OS_SPINLOCK_INIT; + propRunning = NO; + propDelegate = nil; + return self; + } + [self release]; + return nil; +} +- (void) prepareToBeDeleted { + [self stop]; + deleted = YES; +} +- (void) dealloc { + if (!deleted) + [self prepareToBeDeleted]; + /* + OSSpinLockLock(&lastBufferLock); + VVRELEASE(lastBuffer); + OSSpinLockUnlock(&lastBufferLock); + */ + [super dealloc]; +} +- (VVBuffer *) allocBuffer { + return nil; +} +- (NSArray *) arrayOfSourceMenuItems { + return nil; +} + + +- (void) start { + //NSLog(@"%s ... %@",__func__,self); + OSSpinLockLock(&propLock); + if (!propRunning) { + [self _start]; + propRunning = YES; + } + else + NSLog(@"\t\tERR: starting something that wasn't stopped, %s",__func__); + OSSpinLockUnlock(&propLock); +} +- (void) _start { + //NSLog(@"%s ... %@",__func__,self); +} +- (void) stop { + //NSLog(@"%s ... %@",__func__,self); + OSSpinLockLock(&propLock); + if (propRunning) { + [self _stop]; + propRunning = NO; + } + else + NSLog(@"\t\tERR: stopping something that wasn't running, %s",__func__); + OSSpinLockUnlock(&propLock); +} +- (void) _stop { + //NSLog(@"%s ... %@",__func__,self); +} + + +- (BOOL) propRunning { + BOOL returnMe; + OSSpinLockLock(&propLock); + returnMe = propRunning; + OSSpinLockUnlock(&propLock); + return returnMe; +} +- (void) setPropDelegate:(id)n { + OSSpinLockLock(&propLock); + propDelegate = n; + OSSpinLockUnlock(&propLock); +} + + +@end diff --git a/ISF Editor/Vidvox ISF resources.pkg b/ISF Editor/Vidvox ISF resources.pkg new file mode 100644 index 00000000..00d46eb5 Binary files /dev/null and b/ISF Editor/Vidvox ISF resources.pkg differ diff --git a/ISF Editor/main.m b/ISF Editor/main.m new file mode 100644 index 00000000..6e55315c --- /dev/null +++ b/ISF Editor/main.m @@ -0,0 +1,13 @@ +// +// main.m +// ISF Editor +// +// Created by testAdmin on 8/18/16. +// +// + +#import + +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/ISF Editor/shadertoy_images/cube00_0.jpg b/ISF Editor/shadertoy_images/cube00_0.jpg new file mode 100644 index 00000000..9df25dca Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_0.jpg differ diff --git a/ISF Editor/shadertoy_images/cube00_1.jpg b/ISF Editor/shadertoy_images/cube00_1.jpg new file mode 100644 index 00000000..ae59dc10 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_1.jpg differ diff --git a/ISF Editor/shadertoy_images/cube00_2.jpg b/ISF Editor/shadertoy_images/cube00_2.jpg new file mode 100644 index 00000000..98d66512 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_2.jpg differ diff --git a/ISF Editor/shadertoy_images/cube00_3.jpg b/ISF Editor/shadertoy_images/cube00_3.jpg new file mode 100644 index 00000000..f93e4d4c Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_3.jpg differ diff --git a/ISF Editor/shadertoy_images/cube00_4.jpg b/ISF Editor/shadertoy_images/cube00_4.jpg new file mode 100644 index 00000000..cc17b6c2 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_4.jpg differ diff --git a/ISF Editor/shadertoy_images/cube00_5.jpg b/ISF Editor/shadertoy_images/cube00_5.jpg new file mode 100644 index 00000000..9ee868c5 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube00_5.jpg differ diff --git a/ISF Editor/shadertoy_images/cube01_0.png b/ISF Editor/shadertoy_images/cube01_0.png new file mode 100644 index 00000000..dabb6505 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_0.png differ diff --git a/ISF Editor/shadertoy_images/cube01_1.png b/ISF Editor/shadertoy_images/cube01_1.png new file mode 100644 index 00000000..687799f1 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_1.png differ diff --git a/ISF Editor/shadertoy_images/cube01_2.png b/ISF Editor/shadertoy_images/cube01_2.png new file mode 100644 index 00000000..ca2eb3f8 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_2.png differ diff --git a/ISF Editor/shadertoy_images/cube01_3.png b/ISF Editor/shadertoy_images/cube01_3.png new file mode 100644 index 00000000..471b75eb Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_3.png differ diff --git a/ISF Editor/shadertoy_images/cube01_4.png b/ISF Editor/shadertoy_images/cube01_4.png new file mode 100644 index 00000000..00679149 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_4.png differ diff --git a/ISF Editor/shadertoy_images/cube01_5.png b/ISF Editor/shadertoy_images/cube01_5.png new file mode 100644 index 00000000..2571fe50 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube01_5.png differ diff --git a/ISF Editor/shadertoy_images/cube02_0.jpg b/ISF Editor/shadertoy_images/cube02_0.jpg new file mode 100644 index 00000000..92e30c77 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_0.jpg differ diff --git a/ISF Editor/shadertoy_images/cube02_1.jpg b/ISF Editor/shadertoy_images/cube02_1.jpg new file mode 100644 index 00000000..4cc31aad Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_1.jpg differ diff --git a/ISF Editor/shadertoy_images/cube02_2.jpg b/ISF Editor/shadertoy_images/cube02_2.jpg new file mode 100644 index 00000000..3af34f2f Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_2.jpg differ diff --git a/ISF Editor/shadertoy_images/cube02_3.jpg b/ISF Editor/shadertoy_images/cube02_3.jpg new file mode 100644 index 00000000..45bd54cf Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_3.jpg differ diff --git a/ISF Editor/shadertoy_images/cube02_4.jpg b/ISF Editor/shadertoy_images/cube02_4.jpg new file mode 100644 index 00000000..3c52ebf3 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_4.jpg differ diff --git a/ISF Editor/shadertoy_images/cube02_5.jpg b/ISF Editor/shadertoy_images/cube02_5.jpg new file mode 100644 index 00000000..7d95e256 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube02_5.jpg differ diff --git a/ISF Editor/shadertoy_images/cube03_0.png b/ISF Editor/shadertoy_images/cube03_0.png new file mode 100644 index 00000000..74047fab Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_0.png differ diff --git a/ISF Editor/shadertoy_images/cube03_1.png b/ISF Editor/shadertoy_images/cube03_1.png new file mode 100644 index 00000000..a803a385 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_1.png differ diff --git a/ISF Editor/shadertoy_images/cube03_2.png b/ISF Editor/shadertoy_images/cube03_2.png new file mode 100644 index 00000000..be3992ef Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_2.png differ diff --git a/ISF Editor/shadertoy_images/cube03_3.png b/ISF Editor/shadertoy_images/cube03_3.png new file mode 100644 index 00000000..543bc913 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_3.png differ diff --git a/ISF Editor/shadertoy_images/cube03_4.png b/ISF Editor/shadertoy_images/cube03_4.png new file mode 100644 index 00000000..9664d6eb Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_4.png differ diff --git a/ISF Editor/shadertoy_images/cube03_5.png b/ISF Editor/shadertoy_images/cube03_5.png new file mode 100644 index 00000000..4235459b Binary files /dev/null and b/ISF Editor/shadertoy_images/cube03_5.png differ diff --git a/ISF Editor/shadertoy_images/cube04_0.png b/ISF Editor/shadertoy_images/cube04_0.png new file mode 100644 index 00000000..d1ce0fb8 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_0.png differ diff --git a/ISF Editor/shadertoy_images/cube04_1.png b/ISF Editor/shadertoy_images/cube04_1.png new file mode 100644 index 00000000..ca98c66a Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_1.png differ diff --git a/ISF Editor/shadertoy_images/cube04_2.png b/ISF Editor/shadertoy_images/cube04_2.png new file mode 100644 index 00000000..f4ee00b4 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_2.png differ diff --git a/ISF Editor/shadertoy_images/cube04_3.png b/ISF Editor/shadertoy_images/cube04_3.png new file mode 100644 index 00000000..edaa1606 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_3.png differ diff --git a/ISF Editor/shadertoy_images/cube04_4.png b/ISF Editor/shadertoy_images/cube04_4.png new file mode 100644 index 00000000..fc312d2e Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_4.png differ diff --git a/ISF Editor/shadertoy_images/cube04_5.png b/ISF Editor/shadertoy_images/cube04_5.png new file mode 100644 index 00000000..e25dd6bc Binary files /dev/null and b/ISF Editor/shadertoy_images/cube04_5.png differ diff --git a/ISF Editor/shadertoy_images/cube05_0.png b/ISF Editor/shadertoy_images/cube05_0.png new file mode 100644 index 00000000..74d006e7 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_0.png differ diff --git a/ISF Editor/shadertoy_images/cube05_1.png b/ISF Editor/shadertoy_images/cube05_1.png new file mode 100644 index 00000000..247295d5 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_1.png differ diff --git a/ISF Editor/shadertoy_images/cube05_2.png b/ISF Editor/shadertoy_images/cube05_2.png new file mode 100644 index 00000000..c39b10d7 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_2.png differ diff --git a/ISF Editor/shadertoy_images/cube05_3.png b/ISF Editor/shadertoy_images/cube05_3.png new file mode 100644 index 00000000..5c57b35c Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_3.png differ diff --git a/ISF Editor/shadertoy_images/cube05_4.png b/ISF Editor/shadertoy_images/cube05_4.png new file mode 100644 index 00000000..61341126 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_4.png differ diff --git a/ISF Editor/shadertoy_images/cube05_5.png b/ISF Editor/shadertoy_images/cube05_5.png new file mode 100644 index 00000000..a481a1d2 Binary files /dev/null and b/ISF Editor/shadertoy_images/cube05_5.png differ diff --git a/ISF Editor/shadertoy_images/tex00.jpg b/ISF Editor/shadertoy_images/tex00.jpg new file mode 100644 index 00000000..a27ca5c7 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex00.jpg differ diff --git a/ISF Editor/shadertoy_images/tex01.jpg b/ISF Editor/shadertoy_images/tex01.jpg new file mode 100644 index 00000000..482f41b3 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex01.jpg differ diff --git a/ISF Editor/shadertoy_images/tex02.jpg b/ISF Editor/shadertoy_images/tex02.jpg new file mode 100644 index 00000000..74862527 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex02.jpg differ diff --git a/ISF Editor/shadertoy_images/tex03.jpg b/ISF Editor/shadertoy_images/tex03.jpg new file mode 100644 index 00000000..fe64a0f0 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex03.jpg differ diff --git a/ISF Editor/shadertoy_images/tex04.jpg b/ISF Editor/shadertoy_images/tex04.jpg new file mode 100644 index 00000000..af866a0f Binary files /dev/null and b/ISF Editor/shadertoy_images/tex04.jpg differ diff --git a/ISF Editor/shadertoy_images/tex05.jpg b/ISF Editor/shadertoy_images/tex05.jpg new file mode 100644 index 00000000..5bf0e356 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex05.jpg differ diff --git a/ISF Editor/shadertoy_images/tex06.jpg b/ISF Editor/shadertoy_images/tex06.jpg new file mode 100644 index 00000000..47f05af0 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex06.jpg differ diff --git a/ISF Editor/shadertoy_images/tex07.jpg b/ISF Editor/shadertoy_images/tex07.jpg new file mode 100644 index 00000000..3c803d2f Binary files /dev/null and b/ISF Editor/shadertoy_images/tex07.jpg differ diff --git a/ISF Editor/shadertoy_images/tex08.jpg b/ISF Editor/shadertoy_images/tex08.jpg new file mode 100644 index 00000000..1c8fa6d0 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex08.jpg differ diff --git a/ISF Editor/shadertoy_images/tex09.jpg b/ISF Editor/shadertoy_images/tex09.jpg new file mode 100644 index 00000000..ea111ea3 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex09.jpg differ diff --git a/ISF Editor/shadertoy_images/tex10.png b/ISF Editor/shadertoy_images/tex10.png new file mode 100644 index 00000000..60738833 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex10.png differ diff --git a/ISF Editor/shadertoy_images/tex11.png b/ISF Editor/shadertoy_images/tex11.png new file mode 100644 index 00000000..a02f0a06 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex11.png differ diff --git a/ISF Editor/shadertoy_images/tex12.png b/ISF Editor/shadertoy_images/tex12.png new file mode 100644 index 00000000..93567a83 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex12.png differ diff --git a/ISF Editor/shadertoy_images/tex14.png b/ISF Editor/shadertoy_images/tex14.png new file mode 100644 index 00000000..f6938f4e Binary files /dev/null and b/ISF Editor/shadertoy_images/tex14.png differ diff --git a/ISF Editor/shadertoy_images/tex15.png b/ISF Editor/shadertoy_images/tex15.png new file mode 100644 index 00000000..bcc1ef08 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex15.png differ diff --git a/ISF Editor/shadertoy_images/tex16.png b/ISF Editor/shadertoy_images/tex16.png new file mode 100644 index 00000000..32a561c7 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex16.png differ diff --git a/ISF Editor/shadertoy_images/tex17.jpg b/ISF Editor/shadertoy_images/tex17.jpg new file mode 100644 index 00000000..cc0bfa71 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex17.jpg differ diff --git a/ISF Editor/shadertoy_images/tex18.jpg b/ISF Editor/shadertoy_images/tex18.jpg new file mode 100644 index 00000000..d9ee61d1 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex18.jpg differ diff --git a/ISF Editor/shadertoy_images/tex19.png b/ISF Editor/shadertoy_images/tex19.png new file mode 100644 index 00000000..5f054012 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex19.png differ diff --git a/ISF Editor/shadertoy_images/tex20.jpg b/ISF Editor/shadertoy_images/tex20.jpg new file mode 100644 index 00000000..8da68c57 Binary files /dev/null and b/ISF Editor/shadertoy_images/tex20.jpg differ diff --git a/ISFGLScene Test App/ISFGLScene Test App-Info.plist b/ISFGLScene Test App/ISFGLScene Test App-Info.plist index e12f7057..ba0e84af 100644 --- a/ISFGLScene Test App/ISFGLScene Test App-Info.plist +++ b/ISFGLScene Test App/ISFGLScene Test App-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/MIDIviaOSC/MIDIviaOSC-Info.plist b/MIDIviaOSC/MIDIviaOSC-Info.plist index c07d8423..86bba460 100644 --- a/MIDIviaOSC/MIDIviaOSC-Info.plist +++ b/MIDIviaOSC/MIDIviaOSC-Info.plist @@ -6,8 +6,10 @@ English CFBundleExecutable ${EXECUTABLE_NAME} + CFBundleGetInfoString + 0.1.5 CFBundleIdentifier - com.vvopensource.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -16,8 +18,6 @@ ???? CFBundleVersion 0.1.5 - CFBundleGetInfoString - 0.1.5 NSMainNibFile MainMenu NSPrincipalClass diff --git a/MultiClassXPCTestApp/Info.plist b/MultiClassXPCTestApp/Info.plist index 297891d7..d872f1eb 100644 --- a/MultiClassXPCTestApp/Info.plist +++ b/MultiClassXPCTestApp/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/MultiClassXPCTestService/Info.plist b/MultiClassXPCTestService/Info.plist index 13e4de4f..97714c94 100644 --- a/MultiClassXPCTestService/Info.plist +++ b/MultiClassXPCTestService/Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.Vidvox.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/OSCPingTester/OSCPingTester-Info.plist b/OSCPingTester/OSCPingTester-Info.plist index 4540554d..ba0e84af 100644 --- a/OSCPingTester/OSCPingTester-Info.plist +++ b/OSCPingTester/OSCPingTester-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/OSCQueryTest/OSCQueryTest-Info.plist b/OSCQueryTest/OSCQueryTest-Info.plist index 3ba93b5f..3a92b175 100644 --- a/OSCQueryTest/OSCQueryTest-Info.plist +++ b/OSCQueryTest/OSCQueryTest-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/QCGLScene Test App/QCGLScene Test App-Info.plist b/QCGLScene Test App/QCGLScene Test App-Info.plist index e12f7057..ba0e84af 100644 --- a/QCGLScene Test App/QCGLScene Test App-Info.plist +++ b/QCGLScene Test App/QCGLScene Test App-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/QT and Hap Test App/QT and Hap Test App-Info.plist b/QT and Hap Test App/QT and Hap Test App-Info.plist index e12f7057..ba0e84af 100644 --- a/QT and Hap Test App/QT and Hap Test App-Info.plist +++ b/QT and Hap Test App/QT and Hap Test App-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.Vidvox.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/README.md b/README.md index 60e24bdf..bfa2daed 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,12 @@ How to get help Please open an "issue". If i'm really busy (a frequent occurrence) it may take a while for me to get back to you- sorry in advance! Documentation is generated with 'Doxygen', and can be found here: [http://www.vidvox.net/rays_oddsnends/vvopensource_doc/index.html](http://www.vidvox.net/rays_oddsnends/vvopensource_doc/index.html) -I'm not a programmer, I just want to download a MIDI/OSC test application! +I'm not a programmer, I just want to download a MIDI/OSC/ISF test application! -------------------------------------------------------------------------- +Here's the ISF Editor: +http://www.vidvox.net/rays_oddsnends/vvopensource_downloads/ISF_Editor_2.8.zip + Here's an OSC test application: http://www.vidvox.net/rays_oddsnends/vvopensource_downloads/OSCTestApp_0.2.7.zip @@ -39,13 +42,14 @@ What does this project include/do/make? * VVMIDI is an Objective-C framework for quickly and easily working with MIDI data. * VVUIToolbox is an objective-c framework that I use extensively to ease the process of creating UI items. It contains a number of objects that standardize the act of creating, drawing, and interacting with sprites that work transparently with both NS and GL views. * VVBufferPool is an objective-c framework for creating and managing GL-backed resources. This framework is used as the basis for the rendering engines I build for various proejcts, and is focused on the general goal of simplifying the task of "rendering to a texture" in an extensible manner to better work with a variety of APIs and formats. - * VVISFKit is an objective-c framework that opens and renders ISF files. ISF is a simple/minimal image filter format based on GLSL- more about ISF files can be found [here](http://vidvox.net/rays_oddsnends/ISF.html). + * VVISFKit is an objective-c framework that opens and renders ISF files. ISF is a simple/minimal image filter format based on GLSL- more about ISF files can be found [here](http://www.vidvox.net/rays_oddsnends/ISF.html). * MultiClassXPC is an objective-c framework that simplifies the process of quickly setting upa number of different classes to work in an XPC service. - Potentially useful apps * OSCTestApp is a Cocoa application used for testing and debugging OSC Applications (created entirely with VVOSC). Capable of both sending and receiving a number of OSC data types, it also demonstrates the use of bonjour/zero-configuration networking to automatically auto-locate and set up OSC Input Ports for OSC destinations found on the local network. In other words, two copies of OSCTestApp on different machines on the same local network will "see" each other, and automatically do the backend work necessary to send data to one another. * MIDITestApp is a Cocoa application (created using VVMIDI) used to demonstrate the sending and receiving of MIDI data. * MIDIviaOSC is a Cocoa application (created using VVMIDI and VVOSC) that lets you send MIDI data to another computer on the internet via OSC * QCQL and ISFQL are QuickLook plugins that render thumbnails for, respectively, Quartz Composer and ISF content. + * MTCSender is a simple Cocoa app that sends MTC data to a given MIDI destination on the same machine. * ISF Editor is a browser and editor for ISF files- it's packed with enough features that listing them here would be very awkward. - Test/example apps- the majority of the apps here are test apps or example apps demonstrating how to use many of the classes and frameworks in this repository. Examples include rendering GL contexts to textures, rendering Quartz Composer and CoreImage content to textures, rendering ISF files as generative sources and fx, working with textures from Syphon, working with QuickTime and the Hap video codec, accelerated GL texture download and upload, etc. - External code (stuff other people wrote hosted here to avoid dependency/submodule issues) @@ -78,21 +82,6 @@ If you're writing a plugin, you need to weak-link against these frameworks. If 2. Double-click your plugin/target in the left-hand list of your project window (or select it and get its info). Click on the "Build" tab, locate the "Other Linker Flags" setting, and add the following flags: "-weak_framework VVBasics", "-weak_framework VVOSC", "-weak_framework VVMIDI". -How to use VVOSC in your iPhone application -------------------------------------------- - -In addition to frameworks for development of mac apps, this project can produce static libraries for use with iOS app creation. Here's how to use the static libs in your project: - 1. In XCode, close the VVOpenSource project (if it is open), and then open your project. - 2. In the Finder, drag "VVOpenSource.xcodeproj" into your project's workspace - 3. Switch back to XCode, and locate the "Build Phases" settings for your project's target. - 4. Add a target dependency for "Build iOS static libs (VVOpenSource)". - 5. Add "libVVBasics.a" and "libVVOSC.a" to the "Link Binary with Libraries" section. - 6. In XCode, switch to the "Build Settings" for your application, and under the "Other Linker Flags" setting add the flag "-ObjC". - 7. That's it- you're done now. You can import/include objects from the VVOSC framework in your source code as you normally would (#import \). - -Here's a quick video demonstrating the above steps:[http://vidvox.net/rays_oddsnends/addingVVOSC.mov]. - - Using VVBasics/VVOSC/etc. in closed-source iOS applications ----------------------------------------------------------- diff --git a/VVMIDI/AppSrc/MIDITestApp-Info.plist b/VVMIDI/AppSrc/MIDITestApp-Info.plist index 29652279..4db2f9c6 100644 --- a/VVMIDI/AppSrc/MIDITestApp-Info.plist +++ b/VVMIDI/AppSrc/MIDITestApp-Info.plist @@ -6,8 +6,10 @@ English CFBundleExecutable ${EXECUTABLE_NAME} + CFBundleGetInfoString + 1.0.6 CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -20,7 +22,5 @@ MainMenu NSPrincipalClass NSApplication - CFBundleGetInfoString - 1.0.6 diff --git a/VVOSC/AppSrc/OSCTestApp-Info.plist b/VVOSC/AppSrc/OSCTestApp-Info.plist index d493b62e..ea0d6936 100644 --- a/VVOSC/AppSrc/OSCTestApp-Info.plist +++ b/VVOSC/AppSrc/OSCTestApp-Info.plist @@ -6,8 +6,10 @@ English CFBundleExecutable ${EXECUTABLE_NAME} + CFBundleGetInfoString + 0.2.7 CFBundleIdentifier - com.vidvox.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -16,8 +18,6 @@ ???? CFBundleVersion 0.2.7 - CFBundleGetInfoString - 0.2.7 NSMainNibFile MainMenu NSPrincipalClass diff --git a/VVOpenSource.xcodeproj/project.pbxproj b/VVOpenSource.xcodeproj/project.pbxproj index e4e0113a..6b26b59f 100644 --- a/VVOpenSource.xcodeproj/project.pbxproj +++ b/VVOpenSource.xcodeproj/project.pbxproj @@ -75,6 +75,7 @@ 1AE1A8021CDA685B005F924D /* PBXTargetDependency */, 1AE1A8041CDA685E005F924D /* PBXTargetDependency */, 1AC5A4DE1CEE4146004DF358 /* PBXTargetDependency */, + 1A39E62D1D65B67A0065F271 /* PBXTargetDependency */, ); name = "Build Mac Fmwks & Apps"; productName = Untitled; @@ -282,6 +283,131 @@ 1A33E1611BED434800E82A6F /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB90C1BED311A00B2B129 /* AppKit.framework */; }; 1A33E1641BED443100E82A6F /* Bad TV.fs in Resources */ = {isa = PBXBuildFile; fileRef = 1A33E1621BED443100E82A6F /* Bad TV.fs */; }; 1A33E1651BED443100E82A6F /* CMYK Halftone-Lookaround.fs in Resources */ = {isa = PBXBuildFile; fileRef = 1A33E1631BED443100E82A6F /* CMYK Halftone-Lookaround.fs */; }; + 1A39E5631D65B1D60065F271 /* AlphaOverCheckerboard.fs in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E4F31D65B1D60065F271 /* AlphaOverCheckerboard.fs */; }; + 1A39E5641D65B1D60065F271 /* AudioController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4F51D65B1D60065F271 /* AudioController.m */; }; + 1A39E5651D65B1D60065F271 /* AVCaptureVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4F71D65B1D60065F271 /* AVCaptureVideoSource.m */; }; + 1A39E5661D65B1D60065F271 /* DocController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4F91D65B1D60065F271 /* DocController.m */; }; + 1A39E5671D65B1D60065F271 /* DynamicVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4FB1D65B1D60065F271 /* DynamicVideoSource.m */; }; + 1A39E5681D65B1D60065F271 /* IMGVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4FD1D65B1D60065F271 /* IMGVideoSource.m */; }; + 1A39E5691D65B1D60065F271 /* ISFAudioBufferList.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E4FF1D65B1D60065F271 /* ISFAudioBufferList.m */; }; + 1A39E56A1D65B1D60065F271 /* ISFAudioFFT.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5011D65B1D60065F271 /* ISFAudioFFT.m */; }; + 1A39E56B1D65B1D60065F271 /* ISFAudioFFTResults.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5031D65B1D60065F271 /* ISFAudioFFTResults.m */; }; + 1A39E56C1D65B1D60065F271 /* ISFAVFAudioSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5051D65B1D60065F271 /* ISFAVFAudioSource.m */; }; + 1A39E56D1D65B1D60065F271 /* ISFController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5071D65B1D60065F271 /* ISFController.m */; }; + 1A39E56E1D65B1D60065F271 /* ISFConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5091D65B1D60065F271 /* ISFConverter.m */; }; + 1A39E56F1D65B1D60065F271 /* ISFEditorAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E50B1D65B1D60065F271 /* ISFEditorAppDelegate.m */; }; + 1A39E5701D65B1D60065F271 /* ISFPDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E50D1D65B1D60065F271 /* ISFPDownload.m */; }; + 1A39E5711D65B1D60065F271 /* ISFPDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E50F1D65B1D60065F271 /* ISFPDownloader.m */; }; + 1A39E5721D65B1D60065F271 /* ISFPDownloadTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5111D65B1D60065F271 /* ISFPDownloadTableCellView.m */; }; + 1A39E5731D65B1D60065F271 /* ISFPropAudioFFTTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5131D65B1D60065F271 /* ISFPropAudioFFTTableCellView.m */; }; + 1A39E5741D65B1D60065F271 /* ISFPropAudioTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5151D65B1D60065F271 /* ISFPropAudioTableCellView.m */; }; + 1A39E5751D65B1D60065F271 /* ISFPropBoolTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5171D65B1D60065F271 /* ISFPropBoolTableCellView.m */; }; + 1A39E5761D65B1D60065F271 /* ISFPropColorTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5191D65B1D60065F271 /* ISFPropColorTableCellView.m */; }; + 1A39E5771D65B1D60065F271 /* ISFPropErrTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E51B1D65B1D60065F271 /* ISFPropErrTableCellView.m */; }; + 1A39E5781D65B1D60065F271 /* ISFPropEventTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E51D1D65B1D60065F271 /* ISFPropEventTableCellView.m */; }; + 1A39E5791D65B1D60065F271 /* ISFPropFloatTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E51F1D65B1D60065F271 /* ISFPropFloatTableCellView.m */; }; + 1A39E57A1D65B1D60065F271 /* ISFPropGroupTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5211D65B1D60065F271 /* ISFPropGroupTableCellView.m */; }; + 1A39E57B1D65B1D60065F271 /* ISFPropImageTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5231D65B1D60065F271 /* ISFPropImageTableCellView.m */; }; + 1A39E57C1D65B1D60065F271 /* ISFPropInputTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5251D65B1D60065F271 /* ISFPropInputTableCellView.m */; }; + 1A39E57D1D65B1D60065F271 /* ISFPropLongTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5271D65B1D60065F271 /* ISFPropLongTableCellView.m */; }; + 1A39E57E1D65B1D60065F271 /* ISFPropPassTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5291D65B1D60065F271 /* ISFPropPassTableCellView.m */; }; + 1A39E57F1D65B1D60065F271 /* ISFPropPoint2DTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E52B1D65B1D60065F271 /* ISFPropPoint2DTableCellView.m */; }; + 1A39E5801D65B1D60065F271 /* ISFPropTopTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E52D1D65B1D60065F271 /* ISFPropTopTableCellView.m */; }; + 1A39E5811D65B1D60065F271 /* ISFUIItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E52F1D65B1D60065F271 /* ISFUIItem.m */; }; + 1A39E5821D65B1D60065F271 /* ISFVVBufferGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5311D65B1D60065F271 /* ISFVVBufferGLView.m */; }; + 1A39E5831D65B1D60065F271 /* JSONGUIArrayGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5331D65B1D60065F271 /* JSONGUIArrayGroup.m */; }; + 1A39E5841D65B1D60065F271 /* JSONGUIController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5351D65B1D60065F271 /* JSONGUIController.m */; }; + 1A39E5851D65B1D60065F271 /* JSONGUIDictGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5371D65B1D60065F271 /* JSONGUIDictGroup.m */; }; + 1A39E5861D65B1D60065F271 /* JSONGUIDragBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5391D65B1D60065F271 /* JSONGUIDragBarView.m */; }; + 1A39E5871D65B1D60065F271 /* JSONGUIInput.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E53B1D65B1D60065F271 /* JSONGUIInput.m */; }; + 1A39E5881D65B1D60065F271 /* JSONGUIPass.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E53D1D65B1D60065F271 /* JSONGUIPass.m */; }; + 1A39E5891D65B1D60065F271 /* JSONGUIPersistentBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E53F1D65B1D60065F271 /* JSONGUIPersistentBuffer.m */; }; + 1A39E58A1D65B1D60065F271 /* JSONGUITop.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5411D65B1D60065F271 /* JSONGUITop.m */; }; + 1A39E58B1D65B1D60065F271 /* MouseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5431D65B1D60065F271 /* MouseView.m */; }; + 1A39E58C1D65B1D60065F271 /* MovieFileVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5451D65B1D60065F271 /* MovieFileVideoSource.m */; }; + 1A39E58D1D65B1D60065F271 /* NewFileTemplate.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5461D65B1D60065F271 /* NewFileTemplate.txt */; }; + 1A39E58E1D65B1D60065F271 /* NSColorAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5481D65B1D60065F271 /* NSColorAdditions.m */; }; + 1A39E58F1D65B1D60065F271 /* NSColorWellNonContinuous.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E54A1D65B1D60065F271 /* NSColorWellNonContinuous.m */; }; + 1A39E5901D65B1D60065F271 /* NSPopUpButtonAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E54C1D65B1D60065F271 /* NSPopUpButtonAdditions.m */; }; + 1A39E5911D65B1D60065F271 /* NSProgressIndicatorAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E54E1D65B1D60065F271 /* NSProgressIndicatorAdditions.m */; }; + 1A39E5921D65B1D60065F271 /* NSValueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5501D65B1D60065F271 /* NSValueAdditions.m */; }; + 1A39E5931D65B1D60065F271 /* QCVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5521D65B1D60065F271 /* QCVideoSource.m */; }; + 1A39E5941D65B1D60065F271 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5541D65B1D60065F271 /* RegexKitLite.m */; }; + 1A39E5951D65B1D60065F271 /* SyphonVideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5561D65B1D60065F271 /* SyphonVideoSource.m */; }; + 1A39E5961D65B1D60065F271 /* SyphonVVBufferPoolAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5581D65B1D60065F271 /* SyphonVVBufferPoolAdditions.m */; }; + 1A39E5971D65B1D60065F271 /* UnselectableTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E55A1D65B1D60065F271 /* UnselectableTableView.m */; }; + 1A39E5981D65B1D60065F271 /* VideoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E55C1D65B1D60065F271 /* VideoSource.m */; }; + 1A39E5991D65B1D60065F271 /* VVBufferSpriteGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E55E1D65B1D60065F271 /* VVBufferSpriteGLView.m */; }; + 1A39E59A1D65B1D60065F271 /* VVKQueueCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5601D65B1D60065F271 /* VVKQueueCenter.m */; }; + 1A39E59B1D65B1D60065F271 /* VVMetadataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5621D65B1D60065F271 /* VVMetadataItem.m */; }; + 1A39E5A01D65B21F0065F271 /* Cube Array.qtz in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E59F1D65B21F0065F271 /* Cube Array.qtz */; }; + 1A39E5AB1D65B4410065F271 /* MGSFragaria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A39E5AA1D65B4410065F271 /* MGSFragaria.framework */; }; + 1A39E5AC1D65B45D0065F271 /* MGSFragaria.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1A39E5AA1D65B4410065F271 /* MGSFragaria.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1A39E5B31D65B4880065F271 /* DBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5AE1D65B4880065F271 /* DBPrefsWindowController.m */; }; + 1A39E5B41D65B4880065F271 /* General.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5AF1D65B4880065F271 /* General.png */; }; + 1A39E5B51D65B4880065F271 /* MGSPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A39E5B11D65B4880065F271 /* MGSPreferencesController.m */; }; + 1A39E5B61D65B4880065F271 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5B21D65B4880065F271 /* Preferences.xib */; }; + 1A39E5F11D65B4F90065F271 /* cube00_0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5B91D65B4F90065F271 /* cube00_0.jpg */; }; + 1A39E5F21D65B4F90065F271 /* cube00_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BA1D65B4F90065F271 /* cube00_1.jpg */; }; + 1A39E5F31D65B4F90065F271 /* cube00_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BB1D65B4F90065F271 /* cube00_2.jpg */; }; + 1A39E5F41D65B4F90065F271 /* cube00_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BC1D65B4F90065F271 /* cube00_3.jpg */; }; + 1A39E5F51D65B4F90065F271 /* cube00_4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BD1D65B4F90065F271 /* cube00_4.jpg */; }; + 1A39E5F61D65B4F90065F271 /* cube00_5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BE1D65B4F90065F271 /* cube00_5.jpg */; }; + 1A39E5F71D65B4F90065F271 /* cube01_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5BF1D65B4F90065F271 /* cube01_0.png */; }; + 1A39E5F81D65B4F90065F271 /* cube01_1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C01D65B4F90065F271 /* cube01_1.png */; }; + 1A39E5F91D65B4F90065F271 /* cube01_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C11D65B4F90065F271 /* cube01_2.png */; }; + 1A39E5FA1D65B4F90065F271 /* cube01_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C21D65B4F90065F271 /* cube01_3.png */; }; + 1A39E5FB1D65B4F90065F271 /* cube01_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C31D65B4F90065F271 /* cube01_4.png */; }; + 1A39E5FC1D65B4F90065F271 /* cube01_5.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C41D65B4F90065F271 /* cube01_5.png */; }; + 1A39E5FD1D65B4F90065F271 /* cube02_0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C51D65B4F90065F271 /* cube02_0.jpg */; }; + 1A39E5FE1D65B4F90065F271 /* cube02_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C61D65B4F90065F271 /* cube02_1.jpg */; }; + 1A39E5FF1D65B4F90065F271 /* cube02_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C71D65B4F90065F271 /* cube02_2.jpg */; }; + 1A39E6001D65B4F90065F271 /* cube02_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C81D65B4F90065F271 /* cube02_3.jpg */; }; + 1A39E6011D65B4F90065F271 /* cube02_4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5C91D65B4F90065F271 /* cube02_4.jpg */; }; + 1A39E6021D65B4F90065F271 /* cube02_5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CA1D65B4F90065F271 /* cube02_5.jpg */; }; + 1A39E6031D65B4F90065F271 /* cube03_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CB1D65B4F90065F271 /* cube03_0.png */; }; + 1A39E6041D65B4F90065F271 /* cube03_1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CC1D65B4F90065F271 /* cube03_1.png */; }; + 1A39E6051D65B4F90065F271 /* cube03_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CD1D65B4F90065F271 /* cube03_2.png */; }; + 1A39E6061D65B4F90065F271 /* cube03_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CE1D65B4F90065F271 /* cube03_3.png */; }; + 1A39E6071D65B4F90065F271 /* cube03_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5CF1D65B4F90065F271 /* cube03_4.png */; }; + 1A39E6081D65B4F90065F271 /* cube03_5.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D01D65B4F90065F271 /* cube03_5.png */; }; + 1A39E6091D65B4F90065F271 /* cube04_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D11D65B4F90065F271 /* cube04_0.png */; }; + 1A39E60A1D65B4F90065F271 /* cube04_1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D21D65B4F90065F271 /* cube04_1.png */; }; + 1A39E60B1D65B4F90065F271 /* cube04_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D31D65B4F90065F271 /* cube04_2.png */; }; + 1A39E60C1D65B4F90065F271 /* cube04_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D41D65B4F90065F271 /* cube04_3.png */; }; + 1A39E60D1D65B4F90065F271 /* cube04_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D51D65B4F90065F271 /* cube04_4.png */; }; + 1A39E60E1D65B4F90065F271 /* cube04_5.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D61D65B4F90065F271 /* cube04_5.png */; }; + 1A39E60F1D65B4F90065F271 /* cube05_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D71D65B4F90065F271 /* cube05_0.png */; }; + 1A39E6101D65B4F90065F271 /* cube05_1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D81D65B4F90065F271 /* cube05_1.png */; }; + 1A39E6111D65B4F90065F271 /* cube05_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5D91D65B4F90065F271 /* cube05_2.png */; }; + 1A39E6121D65B4F90065F271 /* cube05_3.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DA1D65B4F90065F271 /* cube05_3.png */; }; + 1A39E6131D65B4F90065F271 /* cube05_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DB1D65B4F90065F271 /* cube05_4.png */; }; + 1A39E6141D65B4F90065F271 /* cube05_5.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DC1D65B4F90065F271 /* cube05_5.png */; }; + 1A39E6151D65B4F90065F271 /* tex00.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DD1D65B4F90065F271 /* tex00.jpg */; }; + 1A39E6161D65B4F90065F271 /* tex01.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DE1D65B4F90065F271 /* tex01.jpg */; }; + 1A39E6171D65B4F90065F271 /* tex02.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5DF1D65B4F90065F271 /* tex02.jpg */; }; + 1A39E6181D65B4F90065F271 /* tex03.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E01D65B4F90065F271 /* tex03.jpg */; }; + 1A39E6191D65B4F90065F271 /* tex04.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E11D65B4F90065F271 /* tex04.jpg */; }; + 1A39E61A1D65B4F90065F271 /* tex05.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E21D65B4F90065F271 /* tex05.jpg */; }; + 1A39E61B1D65B4F90065F271 /* tex06.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E31D65B4F90065F271 /* tex06.jpg */; }; + 1A39E61C1D65B4F90065F271 /* tex07.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E41D65B4F90065F271 /* tex07.jpg */; }; + 1A39E61D1D65B4F90065F271 /* tex08.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E51D65B4F90065F271 /* tex08.jpg */; }; + 1A39E61E1D65B4F90065F271 /* tex09.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E61D65B4F90065F271 /* tex09.jpg */; }; + 1A39E61F1D65B4F90065F271 /* tex10.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E71D65B4F90065F271 /* tex10.png */; }; + 1A39E6201D65B4F90065F271 /* tex11.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E81D65B4F90065F271 /* tex11.png */; }; + 1A39E6211D65B4F90065F271 /* tex12.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5E91D65B4F90065F271 /* tex12.png */; }; + 1A39E6221D65B4F90065F271 /* tex14.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5EA1D65B4F90065F271 /* tex14.png */; }; + 1A39E6231D65B4F90065F271 /* tex15.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5EB1D65B4F90065F271 /* tex15.png */; }; + 1A39E6241D65B4F90065F271 /* tex16.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5EC1D65B4F90065F271 /* tex16.png */; }; + 1A39E6251D65B4F90065F271 /* tex17.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5ED1D65B4F90065F271 /* tex17.jpg */; }; + 1A39E6261D65B4F90065F271 /* tex18.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5EE1D65B4F90065F271 /* tex18.jpg */; }; + 1A39E6271D65B4F90065F271 /* tex19.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5EF1D65B4F90065F271 /* tex19.png */; }; + 1A39E6281D65B4F90065F271 /* tex20.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E5F01D65B4F90065F271 /* tex20.jpg */; }; + 1A39E62B1D65B54E0065F271 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1A39E6291D65B54E0065F271 /* Credits.rtf */; }; + 1A39E62E1D65B6A90065F271 /* Syphon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB8FF1BED279300B2B129 /* Syphon.framework */; }; + 1A39E62F1D65B6D80065F271 /* Syphon.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB8FF1BED279300B2B129 /* Syphon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1A39E6321D65B6F40065F271 /* VVUIToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96B06C1C18BE0ECF000A921C /* VVUIToolbox.framework */; }; + 1A39E6331D65B6FD0065F271 /* VVUIToolbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96B06C1C18BE0ECF000A921C /* VVUIToolbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1A3ECD6B1CF8AD27008460E8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9684E8AC1983488F00524F3C /* QuartzCore.framework */; }; 1A486EA31C42F43000B4291E /* VVBasics.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A486EA21C42F43000B4291E /* VVBasics.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1A486EF61C42F50300B4291E /* VVBasicMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 961EA950100E8834007E6C25 /* VVBasicMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -411,6 +537,8 @@ 1AC5E4591C4315E20068087D /* DDMathParser.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A486EBA1C42F45200B4291E /* DDMathParser.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1AC5E45A1C4315E20068087D /* VVISFKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A486EC71C42F45B00B4291E /* VVISFKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1AC5E45B1C431AA00068087D /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A854FD91C1A601400540729 /* GLKit.framework */; }; + 1AD54C071D65C8AD008063FD /* ISF QuickLook Plugin.pkg in Resources */ = {isa = PBXBuildFile; fileRef = 1AD54C051D65C8AD008063FD /* ISF QuickLook Plugin.pkg */; }; + 1AD54C081D65C8AD008063FD /* Vidvox ISF resources.pkg in Resources */ = {isa = PBXBuildFile; fileRef = 1AD54C061D65C8AD008063FD /* Vidvox ISF resources.pkg */; }; 1AD65DBE1D00B80E004427DC /* SwizzleISF-RGBAtoBGRA.fs in Resources */ = {isa = PBXBuildFile; fileRef = 1A1A01E21CDBF91000E49E5A /* SwizzleISF-RGBAtoBGRA.fs */; }; 1AE0C96A1BAEBD1F00941BEF /* ISFObjectAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE0C9681BAEBD1F00941BEF /* ISFObjectAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1AE0C96B1BAEBD1F00941BEF /* ISFObjectAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AE0C9691BAEBD1F00941BEF /* ISFObjectAdditions.m */; }; @@ -479,6 +607,19 @@ 1AEE1EDB1C136C68005259C0 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB90A1BED311200B2B129 /* CoreVideo.framework */; }; 1AEE1EDC1C136C6C005259C0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB90C1BED311A00B2B129 /* AppKit.framework */; }; 1AF93E851C10ABBB00BA0537 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7AB90C1BED311A00B2B129 /* AppKit.framework */; }; + 1AFE772F1D65AC9B003D8E7C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE772E1D65AC9B003D8E7C /* main.m */; }; + 1AFE77311D65AC9B003D8E7C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1AFE77301D65AC9B003D8E7C /* Assets.xcassets */; }; + 1AFE77341D65AC9B003D8E7C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AFE77321D65AC9B003D8E7C /* MainMenu.xib */; }; + 1AFE77411D65B012003D8E7C /* DDMathParser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8071219817BFE00FA7825 /* DDMathParser.framework */; }; + 1AFE77421D65B012003D8E7C /* VVBasics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961EA8ED100E8565007E6C25 /* VVBasics.framework */; }; + 1AFE77431D65B012003D8E7C /* VVBufferPool.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8073A19817C1600FA7825 /* VVBufferPool.framework */; }; + 1AFE77441D65B012003D8E7C /* VVISFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 964FF27D1981B5AF00CCC808 /* VVISFKit.framework */; }; + 1AFE77461D65B01D003D8E7C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AFE77451D65B01D003D8E7C /* OpenGL.framework */; }; + 1AFE77481D65B039003D8E7C /* VVBasics.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 961EA8ED100E8565007E6C25 /* VVBasics.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1AFE77491D65B039003D8E7C /* DDMathParser.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8071219817BFE00FA7825 /* DDMathParser.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1AFE774A1D65B039003D8E7C /* VVBufferPool.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8073A19817C1600FA7825 /* VVBufferPool.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1AFE774B1D65B039003D8E7C /* VVISFKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 964FF27D1981B5AF00CCC808 /* VVISFKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 1AFF3B401D65B8BD000F5E94 /* Blue.qtz in Resources */ = {isa = PBXBuildFile; fileRef = 96EE5D6219840D5C00231124 /* Blue.qtz */; }; 5107014210E14BF200A67653 /* MutNRLockDict.h in Headers */ = {isa = PBXBuildFile; fileRef = 5107014010E14BF200A67653 /* MutNRLockDict.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5107014310E14BF200A67653 /* MutNRLockDict.m in Sources */ = {isa = PBXBuildFile; fileRef = 5107014110E14BF200A67653 /* MutNRLockDict.m */; }; 96017709108D71D6008F90CA /* VVCrashReporterEmailField.h in Headers */ = {isa = PBXBuildFile; fileRef = 96017707108D71D6008F90CA /* VVCrashReporterEmailField.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -897,6 +1038,20 @@ remoteGlobalIDString = 96C8073919817C1600FA7825; remoteInfo = "VVBufferPool-mac"; }; + 1A39E62C1D65B67A0065F271 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1AFE77271D65AC9B003D8E7C; + remoteInfo = "ISF Editor"; + }; + 1A39E6301D65B6F00065F271 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 96B06C1B18BE0ECF000A921C; + remoteInfo = "VVUIToolbox-mac"; + }; 1A6116211C430264000DC53E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -1121,6 +1276,34 @@ remoteGlobalIDString = 9658764818CE5C2D003126BC; remoteInfo = "Build Mac Frameworks"; }; + 1AFE77391D65B002003D8E7C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 961EA8EC100E8565007E6C25; + remoteInfo = "VVBasics-mac"; + }; + 1AFE773B1D65B002003D8E7C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 96C8073919817C1600FA7825; + remoteInfo = "VVBufferPool-mac"; + }; + 1AFE773D1D65B002003D8E7C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 96C8071119817BFE00FA7825; + remoteInfo = "DDMathParser-mac"; + }; + 1AFE773F1D65B002003D8E7C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 964FF27C1981B5AF00CCC808; + remoteInfo = "VVISFKit-mac"; + }; 96140120198AD47600335292 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -1586,6 +1769,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1AFE77471D65B022003D8E7C /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 1A39E6331D65B6FD0065F271 /* VVUIToolbox.framework in Embed Frameworks */, + 1AFE77481D65B039003D8E7C /* VVBasics.framework in Embed Frameworks */, + 1AFE77491D65B039003D8E7C /* DDMathParser.framework in Embed Frameworks */, + 1AFE774A1D65B039003D8E7C /* VVBufferPool.framework in Embed Frameworks */, + 1AFE774B1D65B039003D8E7C /* VVISFKit.framework in Embed Frameworks */, + 1A39E62F1D65B6D80065F271 /* Syphon.framework in Embed Frameworks */, + 1A39E5AC1D65B45D0065F271 /* MGSFragaria.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; 96140127198AD4A300335292 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -1762,6 +1962,184 @@ 1A2E34141CDBE18200EFF2A8 /* QCQL.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = QCQL.entitlements; sourceTree = ""; }; 1A33E1621BED443100E82A6F /* Bad TV.fs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = "Bad TV.fs"; sourceTree = ""; }; 1A33E1631BED443100E82A6F /* CMYK Halftone-Lookaround.fs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = "CMYK Halftone-Lookaround.fs"; sourceTree = ""; }; + 1A39E4F11D65B1970065F271 /* ISF Editor-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ISF Editor-Info.plist"; sourceTree = ""; }; + 1A39E4F31D65B1D60065F271 /* AlphaOverCheckerboard.fs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = AlphaOverCheckerboard.fs; sourceTree = ""; }; + 1A39E4F41D65B1D60065F271 /* AudioController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioController.h; sourceTree = ""; }; + 1A39E4F51D65B1D60065F271 /* AudioController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioController.m; sourceTree = ""; }; + 1A39E4F61D65B1D60065F271 /* AVCaptureVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVCaptureVideoSource.h; sourceTree = ""; }; + 1A39E4F71D65B1D60065F271 /* AVCaptureVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AVCaptureVideoSource.m; sourceTree = ""; }; + 1A39E4F81D65B1D60065F271 /* DocController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocController.h; sourceTree = ""; }; + 1A39E4F91D65B1D60065F271 /* DocController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocController.m; sourceTree = ""; }; + 1A39E4FA1D65B1D60065F271 /* DynamicVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicVideoSource.h; sourceTree = ""; }; + 1A39E4FB1D65B1D60065F271 /* DynamicVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DynamicVideoSource.m; sourceTree = ""; }; + 1A39E4FC1D65B1D60065F271 /* IMGVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMGVideoSource.h; sourceTree = ""; }; + 1A39E4FD1D65B1D60065F271 /* IMGVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IMGVideoSource.m; sourceTree = ""; }; + 1A39E4FE1D65B1D60065F271 /* ISFAudioBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFAudioBufferList.h; sourceTree = ""; }; + 1A39E4FF1D65B1D60065F271 /* ISFAudioBufferList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFAudioBufferList.m; sourceTree = ""; }; + 1A39E5001D65B1D60065F271 /* ISFAudioFFT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFAudioFFT.h; sourceTree = ""; }; + 1A39E5011D65B1D60065F271 /* ISFAudioFFT.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFAudioFFT.m; sourceTree = ""; }; + 1A39E5021D65B1D60065F271 /* ISFAudioFFTResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFAudioFFTResults.h; sourceTree = ""; }; + 1A39E5031D65B1D60065F271 /* ISFAudioFFTResults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFAudioFFTResults.m; sourceTree = ""; }; + 1A39E5041D65B1D60065F271 /* ISFAVFAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFAVFAudioSource.h; sourceTree = ""; }; + 1A39E5051D65B1D60065F271 /* ISFAVFAudioSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFAVFAudioSource.m; sourceTree = ""; }; + 1A39E5061D65B1D60065F271 /* ISFController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFController.h; sourceTree = ""; }; + 1A39E5071D65B1D60065F271 /* ISFController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFController.m; sourceTree = ""; }; + 1A39E5081D65B1D60065F271 /* ISFConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFConverter.h; sourceTree = ""; }; + 1A39E5091D65B1D60065F271 /* ISFConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFConverter.m; sourceTree = ""; }; + 1A39E50A1D65B1D60065F271 /* ISFEditorAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFEditorAppDelegate.h; sourceTree = ""; }; + 1A39E50B1D65B1D60065F271 /* ISFEditorAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFEditorAppDelegate.m; sourceTree = ""; }; + 1A39E50C1D65B1D60065F271 /* ISFPDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPDownload.h; sourceTree = ""; }; + 1A39E50D1D65B1D60065F271 /* ISFPDownload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPDownload.m; sourceTree = ""; }; + 1A39E50E1D65B1D60065F271 /* ISFPDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPDownloader.h; sourceTree = ""; }; + 1A39E50F1D65B1D60065F271 /* ISFPDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPDownloader.m; sourceTree = ""; }; + 1A39E5101D65B1D60065F271 /* ISFPDownloadTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPDownloadTableCellView.h; sourceTree = ""; }; + 1A39E5111D65B1D60065F271 /* ISFPDownloadTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPDownloadTableCellView.m; sourceTree = ""; }; + 1A39E5121D65B1D60065F271 /* ISFPropAudioFFTTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropAudioFFTTableCellView.h; sourceTree = ""; }; + 1A39E5131D65B1D60065F271 /* ISFPropAudioFFTTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropAudioFFTTableCellView.m; sourceTree = ""; }; + 1A39E5141D65B1D60065F271 /* ISFPropAudioTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropAudioTableCellView.h; sourceTree = ""; }; + 1A39E5151D65B1D60065F271 /* ISFPropAudioTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropAudioTableCellView.m; sourceTree = ""; }; + 1A39E5161D65B1D60065F271 /* ISFPropBoolTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropBoolTableCellView.h; sourceTree = ""; }; + 1A39E5171D65B1D60065F271 /* ISFPropBoolTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropBoolTableCellView.m; sourceTree = ""; }; + 1A39E5181D65B1D60065F271 /* ISFPropColorTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropColorTableCellView.h; sourceTree = ""; }; + 1A39E5191D65B1D60065F271 /* ISFPropColorTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropColorTableCellView.m; sourceTree = ""; }; + 1A39E51A1D65B1D60065F271 /* ISFPropErrTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropErrTableCellView.h; sourceTree = ""; }; + 1A39E51B1D65B1D60065F271 /* ISFPropErrTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropErrTableCellView.m; sourceTree = ""; }; + 1A39E51C1D65B1D60065F271 /* ISFPropEventTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropEventTableCellView.h; sourceTree = ""; }; + 1A39E51D1D65B1D60065F271 /* ISFPropEventTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropEventTableCellView.m; sourceTree = ""; }; + 1A39E51E1D65B1D60065F271 /* ISFPropFloatTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropFloatTableCellView.h; sourceTree = ""; }; + 1A39E51F1D65B1D60065F271 /* ISFPropFloatTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropFloatTableCellView.m; sourceTree = ""; }; + 1A39E5201D65B1D60065F271 /* ISFPropGroupTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropGroupTableCellView.h; sourceTree = ""; }; + 1A39E5211D65B1D60065F271 /* ISFPropGroupTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropGroupTableCellView.m; sourceTree = ""; }; + 1A39E5221D65B1D60065F271 /* ISFPropImageTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropImageTableCellView.h; sourceTree = ""; }; + 1A39E5231D65B1D60065F271 /* ISFPropImageTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropImageTableCellView.m; sourceTree = ""; }; + 1A39E5241D65B1D60065F271 /* ISFPropInputTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropInputTableCellView.h; sourceTree = ""; }; + 1A39E5251D65B1D60065F271 /* ISFPropInputTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropInputTableCellView.m; sourceTree = ""; }; + 1A39E5261D65B1D60065F271 /* ISFPropLongTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropLongTableCellView.h; sourceTree = ""; }; + 1A39E5271D65B1D60065F271 /* ISFPropLongTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropLongTableCellView.m; sourceTree = ""; }; + 1A39E5281D65B1D60065F271 /* ISFPropPassTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropPassTableCellView.h; sourceTree = ""; }; + 1A39E5291D65B1D60065F271 /* ISFPropPassTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropPassTableCellView.m; sourceTree = ""; }; + 1A39E52A1D65B1D60065F271 /* ISFPropPoint2DTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropPoint2DTableCellView.h; sourceTree = ""; }; + 1A39E52B1D65B1D60065F271 /* ISFPropPoint2DTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropPoint2DTableCellView.m; sourceTree = ""; }; + 1A39E52C1D65B1D60065F271 /* ISFPropTopTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFPropTopTableCellView.h; sourceTree = ""; }; + 1A39E52D1D65B1D60065F271 /* ISFPropTopTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFPropTopTableCellView.m; sourceTree = ""; }; + 1A39E52E1D65B1D60065F271 /* ISFUIItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFUIItem.h; sourceTree = ""; }; + 1A39E52F1D65B1D60065F271 /* ISFUIItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFUIItem.m; sourceTree = ""; }; + 1A39E5301D65B1D60065F271 /* ISFVVBufferGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFVVBufferGLView.h; sourceTree = ""; }; + 1A39E5311D65B1D60065F271 /* ISFVVBufferGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFVVBufferGLView.m; sourceTree = ""; }; + 1A39E5321D65B1D60065F271 /* JSONGUIArrayGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIArrayGroup.h; sourceTree = ""; }; + 1A39E5331D65B1D60065F271 /* JSONGUIArrayGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIArrayGroup.m; sourceTree = ""; }; + 1A39E5341D65B1D60065F271 /* JSONGUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIController.h; sourceTree = ""; }; + 1A39E5351D65B1D60065F271 /* JSONGUIController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIController.m; sourceTree = ""; }; + 1A39E5361D65B1D60065F271 /* JSONGUIDictGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIDictGroup.h; sourceTree = ""; }; + 1A39E5371D65B1D60065F271 /* JSONGUIDictGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIDictGroup.m; sourceTree = ""; }; + 1A39E5381D65B1D60065F271 /* JSONGUIDragBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIDragBarView.h; sourceTree = ""; }; + 1A39E5391D65B1D60065F271 /* JSONGUIDragBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIDragBarView.m; sourceTree = ""; }; + 1A39E53A1D65B1D60065F271 /* JSONGUIInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIInput.h; sourceTree = ""; }; + 1A39E53B1D65B1D60065F271 /* JSONGUIInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIInput.m; sourceTree = ""; }; + 1A39E53C1D65B1D60065F271 /* JSONGUIPass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIPass.h; sourceTree = ""; }; + 1A39E53D1D65B1D60065F271 /* JSONGUIPass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIPass.m; sourceTree = ""; }; + 1A39E53E1D65B1D60065F271 /* JSONGUIPersistentBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUIPersistentBuffer.h; sourceTree = ""; }; + 1A39E53F1D65B1D60065F271 /* JSONGUIPersistentBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUIPersistentBuffer.m; sourceTree = ""; }; + 1A39E5401D65B1D60065F271 /* JSONGUITop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONGUITop.h; sourceTree = ""; }; + 1A39E5411D65B1D60065F271 /* JSONGUITop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONGUITop.m; sourceTree = ""; }; + 1A39E5421D65B1D60065F271 /* MouseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseView.h; sourceTree = ""; }; + 1A39E5431D65B1D60065F271 /* MouseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MouseView.m; sourceTree = ""; }; + 1A39E5441D65B1D60065F271 /* MovieFileVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MovieFileVideoSource.h; sourceTree = ""; }; + 1A39E5451D65B1D60065F271 /* MovieFileVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MovieFileVideoSource.m; sourceTree = ""; }; + 1A39E5461D65B1D60065F271 /* NewFileTemplate.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NewFileTemplate.txt; sourceTree = ""; }; + 1A39E5471D65B1D60065F271 /* NSColorAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorAdditions.h; sourceTree = ""; }; + 1A39E5481D65B1D60065F271 /* NSColorAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSColorAdditions.m; sourceTree = ""; }; + 1A39E5491D65B1D60065F271 /* NSColorWellNonContinuous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorWellNonContinuous.h; sourceTree = ""; }; + 1A39E54A1D65B1D60065F271 /* NSColorWellNonContinuous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSColorWellNonContinuous.m; sourceTree = ""; }; + 1A39E54B1D65B1D60065F271 /* NSPopUpButtonAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSPopUpButtonAdditions.h; sourceTree = ""; }; + 1A39E54C1D65B1D60065F271 /* NSPopUpButtonAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSPopUpButtonAdditions.m; sourceTree = ""; }; + 1A39E54D1D65B1D60065F271 /* NSProgressIndicatorAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSProgressIndicatorAdditions.h; sourceTree = ""; }; + 1A39E54E1D65B1D60065F271 /* NSProgressIndicatorAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSProgressIndicatorAdditions.m; sourceTree = ""; }; + 1A39E54F1D65B1D60065F271 /* NSValueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSValueAdditions.h; sourceTree = ""; }; + 1A39E5501D65B1D60065F271 /* NSValueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSValueAdditions.m; sourceTree = ""; }; + 1A39E5511D65B1D60065F271 /* QCVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCVideoSource.h; sourceTree = ""; }; + 1A39E5521D65B1D60065F271 /* QCVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QCVideoSource.m; sourceTree = ""; }; + 1A39E5531D65B1D60065F271 /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = ""; }; + 1A39E5541D65B1D60065F271 /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = ""; }; + 1A39E5551D65B1D60065F271 /* SyphonVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyphonVideoSource.h; sourceTree = ""; }; + 1A39E5561D65B1D60065F271 /* SyphonVideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SyphonVideoSource.m; sourceTree = ""; }; + 1A39E5571D65B1D60065F271 /* SyphonVVBufferPoolAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyphonVVBufferPoolAdditions.h; sourceTree = ""; }; + 1A39E5581D65B1D60065F271 /* SyphonVVBufferPoolAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SyphonVVBufferPoolAdditions.m; sourceTree = ""; }; + 1A39E5591D65B1D60065F271 /* UnselectableTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnselectableTableView.h; sourceTree = ""; }; + 1A39E55A1D65B1D60065F271 /* UnselectableTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnselectableTableView.m; sourceTree = ""; }; + 1A39E55B1D65B1D60065F271 /* VideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoSource.h; sourceTree = ""; }; + 1A39E55C1D65B1D60065F271 /* VideoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoSource.m; sourceTree = ""; }; + 1A39E55D1D65B1D60065F271 /* VVBufferSpriteGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVBufferSpriteGLView.h; sourceTree = ""; }; + 1A39E55E1D65B1D60065F271 /* VVBufferSpriteGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VVBufferSpriteGLView.m; sourceTree = ""; }; + 1A39E55F1D65B1D60065F271 /* VVKQueueCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVKQueueCenter.h; sourceTree = ""; }; + 1A39E5601D65B1D60065F271 /* VVKQueueCenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VVKQueueCenter.m; sourceTree = ""; }; + 1A39E5611D65B1D60065F271 /* VVMetadataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVMetadataItem.h; sourceTree = ""; }; + 1A39E5621D65B1D60065F271 /* VVMetadataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VVMetadataItem.m; sourceTree = ""; }; + 1A39E59F1D65B21F0065F271 /* Cube Array.qtz */ = {isa = PBXFileReference; lastKnownFileType = "video.quartz-composer"; path = "Cube Array.qtz"; sourceTree = ""; }; + 1A39E5AA1D65B4410065F271 /* MGSFragaria.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MGSFragaria.framework; path = external/MGSFragaria/MGSFragaria.framework; sourceTree = SOURCE_ROOT; }; + 1A39E5AD1D65B4880065F271 /* DBPrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBPrefsWindowController.h; path = external/MGSFragaria/DBPrefsWindowController.h; sourceTree = ""; }; + 1A39E5AE1D65B4880065F271 /* DBPrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DBPrefsWindowController.m; path = external/MGSFragaria/DBPrefsWindowController.m; sourceTree = ""; }; + 1A39E5AF1D65B4880065F271 /* General.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = General.png; path = external/MGSFragaria/General.png; sourceTree = ""; }; + 1A39E5B01D65B4880065F271 /* MGSPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGSPreferencesController.h; path = external/MGSFragaria/MGSPreferencesController.h; sourceTree = ""; }; + 1A39E5B11D65B4880065F271 /* MGSPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGSPreferencesController.m; path = external/MGSFragaria/MGSPreferencesController.m; sourceTree = ""; }; + 1A39E5B21D65B4880065F271 /* Preferences.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = Preferences.xib; path = external/MGSFragaria/Preferences.xib; sourceTree = ""; }; + 1A39E5B91D65B4F90065F271 /* cube00_0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_0.jpg; sourceTree = ""; }; + 1A39E5BA1D65B4F90065F271 /* cube00_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_1.jpg; sourceTree = ""; }; + 1A39E5BB1D65B4F90065F271 /* cube00_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_2.jpg; sourceTree = ""; }; + 1A39E5BC1D65B4F90065F271 /* cube00_3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_3.jpg; sourceTree = ""; }; + 1A39E5BD1D65B4F90065F271 /* cube00_4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_4.jpg; sourceTree = ""; }; + 1A39E5BE1D65B4F90065F271 /* cube00_5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube00_5.jpg; sourceTree = ""; }; + 1A39E5BF1D65B4F90065F271 /* cube01_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_0.png; sourceTree = ""; }; + 1A39E5C01D65B4F90065F271 /* cube01_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_1.png; sourceTree = ""; }; + 1A39E5C11D65B4F90065F271 /* cube01_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_2.png; sourceTree = ""; }; + 1A39E5C21D65B4F90065F271 /* cube01_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_3.png; sourceTree = ""; }; + 1A39E5C31D65B4F90065F271 /* cube01_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_4.png; sourceTree = ""; }; + 1A39E5C41D65B4F90065F271 /* cube01_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube01_5.png; sourceTree = ""; }; + 1A39E5C51D65B4F90065F271 /* cube02_0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_0.jpg; sourceTree = ""; }; + 1A39E5C61D65B4F90065F271 /* cube02_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_1.jpg; sourceTree = ""; }; + 1A39E5C71D65B4F90065F271 /* cube02_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_2.jpg; sourceTree = ""; }; + 1A39E5C81D65B4F90065F271 /* cube02_3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_3.jpg; sourceTree = ""; }; + 1A39E5C91D65B4F90065F271 /* cube02_4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_4.jpg; sourceTree = ""; }; + 1A39E5CA1D65B4F90065F271 /* cube02_5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cube02_5.jpg; sourceTree = ""; }; + 1A39E5CB1D65B4F90065F271 /* cube03_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_0.png; sourceTree = ""; }; + 1A39E5CC1D65B4F90065F271 /* cube03_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_1.png; sourceTree = ""; }; + 1A39E5CD1D65B4F90065F271 /* cube03_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_2.png; sourceTree = ""; }; + 1A39E5CE1D65B4F90065F271 /* cube03_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_3.png; sourceTree = ""; }; + 1A39E5CF1D65B4F90065F271 /* cube03_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_4.png; sourceTree = ""; }; + 1A39E5D01D65B4F90065F271 /* cube03_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube03_5.png; sourceTree = ""; }; + 1A39E5D11D65B4F90065F271 /* cube04_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_0.png; sourceTree = ""; }; + 1A39E5D21D65B4F90065F271 /* cube04_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_1.png; sourceTree = ""; }; + 1A39E5D31D65B4F90065F271 /* cube04_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_2.png; sourceTree = ""; }; + 1A39E5D41D65B4F90065F271 /* cube04_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_3.png; sourceTree = ""; }; + 1A39E5D51D65B4F90065F271 /* cube04_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_4.png; sourceTree = ""; }; + 1A39E5D61D65B4F90065F271 /* cube04_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube04_5.png; sourceTree = ""; }; + 1A39E5D71D65B4F90065F271 /* cube05_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_0.png; sourceTree = ""; }; + 1A39E5D81D65B4F90065F271 /* cube05_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_1.png; sourceTree = ""; }; + 1A39E5D91D65B4F90065F271 /* cube05_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_2.png; sourceTree = ""; }; + 1A39E5DA1D65B4F90065F271 /* cube05_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_3.png; sourceTree = ""; }; + 1A39E5DB1D65B4F90065F271 /* cube05_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_4.png; sourceTree = ""; }; + 1A39E5DC1D65B4F90065F271 /* cube05_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cube05_5.png; sourceTree = ""; }; + 1A39E5DD1D65B4F90065F271 /* tex00.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex00.jpg; sourceTree = ""; }; + 1A39E5DE1D65B4F90065F271 /* tex01.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex01.jpg; sourceTree = ""; }; + 1A39E5DF1D65B4F90065F271 /* tex02.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex02.jpg; sourceTree = ""; }; + 1A39E5E01D65B4F90065F271 /* tex03.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex03.jpg; sourceTree = ""; }; + 1A39E5E11D65B4F90065F271 /* tex04.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex04.jpg; sourceTree = ""; }; + 1A39E5E21D65B4F90065F271 /* tex05.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex05.jpg; sourceTree = ""; }; + 1A39E5E31D65B4F90065F271 /* tex06.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex06.jpg; sourceTree = ""; }; + 1A39E5E41D65B4F90065F271 /* tex07.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex07.jpg; sourceTree = ""; }; + 1A39E5E51D65B4F90065F271 /* tex08.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex08.jpg; sourceTree = ""; }; + 1A39E5E61D65B4F90065F271 /* tex09.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex09.jpg; sourceTree = ""; }; + 1A39E5E71D65B4F90065F271 /* tex10.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex10.png; sourceTree = ""; }; + 1A39E5E81D65B4F90065F271 /* tex11.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex11.png; sourceTree = ""; }; + 1A39E5E91D65B4F90065F271 /* tex12.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex12.png; sourceTree = ""; }; + 1A39E5EA1D65B4F90065F271 /* tex14.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex14.png; sourceTree = ""; }; + 1A39E5EB1D65B4F90065F271 /* tex15.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex15.png; sourceTree = ""; }; + 1A39E5EC1D65B4F90065F271 /* tex16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex16.png; sourceTree = ""; }; + 1A39E5ED1D65B4F90065F271 /* tex17.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex17.jpg; sourceTree = ""; }; + 1A39E5EE1D65B4F90065F271 /* tex18.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex18.jpg; sourceTree = ""; }; + 1A39E5EF1D65B4F90065F271 /* tex19.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tex19.png; sourceTree = ""; }; + 1A39E5F01D65B4F90065F271 /* tex20.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = tex20.jpg; sourceTree = ""; }; + 1A39E62A1D65B54E0065F271 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Base; path = Base.lproj/Credits.rtf; sourceTree = ""; }; 1A486EA01C42F43000B4291E /* VVBasics.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VVBasics.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1A486EA21C42F43000B4291E /* VVBasics.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VVBasics.h; sourceTree = ""; }; 1A486EA41C42F43000B4291E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1877,6 +2255,8 @@ 1AC5A4D91CEE4138004DF358 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1AC5A4E81CEE851B004DF358 /* MTCMIDIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTCMIDIManager.h; sourceTree = ""; }; 1AC5A4E91CEE851B004DF358 /* MTCMIDIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTCMIDIManager.m; sourceTree = ""; }; + 1AD54C051D65C8AD008063FD /* ISF QuickLook Plugin.pkg */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ISF QuickLook Plugin.pkg"; sourceTree = ""; }; + 1AD54C061D65C8AD008063FD /* Vidvox ISF resources.pkg */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Vidvox ISF resources.pkg"; sourceTree = ""; }; 1AE0C9681BAEBD1F00941BEF /* ISFObjectAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISFObjectAdditions.h; sourceTree = ""; }; 1AE0C9691BAEBD1F00941BEF /* ISFObjectAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISFObjectAdditions.m; sourceTree = ""; }; 1AE102A71CDBDF8B0034EA89 /* QCQLRendererRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QCQLRendererRemote.h; sourceTree = ""; }; @@ -1925,6 +2305,11 @@ 1AEE1EC91C136883005259C0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 1AEE1ECC1C136883005259C0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 1AEE1ECE1C136883005259C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1AFE77281D65AC9B003D8E7C /* ISF Editor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ISF Editor.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1AFE772E1D65AC9B003D8E7C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 1AFE77301D65AC9B003D8E7C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1AFE77331D65AC9B003D8E7C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 1AFE77451D65B01D003D8E7C /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; }; 32DBCF5E0370ADEE00C91783 /* VVOpenSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVOpenSource_Prefix.pch; sourceTree = ""; }; 5107014010E14BF200A67653 /* MutNRLockDict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutNRLockDict.h; path = VVBasics/src/MutNRLockDict.h; sourceTree = ""; }; 5107014110E14BF200A67653 /* MutNRLockDict.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MutNRLockDict.m; path = VVBasics/src/MutNRLockDict.m; sourceTree = ""; }; @@ -2456,6 +2841,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1AFE77251D65AC9B003D8E7C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A39E6321D65B6F40065F271 /* VVUIToolbox.framework in Frameworks */, + 1AFE77461D65B01D003D8E7C /* OpenGL.framework in Frameworks */, + 1A39E5AB1D65B4410065F271 /* MGSFragaria.framework in Frameworks */, + 1AFE77411D65B012003D8E7C /* DDMathParser.framework in Frameworks */, + 1AFE77421D65B012003D8E7C /* VVBasics.framework in Frameworks */, + 1A39E62E1D65B6A90065F271 /* Syphon.framework in Frameworks */, + 1AFE77431D65B012003D8E7C /* VVBufferPool.framework in Frameworks */, + 1AFE77441D65B012003D8E7C /* VVISFKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 96140106198AD46D00335292 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2703,6 +3103,7 @@ 1A1A01E91CDBFE3D00E49E5A /* ISFQL.qlgenerator */, 1A1A01F91CDBFE4900E49E5A /* com.vidvox.ISFQL-Renderer.app */, 1AC5A4CC1CEE4138004DF358 /* MTCSender.app */, + 1AFE77281D65AC9B003D8E7C /* ISF Editor.app */, ); name = Products; sourceTree = ""; @@ -2818,6 +3219,241 @@ name = "texture upload & download"; sourceTree = ""; }; + 1A39E5A11D65B2560065F271 /* Audio Classes */ = { + isa = PBXGroup; + children = ( + 1A39E4FE1D65B1D60065F271 /* ISFAudioBufferList.h */, + 1A39E4FF1D65B1D60065F271 /* ISFAudioBufferList.m */, + 1A39E5001D65B1D60065F271 /* ISFAudioFFT.h */, + 1A39E5011D65B1D60065F271 /* ISFAudioFFT.m */, + 1A39E5021D65B1D60065F271 /* ISFAudioFFTResults.h */, + 1A39E5031D65B1D60065F271 /* ISFAudioFFTResults.m */, + 1A39E5041D65B1D60065F271 /* ISFAVFAudioSource.h */, + 1A39E5051D65B1D60065F271 /* ISFAVFAudioSource.m */, + ); + name = "Audio Classes"; + sourceTree = ""; + }; + 1A39E5A21D65B28B0065F271 /* Video Source */ = { + isa = PBXGroup; + children = ( + 1A39E4FA1D65B1D60065F271 /* DynamicVideoSource.h */, + 1A39E4FB1D65B1D60065F271 /* DynamicVideoSource.m */, + 1A39E55B1D65B1D60065F271 /* VideoSource.h */, + 1A39E55C1D65B1D60065F271 /* VideoSource.m */, + 1A39E4F61D65B1D60065F271 /* AVCaptureVideoSource.h */, + 1A39E4F71D65B1D60065F271 /* AVCaptureVideoSource.m */, + 1A39E5441D65B1D60065F271 /* MovieFileVideoSource.h */, + 1A39E5451D65B1D60065F271 /* MovieFileVideoSource.m */, + 1A39E5511D65B1D60065F271 /* QCVideoSource.h */, + 1A39E5521D65B1D60065F271 /* QCVideoSource.m */, + 1A39E4FC1D65B1D60065F271 /* IMGVideoSource.h */, + 1A39E4FD1D65B1D60065F271 /* IMGVideoSource.m */, + 1A39E5551D65B1D60065F271 /* SyphonVideoSource.h */, + 1A39E5561D65B1D60065F271 /* SyphonVideoSource.m */, + ); + name = "Video Source"; + sourceTree = ""; + }; + 1A39E5A31D65B2D40065F271 /* ISF controller */ = { + isa = PBXGroup; + children = ( + 1A39E5061D65B1D60065F271 /* ISFController.h */, + 1A39E5071D65B1D60065F271 /* ISFController.m */, + 1A39E52E1D65B1D60065F271 /* ISFUIItem.h */, + 1A39E52F1D65B1D60065F271 /* ISFUIItem.m */, + ); + name = "ISF controller"; + sourceTree = ""; + }; + 1A39E5A41D65B2EE0065F271 /* class additions */ = { + isa = PBXGroup; + children = ( + 1A39E5471D65B1D60065F271 /* NSColorAdditions.h */, + 1A39E5481D65B1D60065F271 /* NSColorAdditions.m */, + 1A39E54B1D65B1D60065F271 /* NSPopUpButtonAdditions.h */, + 1A39E54C1D65B1D60065F271 /* NSPopUpButtonAdditions.m */, + 1A39E54D1D65B1D60065F271 /* NSProgressIndicatorAdditions.h */, + 1A39E54E1D65B1D60065F271 /* NSProgressIndicatorAdditions.m */, + 1A39E54F1D65B1D60065F271 /* NSValueAdditions.h */, + 1A39E5501D65B1D60065F271 /* NSValueAdditions.m */, + 1A39E5571D65B1D60065F271 /* SyphonVVBufferPoolAdditions.h */, + 1A39E5581D65B1D60065F271 /* SyphonVVBufferPoolAdditions.m */, + ); + name = "class additions"; + sourceTree = ""; + }; + 1A39E5A51D65B30E0065F271 /* misc small utility classes */ = { + isa = PBXGroup; + children = ( + 1A39E5301D65B1D60065F271 /* ISFVVBufferGLView.h */, + 1A39E5311D65B1D60065F271 /* ISFVVBufferGLView.m */, + 1A39E5421D65B1D60065F271 /* MouseView.h */, + 1A39E5431D65B1D60065F271 /* MouseView.m */, + 1A39E5531D65B1D60065F271 /* RegexKitLite.h */, + 1A39E5541D65B1D60065F271 /* RegexKitLite.m */, + 1A39E55D1D65B1D60065F271 /* VVBufferSpriteGLView.h */, + 1A39E55E1D65B1D60065F271 /* VVBufferSpriteGLView.m */, + 1A39E55F1D65B1D60065F271 /* VVKQueueCenter.h */, + 1A39E5601D65B1D60065F271 /* VVKQueueCenter.m */, + 1A39E5611D65B1D60065F271 /* VVMetadataItem.h */, + 1A39E5621D65B1D60065F271 /* VVMetadataItem.m */, + ); + name = "misc small utility classes"; + sourceTree = ""; + }; + 1A39E5A61D65B32C0065F271 /* JSON GUI */ = { + isa = PBXGroup; + children = ( + 1A39E5341D65B1D60065F271 /* JSONGUIController.h */, + 1A39E5351D65B1D60065F271 /* JSONGUIController.m */, + 1A39E5A71D65B3430065F271 /* Models for JSON GUI */, + 1A39E5A81D65B37D0065F271 /* Views for JSON GUI */, + ); + name = "JSON GUI"; + sourceTree = ""; + }; + 1A39E5A71D65B3430065F271 /* Models for JSON GUI */ = { + isa = PBXGroup; + children = ( + 1A39E5321D65B1D60065F271 /* JSONGUIArrayGroup.h */, + 1A39E5331D65B1D60065F271 /* JSONGUIArrayGroup.m */, + 1A39E5361D65B1D60065F271 /* JSONGUIDictGroup.h */, + 1A39E5371D65B1D60065F271 /* JSONGUIDictGroup.m */, + 1A39E53A1D65B1D60065F271 /* JSONGUIInput.h */, + 1A39E53B1D65B1D60065F271 /* JSONGUIInput.m */, + 1A39E53C1D65B1D60065F271 /* JSONGUIPass.h */, + 1A39E53D1D65B1D60065F271 /* JSONGUIPass.m */, + 1A39E53E1D65B1D60065F271 /* JSONGUIPersistentBuffer.h */, + 1A39E53F1D65B1D60065F271 /* JSONGUIPersistentBuffer.m */, + 1A39E5401D65B1D60065F271 /* JSONGUITop.h */, + 1A39E5411D65B1D60065F271 /* JSONGUITop.m */, + ); + name = "Models for JSON GUI"; + sourceTree = ""; + }; + 1A39E5A81D65B37D0065F271 /* Views for JSON GUI */ = { + isa = PBXGroup; + children = ( + 1A39E51A1D65B1D60065F271 /* ISFPropErrTableCellView.h */, + 1A39E51B1D65B1D60065F271 /* ISFPropErrTableCellView.m */, + 1A39E5201D65B1D60065F271 /* ISFPropGroupTableCellView.h */, + 1A39E5211D65B1D60065F271 /* ISFPropGroupTableCellView.m */, + 1A39E5241D65B1D60065F271 /* ISFPropInputTableCellView.h */, + 1A39E5251D65B1D60065F271 /* ISFPropInputTableCellView.m */, + 1A39E5281D65B1D60065F271 /* ISFPropPassTableCellView.h */, + 1A39E5291D65B1D60065F271 /* ISFPropPassTableCellView.m */, + 1A39E52C1D65B1D60065F271 /* ISFPropTopTableCellView.h */, + 1A39E52D1D65B1D60065F271 /* ISFPropTopTableCellView.m */, + 1A39E5381D65B1D60065F271 /* JSONGUIDragBarView.h */, + 1A39E5391D65B1D60065F271 /* JSONGUIDragBarView.m */, + 1A39E5A91D65B3D50065F271 /* specific input elements */, + ); + name = "Views for JSON GUI"; + sourceTree = ""; + }; + 1A39E5A91D65B3D50065F271 /* specific input elements */ = { + isa = PBXGroup; + children = ( + 1A39E5121D65B1D60065F271 /* ISFPropAudioFFTTableCellView.h */, + 1A39E5131D65B1D60065F271 /* ISFPropAudioFFTTableCellView.m */, + 1A39E5141D65B1D60065F271 /* ISFPropAudioTableCellView.h */, + 1A39E5151D65B1D60065F271 /* ISFPropAudioTableCellView.m */, + 1A39E5161D65B1D60065F271 /* ISFPropBoolTableCellView.h */, + 1A39E5171D65B1D60065F271 /* ISFPropBoolTableCellView.m */, + 1A39E5181D65B1D60065F271 /* ISFPropColorTableCellView.h */, + 1A39E5191D65B1D60065F271 /* ISFPropColorTableCellView.m */, + 1A39E51C1D65B1D60065F271 /* ISFPropEventTableCellView.h */, + 1A39E51D1D65B1D60065F271 /* ISFPropEventTableCellView.m */, + 1A39E51E1D65B1D60065F271 /* ISFPropFloatTableCellView.h */, + 1A39E51F1D65B1D60065F271 /* ISFPropFloatTableCellView.m */, + 1A39E5221D65B1D60065F271 /* ISFPropImageTableCellView.h */, + 1A39E5231D65B1D60065F271 /* ISFPropImageTableCellView.m */, + 1A39E5261D65B1D60065F271 /* ISFPropLongTableCellView.h */, + 1A39E5271D65B1D60065F271 /* ISFPropLongTableCellView.m */, + 1A39E52A1D65B1D60065F271 /* ISFPropPoint2DTableCellView.h */, + 1A39E52B1D65B1D60065F271 /* ISFPropPoint2DTableCellView.m */, + ); + name = "specific input elements"; + sourceTree = ""; + }; + 1A39E5B71D65B48C0065F271 /* MGSFragaria */ = { + isa = PBXGroup; + children = ( + 1A39E5AD1D65B4880065F271 /* DBPrefsWindowController.h */, + 1A39E5AE1D65B4880065F271 /* DBPrefsWindowController.m */, + 1A39E5AF1D65B4880065F271 /* General.png */, + 1A39E5B01D65B4880065F271 /* MGSPreferencesController.h */, + 1A39E5B11D65B4880065F271 /* MGSPreferencesController.m */, + 1A39E5B21D65B4880065F271 /* Preferences.xib */, + ); + name = MGSFragaria; + sourceTree = ""; + }; + 1A39E5B81D65B4F90065F271 /* shadertoy images */ = { + isa = PBXGroup; + children = ( + 1A39E5B91D65B4F90065F271 /* cube00_0.jpg */, + 1A39E5BA1D65B4F90065F271 /* cube00_1.jpg */, + 1A39E5BB1D65B4F90065F271 /* cube00_2.jpg */, + 1A39E5BC1D65B4F90065F271 /* cube00_3.jpg */, + 1A39E5BD1D65B4F90065F271 /* cube00_4.jpg */, + 1A39E5BE1D65B4F90065F271 /* cube00_5.jpg */, + 1A39E5BF1D65B4F90065F271 /* cube01_0.png */, + 1A39E5C01D65B4F90065F271 /* cube01_1.png */, + 1A39E5C11D65B4F90065F271 /* cube01_2.png */, + 1A39E5C21D65B4F90065F271 /* cube01_3.png */, + 1A39E5C31D65B4F90065F271 /* cube01_4.png */, + 1A39E5C41D65B4F90065F271 /* cube01_5.png */, + 1A39E5C51D65B4F90065F271 /* cube02_0.jpg */, + 1A39E5C61D65B4F90065F271 /* cube02_1.jpg */, + 1A39E5C71D65B4F90065F271 /* cube02_2.jpg */, + 1A39E5C81D65B4F90065F271 /* cube02_3.jpg */, + 1A39E5C91D65B4F90065F271 /* cube02_4.jpg */, + 1A39E5CA1D65B4F90065F271 /* cube02_5.jpg */, + 1A39E5CB1D65B4F90065F271 /* cube03_0.png */, + 1A39E5CC1D65B4F90065F271 /* cube03_1.png */, + 1A39E5CD1D65B4F90065F271 /* cube03_2.png */, + 1A39E5CE1D65B4F90065F271 /* cube03_3.png */, + 1A39E5CF1D65B4F90065F271 /* cube03_4.png */, + 1A39E5D01D65B4F90065F271 /* cube03_5.png */, + 1A39E5D11D65B4F90065F271 /* cube04_0.png */, + 1A39E5D21D65B4F90065F271 /* cube04_1.png */, + 1A39E5D31D65B4F90065F271 /* cube04_2.png */, + 1A39E5D41D65B4F90065F271 /* cube04_3.png */, + 1A39E5D51D65B4F90065F271 /* cube04_4.png */, + 1A39E5D61D65B4F90065F271 /* cube04_5.png */, + 1A39E5D71D65B4F90065F271 /* cube05_0.png */, + 1A39E5D81D65B4F90065F271 /* cube05_1.png */, + 1A39E5D91D65B4F90065F271 /* cube05_2.png */, + 1A39E5DA1D65B4F90065F271 /* cube05_3.png */, + 1A39E5DB1D65B4F90065F271 /* cube05_4.png */, + 1A39E5DC1D65B4F90065F271 /* cube05_5.png */, + 1A39E5DD1D65B4F90065F271 /* tex00.jpg */, + 1A39E5DE1D65B4F90065F271 /* tex01.jpg */, + 1A39E5DF1D65B4F90065F271 /* tex02.jpg */, + 1A39E5E01D65B4F90065F271 /* tex03.jpg */, + 1A39E5E11D65B4F90065F271 /* tex04.jpg */, + 1A39E5E21D65B4F90065F271 /* tex05.jpg */, + 1A39E5E31D65B4F90065F271 /* tex06.jpg */, + 1A39E5E41D65B4F90065F271 /* tex07.jpg */, + 1A39E5E51D65B4F90065F271 /* tex08.jpg */, + 1A39E5E61D65B4F90065F271 /* tex09.jpg */, + 1A39E5E71D65B4F90065F271 /* tex10.png */, + 1A39E5E81D65B4F90065F271 /* tex11.png */, + 1A39E5E91D65B4F90065F271 /* tex12.png */, + 1A39E5EA1D65B4F90065F271 /* tex14.png */, + 1A39E5EB1D65B4F90065F271 /* tex15.png */, + 1A39E5EC1D65B4F90065F271 /* tex16.png */, + 1A39E5ED1D65B4F90065F271 /* tex17.jpg */, + 1A39E5EE1D65B4F90065F271 /* tex18.jpg */, + 1A39E5EF1D65B4F90065F271 /* tex19.png */, + 1A39E5F01D65B4F90065F271 /* tex20.jpg */, + ); + name = "shadertoy images"; + path = shadertoy_images; + sourceTree = ""; + }; 1A486EA11C42F43000B4291E /* VVBasics-iOS */ = { isa = PBXGroup; children = ( @@ -2881,6 +3517,7 @@ 1A6533491CEB7DB40003C9D1 /* Embedded Frameworks */ = { isa = PBXGroup; children = ( + 1A39E5AA1D65B4410065F271 /* MGSFragaria.framework */, 1A7AB8FF1BED279300B2B129 /* Syphon.framework */, ); name = "Embedded Frameworks"; @@ -3207,6 +3844,56 @@ name = "Supporting Files"; sourceTree = ""; }; + 1AFE77291D65AC9B003D8E7C /* ISF Editor */ = { + isa = PBXGroup; + children = ( + 1A39E4F31D65B1D60065F271 /* AlphaOverCheckerboard.fs */, + 1A39E59F1D65B21F0065F271 /* Cube Array.qtz */, + 1AD54C051D65C8AD008063FD /* ISF QuickLook Plugin.pkg */, + 1AD54C061D65C8AD008063FD /* Vidvox ISF resources.pkg */, + 1A39E50A1D65B1D60065F271 /* ISFEditorAppDelegate.h */, + 1A39E50B1D65B1D60065F271 /* ISFEditorAppDelegate.m */, + 1A39E5101D65B1D60065F271 /* ISFPDownloadTableCellView.h */, + 1A39E5111D65B1D60065F271 /* ISFPDownloadTableCellView.m */, + 1A39E50E1D65B1D60065F271 /* ISFPDownloader.h */, + 1A39E50F1D65B1D60065F271 /* ISFPDownloader.m */, + 1A39E50C1D65B1D60065F271 /* ISFPDownload.h */, + 1A39E50D1D65B1D60065F271 /* ISFPDownload.m */, + 1A39E4F41D65B1D60065F271 /* AudioController.h */, + 1A39E4F51D65B1D60065F271 /* AudioController.m */, + 1A39E5461D65B1D60065F271 /* NewFileTemplate.txt */, + 1A39E5081D65B1D60065F271 /* ISFConverter.h */, + 1A39E5091D65B1D60065F271 /* ISFConverter.m */, + 1A39E4F81D65B1D60065F271 /* DocController.h */, + 1A39E4F91D65B1D60065F271 /* DocController.m */, + 1A39E5B81D65B4F90065F271 /* shadertoy images */, + 1A39E5A11D65B2560065F271 /* Audio Classes */, + 1A39E5A21D65B28B0065F271 /* Video Source */, + 1A39E5A31D65B2D40065F271 /* ISF controller */, + 1A39E5A41D65B2EE0065F271 /* class additions */, + 1A39E5A51D65B30E0065F271 /* misc small utility classes */, + 1AFE772D1D65AC9B003D8E7C /* Supporting Files */, + 1A39E5A61D65B32C0065F271 /* JSON GUI */, + 1A39E5491D65B1D60065F271 /* NSColorWellNonContinuous.h */, + 1A39E54A1D65B1D60065F271 /* NSColorWellNonContinuous.m */, + 1A39E5591D65B1D60065F271 /* UnselectableTableView.h */, + 1A39E55A1D65B1D60065F271 /* UnselectableTableView.m */, + ); + path = "ISF Editor"; + sourceTree = ""; + }; + 1AFE772D1D65AC9B003D8E7C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 1AFE77301D65AC9B003D8E7C /* Assets.xcassets */, + 1AFE77321D65AC9B003D8E7C /* MainMenu.xib */, + 1A39E4F11D65B1970065F271 /* ISF Editor-Info.plist */, + 1A39E6291D65B54E0065F271 /* Credits.rtf */, + 1AFE772E1D65AC9B003D8E7C /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 32C88DFF0371C24200C91783 /* Other Sources */ = { isa = PBXGroup; children = ( @@ -3542,6 +4229,7 @@ 1AE1A7D81CDA6824005F924D /* GPUUploadBenchmark */, 1AE1A7ED1CDA682C005F924D /* GPUDownloadBenchmark */, 1AC5A4CD1CEE4138004DF358 /* MTCSender */, + 1AFE77291D65AC9B003D8E7C /* ISF Editor */, ); name = Applications; sourceTree = ""; @@ -3613,6 +4301,7 @@ 96ACD7221706416300138AE6 /* Frameworks */ = { isa = PBXGroup; children = ( + 1AFE77451D65B01D003D8E7C /* OpenGL.framework */, 1A64E4B01CD96BD000DC3310 /* CoreMedia.framework */, 1A854FDF1C1A603300540729 /* Foundation.framework */, 1A854FD91C1A601400540729 /* GLKit.framework */, @@ -3723,6 +4412,7 @@ children = ( 96C00548185A447900C33FE2 /* MAZeroingWeakRef */, 96C807A319817CBC00FA7825 /* DDMathParser-master */, + 1A39E5B71D65B48C0065F271 /* MGSFragaria */, ); name = "EXTERNAL CODE"; sourceTree = ""; @@ -4591,6 +5281,29 @@ productReference = 1AEE1EC11C136883005259C0 /* GLShaderSceneTestApp.app */; productType = "com.apple.product-type.application"; }; + 1AFE77271D65AC9B003D8E7C /* ISF Editor */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1AFE77381D65AC9B003D8E7C /* Build configuration list for PBXNativeTarget "ISF Editor" */; + buildPhases = ( + 1AFE77241D65AC9B003D8E7C /* Sources */, + 1AFE77251D65AC9B003D8E7C /* Frameworks */, + 1AFE77261D65AC9B003D8E7C /* Resources */, + 1AFE77471D65B022003D8E7C /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 1A39E6311D65B6F00065F271 /* PBXTargetDependency */, + 1AFE773A1D65B002003D8E7C /* PBXTargetDependency */, + 1AFE773C1D65B002003D8E7C /* PBXTargetDependency */, + 1AFE773E1D65B002003D8E7C /* PBXTargetDependency */, + 1AFE77401D65B002003D8E7C /* PBXTargetDependency */, + ); + name = "ISF Editor"; + productName = "ISF Editor"; + productReference = 1AFE77281D65AC9B003D8E7C /* ISF Editor.app */; + productType = "com.apple.product-type.application"; + }; 96140108198AD46D00335292 /* QT and Hap Test App */ = { isa = PBXNativeTarget; buildConfigurationList = 9614011F198AD46D00335292 /* Build configuration list for PBXNativeTarget "QT and Hap Test App" */; @@ -4946,7 +5659,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0730; TargetAttributes = { 1A00B8C41C430B3600BC2BEB = { CreatedOnToolsVersion = 7.2; @@ -5025,6 +5738,9 @@ 1AEE1EC01C136883005259C0 = { CreatedOnToolsVersion = 7.1; }; + 1AFE77271D65AC9B003D8E7C = { + CreatedOnToolsVersion = 7.3.1; + }; }; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "VVOpenSource" */; @@ -5075,6 +5791,7 @@ 1AE1A7D61CDA6824005F924D /* GPUUploadBenchmark */, 1AE1A7EB1CDA682C005F924D /* GPUDownloadBenchmark */, 1AC5A4CB1CEE4138004DF358 /* MTCSender */, + 1AFE77271D65AC9B003D8E7C /* ISF Editor */, 968A7EEB185BA3100075DEB1 /* Build iOS frameworks */, 1A486E9F1C42F43000B4291E /* VVBasics-iOS */, 1A486EAC1C42F44300B4291E /* VVBufferPool-iOS */, @@ -5301,6 +6018,80 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1AFE77261D65AC9B003D8E7C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A39E5FF1D65B4F90065F271 /* cube02_2.jpg in Resources */, + 1A39E58D1D65B1D60065F271 /* NewFileTemplate.txt in Resources */, + 1A39E6251D65B4F90065F271 /* tex17.jpg in Resources */, + 1A39E60E1D65B4F90065F271 /* cube04_5.png in Resources */, + 1A39E60D1D65B4F90065F271 /* cube04_4.png in Resources */, + 1A39E6071D65B4F90065F271 /* cube03_4.png in Resources */, + 1A39E6021D65B4F90065F271 /* cube02_5.jpg in Resources */, + 1A39E5A01D65B21F0065F271 /* Cube Array.qtz in Resources */, + 1A39E6231D65B4F90065F271 /* tex15.png in Resources */, + 1A39E6241D65B4F90065F271 /* tex16.png in Resources */, + 1A39E5FB1D65B4F90065F271 /* cube01_4.png in Resources */, + 1A39E61E1D65B4F90065F271 /* tex09.jpg in Resources */, + 1A39E5F71D65B4F90065F271 /* cube01_0.png in Resources */, + 1A39E5F31D65B4F90065F271 /* cube00_2.jpg in Resources */, + 1A39E5F21D65B4F90065F271 /* cube00_1.jpg in Resources */, + 1A39E61D1D65B4F90065F271 /* tex08.jpg in Resources */, + 1A39E6011D65B4F90065F271 /* cube02_4.jpg in Resources */, + 1AD54C071D65C8AD008063FD /* ISF QuickLook Plugin.pkg in Resources */, + 1A39E6051D65B4F90065F271 /* cube03_2.png in Resources */, + 1A39E6261D65B4F90065F271 /* tex18.jpg in Resources */, + 1A39E6091D65B4F90065F271 /* cube04_0.png in Resources */, + 1A39E62B1D65B54E0065F271 /* Credits.rtf in Resources */, + 1A39E61B1D65B4F90065F271 /* tex06.jpg in Resources */, + 1AFF3B401D65B8BD000F5E94 /* Blue.qtz in Resources */, + 1A39E60F1D65B4F90065F271 /* cube05_0.png in Resources */, + 1A39E5FA1D65B4F90065F271 /* cube01_3.png in Resources */, + 1A39E5FC1D65B4F90065F271 /* cube01_5.png in Resources */, + 1A39E5F61D65B4F90065F271 /* cube00_5.jpg in Resources */, + 1A39E5F41D65B4F90065F271 /* cube00_3.jpg in Resources */, + 1A39E61C1D65B4F90065F271 /* tex07.jpg in Resources */, + 1A39E5B61D65B4880065F271 /* Preferences.xib in Resources */, + 1A39E61A1D65B4F90065F271 /* tex05.jpg in Resources */, + 1AFE77311D65AC9B003D8E7C /* Assets.xcassets in Resources */, + 1A39E5FE1D65B4F90065F271 /* cube02_1.jpg in Resources */, + 1A39E6061D65B4F90065F271 /* cube03_3.png in Resources */, + 1A39E6121D65B4F90065F271 /* cube05_3.png in Resources */, + 1A39E6161D65B4F90065F271 /* tex01.jpg in Resources */, + 1A39E5F11D65B4F90065F271 /* cube00_0.jpg in Resources */, + 1A39E5FD1D65B4F90065F271 /* cube02_0.jpg in Resources */, + 1A39E6111D65B4F90065F271 /* cube05_2.png in Resources */, + 1A39E6141D65B4F90065F271 /* cube05_5.png in Resources */, + 1A39E60B1D65B4F90065F271 /* cube04_2.png in Resources */, + 1A39E6081D65B4F90065F271 /* cube03_5.png in Resources */, + 1A39E6171D65B4F90065F271 /* tex02.jpg in Resources */, + 1A39E6101D65B4F90065F271 /* cube05_1.png in Resources */, + 1A39E6281D65B4F90065F271 /* tex20.jpg in Resources */, + 1A39E5F51D65B4F90065F271 /* cube00_4.jpg in Resources */, + 1A39E6271D65B4F90065F271 /* tex19.png in Resources */, + 1A39E5631D65B1D60065F271 /* AlphaOverCheckerboard.fs in Resources */, + 1A39E6211D65B4F90065F271 /* tex12.png in Resources */, + 1A39E6041D65B4F90065F271 /* cube03_1.png in Resources */, + 1A39E6151D65B4F90065F271 /* tex00.jpg in Resources */, + 1A39E5F91D65B4F90065F271 /* cube01_2.png in Resources */, + 1AFE77341D65AC9B003D8E7C /* MainMenu.xib in Resources */, + 1A39E61F1D65B4F90065F271 /* tex10.png in Resources */, + 1A39E6031D65B4F90065F271 /* cube03_0.png in Resources */, + 1AD54C081D65C8AD008063FD /* Vidvox ISF resources.pkg in Resources */, + 1A39E6201D65B4F90065F271 /* tex11.png in Resources */, + 1A39E60A1D65B4F90065F271 /* cube04_1.png in Resources */, + 1A39E60C1D65B4F90065F271 /* cube04_3.png in Resources */, + 1A39E5B41D65B4880065F271 /* General.png in Resources */, + 1A39E6191D65B4F90065F271 /* tex04.jpg in Resources */, + 1A39E6181D65B4F90065F271 /* tex03.jpg in Resources */, + 1A39E6001D65B4F90065F271 /* cube02_3.jpg in Resources */, + 1A39E5F81D65B4F90065F271 /* cube01_1.png in Resources */, + 1A39E6221D65B4F90065F271 /* tex14.png in Resources */, + 1A39E6131D65B4F90065F271 /* cube05_4.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 96140107198AD46D00335292 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -5775,6 +6566,71 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1AFE77241D65AC9B003D8E7C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A39E58E1D65B1D60065F271 /* NSColorAdditions.m in Sources */, + 1A39E5781D65B1D60065F271 /* ISFPropEventTableCellView.m in Sources */, + 1A39E5691D65B1D60065F271 /* ISFAudioBufferList.m in Sources */, + 1A39E5661D65B1D60065F271 /* DocController.m in Sources */, + 1A39E5741D65B1D60065F271 /* ISFPropAudioTableCellView.m in Sources */, + 1A39E58B1D65B1D60065F271 /* MouseView.m in Sources */, + 1A39E5861D65B1D60065F271 /* JSONGUIDragBarView.m in Sources */, + 1A39E5821D65B1D60065F271 /* ISFVVBufferGLView.m in Sources */, + 1A39E5981D65B1D60065F271 /* VideoSource.m in Sources */, + 1A39E57C1D65B1D60065F271 /* ISFPropInputTableCellView.m in Sources */, + 1A39E5891D65B1D60065F271 /* JSONGUIPersistentBuffer.m in Sources */, + 1A39E56C1D65B1D60065F271 /* ISFAVFAudioSource.m in Sources */, + 1A39E58A1D65B1D60065F271 /* JSONGUITop.m in Sources */, + 1A39E5721D65B1D60065F271 /* ISFPDownloadTableCellView.m in Sources */, + 1A39E56E1D65B1D60065F271 /* ISFConverter.m in Sources */, + 1A39E5731D65B1D60065F271 /* ISFPropAudioFFTTableCellView.m in Sources */, + 1A39E57D1D65B1D60065F271 /* ISFPropLongTableCellView.m in Sources */, + 1A39E5971D65B1D60065F271 /* UnselectableTableView.m in Sources */, + 1A39E5871D65B1D60065F271 /* JSONGUIInput.m in Sources */, + 1A39E57E1D65B1D60065F271 /* ISFPropPassTableCellView.m in Sources */, + 1A39E5881D65B1D60065F271 /* JSONGUIPass.m in Sources */, + 1A39E5801D65B1D60065F271 /* ISFPropTopTableCellView.m in Sources */, + 1A39E5831D65B1D60065F271 /* JSONGUIArrayGroup.m in Sources */, + 1A39E59B1D65B1D60065F271 /* VVMetadataItem.m in Sources */, + 1A39E5671D65B1D60065F271 /* DynamicVideoSource.m in Sources */, + 1A39E5701D65B1D60065F271 /* ISFPDownload.m in Sources */, + 1A39E5651D65B1D60065F271 /* AVCaptureVideoSource.m in Sources */, + 1A39E5901D65B1D60065F271 /* NSPopUpButtonAdditions.m in Sources */, + 1A39E5751D65B1D60065F271 /* ISFPropBoolTableCellView.m in Sources */, + 1A39E56F1D65B1D60065F271 /* ISFEditorAppDelegate.m in Sources */, + 1A39E5911D65B1D60065F271 /* NSProgressIndicatorAdditions.m in Sources */, + 1A39E5711D65B1D60065F271 /* ISFPDownloader.m in Sources */, + 1A39E5921D65B1D60065F271 /* NSValueAdditions.m in Sources */, + 1A39E56A1D65B1D60065F271 /* ISFAudioFFT.m in Sources */, + 1A39E5B51D65B4880065F271 /* MGSPreferencesController.m in Sources */, + 1A39E5791D65B1D60065F271 /* ISFPropFloatTableCellView.m in Sources */, + 1A39E5641D65B1D60065F271 /* AudioController.m in Sources */, + 1A39E5B31D65B4880065F271 /* DBPrefsWindowController.m in Sources */, + 1A39E5961D65B1D60065F271 /* SyphonVVBufferPoolAdditions.m in Sources */, + 1A39E59A1D65B1D60065F271 /* VVKQueueCenter.m in Sources */, + 1A39E5951D65B1D60065F271 /* SyphonVideoSource.m in Sources */, + 1A39E5841D65B1D60065F271 /* JSONGUIController.m in Sources */, + 1A39E57A1D65B1D60065F271 /* ISFPropGroupTableCellView.m in Sources */, + 1A39E5941D65B1D60065F271 /* RegexKitLite.m in Sources */, + 1A39E5681D65B1D60065F271 /* IMGVideoSource.m in Sources */, + 1A39E5811D65B1D60065F271 /* ISFUIItem.m in Sources */, + 1AFE772F1D65AC9B003D8E7C /* main.m in Sources */, + 1A39E5931D65B1D60065F271 /* QCVideoSource.m in Sources */, + 1A39E5991D65B1D60065F271 /* VVBufferSpriteGLView.m in Sources */, + 1A39E58F1D65B1D60065F271 /* NSColorWellNonContinuous.m in Sources */, + 1A39E57B1D65B1D60065F271 /* ISFPropImageTableCellView.m in Sources */, + 1A39E56D1D65B1D60065F271 /* ISFController.m in Sources */, + 1A39E56B1D65B1D60065F271 /* ISFAudioFFTResults.m in Sources */, + 1A39E5771D65B1D60065F271 /* ISFPropErrTableCellView.m in Sources */, + 1A39E5851D65B1D60065F271 /* JSONGUIDictGroup.m in Sources */, + 1A39E57F1D65B1D60065F271 /* ISFPropPoint2DTableCellView.m in Sources */, + 1A39E5761D65B1D60065F271 /* ISFPropColorTableCellView.m in Sources */, + 1A39E58C1D65B1D60065F271 /* MovieFileVideoSource.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 96140105198AD46D00335292 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -6081,6 +6937,16 @@ target = 96C8073919817C1600FA7825 /* VVBufferPool-mac */; targetProxy = 1A2E34191CDBE2F800EFF2A8 /* PBXContainerItemProxy */; }; + 1A39E62D1D65B67A0065F271 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1AFE77271D65AC9B003D8E7C /* ISF Editor */; + targetProxy = 1A39E62C1D65B67A0065F271 /* PBXContainerItemProxy */; + }; + 1A39E6311D65B6F00065F271 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 96B06C1B18BE0ECF000A921C /* VVUIToolbox-mac */; + targetProxy = 1A39E6301D65B6F00065F271 /* PBXContainerItemProxy */; + }; 1A6116221C430264000DC53E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 1A486E9F1C42F43000B4291E /* VVBasics-iOS */; @@ -6241,6 +7107,26 @@ target = 9658764818CE5C2D003126BC /* Build Mac Frameworks */; targetProxy = 1AEE1ED21C1368F4005259C0 /* PBXContainerItemProxy */; }; + 1AFE773A1D65B002003D8E7C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 961EA8EC100E8565007E6C25 /* VVBasics-mac */; + targetProxy = 1AFE77391D65B002003D8E7C /* PBXContainerItemProxy */; + }; + 1AFE773C1D65B002003D8E7C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 96C8073919817C1600FA7825 /* VVBufferPool-mac */; + targetProxy = 1AFE773B1D65B002003D8E7C /* PBXContainerItemProxy */; + }; + 1AFE773E1D65B002003D8E7C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 96C8071119817BFE00FA7825 /* DDMathParser-mac */; + targetProxy = 1AFE773D1D65B002003D8E7C /* PBXContainerItemProxy */; + }; + 1AFE77401D65B002003D8E7C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 964FF27C1981B5AF00CCC808 /* VVISFKit-mac */; + targetProxy = 1AFE773F1D65B002003D8E7C /* PBXContainerItemProxy */; + }; 96140121198AD47600335292 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9658764818CE5C2D003126BC /* Build Mac Frameworks */; @@ -6473,6 +7359,14 @@ name = MainMenu.xib; sourceTree = ""; }; + 1A39E6291D65B54E0065F271 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 1A39E62A1D65B54E0065F271 /* Base */, + ); + name = Credits.rtf; + sourceTree = ""; + }; 1A68C2551CDBDD55001FF7D6 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( @@ -6553,6 +7447,14 @@ name = MainMenu.xib; sourceTree = ""; }; + 1AFE77321D65AC9B003D8E7C /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1AFE77331D65AC9B003D8E7C /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; 9614010E198AD46D00335292 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( @@ -7962,6 +8864,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -7999,6 +8902,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -8039,6 +8943,7 @@ LD_RUNPATH_SEARCH_PATHS = "@loader_path/../../../../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -8076,6 +8981,7 @@ LD_RUNPATH_SEARCH_PATHS = "@loader_path/../../../../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -8724,6 +9630,112 @@ }; name = Release; }; + 1AFE77361D65AC9B003D8E7C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/external/MGSFragaria", + "$(PROJECT_DIR)/SyphonToAndFromVVBuffer", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "ISF Editor/ISF Editor-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_CODE_SIGN_FLAGS = "--deep"; + OTHER_LDFLAGS = ( + "-lstdc++", + "-licucore", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vidvox.ISF-Editor"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + 1AFE77371D65AC9B003D8E7C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Developer ID Application"; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/external/MGSFragaria", + "$(PROJECT_DIR)/SyphonToAndFromVVBuffer", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "ISF Editor/ISF Editor-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CODE_SIGN_FLAGS = "--deep"; + OTHER_LDFLAGS = ( + "-lstdc++", + "-licucore", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vidvox.ISF-Editor"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -8797,6 +9809,7 @@ INFOPLIST_FILE = "QT and Hap Test App/QT and Hap Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = app; @@ -8827,6 +9840,7 @@ INFOPLIST_FILE = "QT and Hap Test App/QT and Hap Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = app; @@ -8995,6 +10009,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vidvox.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = OSCTestApp; }; name = Debug; @@ -9018,6 +10033,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vidvox.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = OSCTestApp; ZERO_LINK = NO; }; @@ -9117,6 +10133,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = MIDITestApp; }; name = Debug; @@ -9140,6 +10157,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = MIDITestApp; ZERO_LINK = NO; }; @@ -9186,6 +10204,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "GLScene Test App/GLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9213,6 +10232,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "GLScene Test App/GLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9245,6 +10265,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "QCGLScene Test App/QCGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9272,6 +10293,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "QCGLScene Test App/QCGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9304,6 +10326,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "CIGLScene Test App/CIGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9331,6 +10354,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "CIGLScene Test App/CIGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9363,6 +10387,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "ISFGLScene Test App/ISFGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9390,6 +10415,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "ISFGLScene Test App/ISFGLScene Test App-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9436,6 +10462,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = OSCQueryTest; }; name = Debug; @@ -9459,6 +10486,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = OSCQueryTest; ZERO_LINK = NO; }; @@ -9499,6 +10527,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CrashReporterTestApp; }; name = Debug; @@ -9522,6 +10551,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CrashReporterTestApp; ZERO_LINK = NO; }; @@ -9554,6 +10584,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "OSCPingTester/OSCPingTester-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9581,6 +10612,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; INFOPLIST_FILE = "OSCPingTester/OSCPingTester-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "Vidvox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -9657,6 +10689,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vvopensource.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = MIDIviaOSC; }; name = Debug; @@ -9680,6 +10713,7 @@ "-framework", AppKit, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.vvopensource.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = MIDIviaOSC; ZERO_LINK = NO; }; @@ -10070,6 +11104,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 1AFE77381D65AC9B003D8E7C /* Build configuration list for PBXNativeTarget "ISF Editor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1AFE77361D65AC9B003D8E7C /* Debug */, + 1AFE77371D65AC9B003D8E7C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "VVOpenSource" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/VVOpenSource.xcodeproj/xcshareddata/xcschemes/QuickLook plugins.xcscheme b/VVOpenSource.xcodeproj/xcshareddata/xcschemes/QuickLook plugins.xcscheme index 21aed391..2ccfb91f 100644 --- a/VVOpenSource.xcodeproj/xcshareddata/xcschemes/QuickLook plugins.xcscheme +++ b/VVOpenSource.xcodeproj/xcshareddata/xcschemes/QuickLook plugins.xcscheme @@ -1,6 +1,6 @@ + + +@interface DBPrefsWindowController : NSWindowController { + NSMutableArray *toolbarIdentifiers; + NSMutableDictionary *toolbarViews; + NSMutableDictionary *toolbarItems; + + BOOL _crossFade; + BOOL _shiftSlowsAnimation; + + NSView *contentSubview; + NSViewAnimation *viewAnimation; + NSString *titlePrefix; +} + +@property (copy) NSString *titlePrefix; + ++ (id)sharedPrefsWindowController; ++ (NSString *)nibName; + +- (void)setupToolbar; +- (void)addView:(NSView *)view label:(NSString *)label; +- (void)addView:(NSView *)view label:(NSString *)label image:(NSImage *)image; + +- (BOOL)crossFade; +- (void)setCrossFade:(BOOL)fade; +- (BOOL)shiftSlowsAnimation; +- (void)setShiftSlowsAnimation:(BOOL)slows; + +- (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate; +- (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView; +- (NSRect)frameForView:(NSView *)view; + + +@end diff --git a/external/MGSFragaria/DBPrefsWindowController.m b/external/MGSFragaria/DBPrefsWindowController.m new file mode 100644 index 00000000..67a5b327 --- /dev/null +++ b/external/MGSFragaria/DBPrefsWindowController.m @@ -0,0 +1,410 @@ +// +// DBPrefsWindowController.m +// + +#import "DBPrefsWindowController.h" + + +static id _sharedPrefsWindowController = nil; + +@interface DBPrefsWindowController() +- (void)toggleActivePreferenceView:(NSToolbarItem *)toolbarItem; +@end + +@implementation DBPrefsWindowController + +@synthesize titlePrefix; + +#pragma mark - +#pragma mark Class Methods + + ++ (id)sharedPrefsWindowController +{ + if (!_sharedPrefsWindowController) { + _sharedPrefsWindowController = [[self alloc] initWithWindowNibName:[self nibName]]; + } + return _sharedPrefsWindowController; +} + + + + ++ (NSString *)nibName + // Subclasses can override this to use a nib with a different name. +{ + return @"Preferences"; +} + + + + +#pragma mark - +#pragma mark Setup & Teardown + + +- (id)initWithWindow:(NSWindow *)window + // -initWithWindow: is the designated initializer for NSWindowController. +{ + self = [super initWithWindow:nil]; + if (self != nil) { + // Set up an array and some dictionaries to keep track + // of the views we'll be displaying. + toolbarIdentifiers = [[NSMutableArray alloc] init]; + toolbarViews = [[NSMutableDictionary alloc] init]; + toolbarItems = [[NSMutableDictionary alloc] init]; + + // Set up an NSViewAnimation to animate the transitions. + viewAnimation = [[NSViewAnimation alloc] init]; + [viewAnimation setAnimationBlockingMode:NSAnimationNonblocking]; + [viewAnimation setAnimationCurve:NSAnimationEaseInOut]; + [viewAnimation setDelegate:self]; + + [self setCrossFade:YES]; + [self setShiftSlowsAnimation:YES]; + } + return self; + + (void)window; // To prevent compiler warnings. +} + + + + +- (void)windowDidLoad +{ + // Create a new window to display the preference views. + // If the developer attached a window to this controller + // in Interface Builder, it gets replaced with this one. + NSWindow *window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,1000,1000) + styleMask:(NSTitledWindowMask | + NSClosableWindowMask | + NSMiniaturizableWindowMask) + backing:NSBackingStoreBuffered + defer:YES] autorelease]; + [self setWindow:window]; + contentSubview = [[[NSView alloc] initWithFrame:[[[self window] contentView] frame]] autorelease]; + [contentSubview setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; + [[[self window] contentView] addSubview:contentSubview]; + [[self window] setShowsToolbarButton:NO]; +} + + + + +- (void) dealloc { + [toolbarIdentifiers release]; + [toolbarViews release]; + [toolbarItems release]; + [viewAnimation release]; + [super dealloc]; +} + + + + +#pragma mark - +#pragma mark Configuration + + +- (void)setupToolbar +{ + // Subclasses must override this method to add items to the + // toolbar by calling -addView:label: or -addView:label:image:. +} + + + + +- (void)addView:(NSView *)view label:(NSString *)label +{ + [self addView:view + label:label + image:[NSImage imageNamed:label]]; +} + + + + +- (void)addView:(NSView *)view label:(NSString *)label image:(NSImage *)image +{ + NSAssert (view != nil, + @"Attempted to add a nil view when calling -addView:label:image:."); + + NSString *identifier = [[label copy] autorelease]; + + [toolbarIdentifiers addObject:identifier]; + [toolbarViews setObject:view forKey:identifier]; + + NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:identifier] autorelease]; + [item setLabel:label]; + [item setImage:image]; + [item setTarget:self]; + [item setAction:@selector(toggleActivePreferenceView:)]; + + [toolbarItems setObject:item forKey:identifier]; +} + + + + +#pragma mark - +#pragma mark Accessor Methods + + +- (BOOL)crossFade +{ + return _crossFade; +} + + + + +- (void)setCrossFade:(BOOL)fade +{ + _crossFade = fade; +} + + + + +- (BOOL)shiftSlowsAnimation +{ + return _shiftSlowsAnimation; +} + + + + +- (void)setShiftSlowsAnimation:(BOOL)slows +{ + _shiftSlowsAnimation = slows; +} + + + + +#pragma mark - +#pragma mark Overriding Methods + + +- (IBAction)showWindow:(id)sender +{ + // This forces the resources in the nib to load. + (void)[self window]; + + // Clear the last setup and get a fresh one. + [toolbarIdentifiers removeAllObjects]; + [toolbarViews removeAllObjects]; + [toolbarItems removeAllObjects]; + [self setupToolbar]; + + NSAssert (([toolbarIdentifiers count] > 0), + @"No items were added to the toolbar in -setupToolbar."); + + if ([[self window] toolbar] == nil) { + NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"DBPreferencesToolbar"]; + [toolbar setAllowsUserCustomization:NO]; + [toolbar setAutosavesConfiguration:NO]; + [toolbar setSizeMode:NSToolbarSizeModeDefault]; + [toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel]; + [toolbar setDelegate:self]; + [[self window] setToolbar:toolbar]; + [toolbar release]; + } + + NSString *firstIdentifier = [toolbarIdentifiers objectAtIndex:0]; + [[[self window] toolbar] setSelectedItemIdentifier:firstIdentifier]; + [self displayViewForIdentifier:firstIdentifier animate:NO]; + + [[self window] center]; + + [super showWindow:sender]; +} + + + + +#pragma mark - +#pragma mark Toolbar + + +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar +{ + return toolbarIdentifiers; + + (void)toolbar; +} + + + + +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar +{ + return toolbarIdentifiers; + + (void)toolbar; +} + + + + +- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar +{ + return toolbarIdentifiers; + (void)toolbar; +} + + + + +- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)identifier willBeInsertedIntoToolbar:(BOOL)willBeInserted +{ + return [toolbarItems objectForKey:identifier]; + (void)toolbar; + (void)willBeInserted; +} + + + + +- (void)toggleActivePreferenceView:(NSToolbarItem *)toolbarItem +{ + [self displayViewForIdentifier:[toolbarItem itemIdentifier] animate:YES]; +} + + + + +- (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate +{ + // Find the view we want to display. + NSView *newView = [toolbarViews objectForKey:identifier]; + + // See if there are any visible views. + NSView *oldView = nil; + if ([[contentSubview subviews] count] > 0) { + // Get a list of all of the views in the window. Usually at this + // point there is just one visible view. But if the last fade + // hasn't finished, we need to get rid of it now before we move on. + NSEnumerator *subviewsEnum = [[contentSubview subviews] reverseObjectEnumerator]; + + // The first one (last one added) is our visible view. + oldView = [subviewsEnum nextObject]; + + // Remove any others. + NSView *reallyOldView = nil; + while ((reallyOldView = [subviewsEnum nextObject]) != nil) { + [reallyOldView removeFromSuperviewWithoutNeedingDisplay]; + } + } + + if (![newView isEqualTo:oldView]) { + NSRect frame = [newView bounds]; + frame.origin.y = NSHeight([contentSubview frame]) - NSHeight([newView bounds]); + [newView setFrame:frame]; + [contentSubview addSubview:newView]; + [[self window] setInitialFirstResponder:newView]; + + if (animate && [self crossFade]) + [self crossFadeView:oldView withView:newView]; + else { + [oldView removeFromSuperviewWithoutNeedingDisplay]; + [newView setHidden:NO]; + [[self window] setFrame:[self frameForView:newView] display:YES animate:animate]; + } + + [[self window] setTitle:[[toolbarItems objectForKey:identifier] label]]; + } +} + + + + +#pragma mark - +#pragma mark Cross-Fading Methods + + +- (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView +{ + [viewAnimation stopAnimation]; + + if ([self shiftSlowsAnimation] && [[[self window] currentEvent] modifierFlags] & NSShiftKeyMask) + [viewAnimation setDuration:1.25]; + else + [viewAnimation setDuration:0.25]; + + NSDictionary *fadeOutDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + oldView, NSViewAnimationTargetKey, + NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, + nil]; + + NSDictionary *fadeInDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + newView, NSViewAnimationTargetKey, + NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, + nil]; + + NSDictionary *resizeDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + [self window], NSViewAnimationTargetKey, + [NSValue valueWithRect:[[self window] frame]], NSViewAnimationStartFrameKey, + [NSValue valueWithRect:[self frameForView:newView]], NSViewAnimationEndFrameKey, + nil]; + + NSArray *animationArray = [NSArray arrayWithObjects: + fadeOutDictionary, + fadeInDictionary, + resizeDictionary, + nil]; + + [viewAnimation setViewAnimations:animationArray]; + [viewAnimation startAnimation]; +} + + + + +- (void)animationDidEnd:(NSAnimation *)animation +{ + NSView *subview; + + // Get a list of all of the views in the window. Hopefully + // at this point there are two. One is visible and one is hidden. + NSEnumerator *subviewsEnum = [[contentSubview subviews] reverseObjectEnumerator]; + + // This is our visible view. Just get past it. + [subviewsEnum nextObject]; + + // Remove everything else. There should be just one, but + // if the user does a lot of fast clicking, we might have + // more than one to remove. + while ((subview = [subviewsEnum nextObject]) != nil) { + [subview removeFromSuperviewWithoutNeedingDisplay]; + } + + // This is a work-around that prevents the first + // toolbar icon from becoming highlighted. + [[self window] makeFirstResponder:nil]; + + (void)animation; +} + + + + +- (NSRect)frameForView:(NSView *)view + // Calculate the window size for the new view. +{ + NSRect windowFrame = [[self window] frame]; + NSRect contentRect = [[self window] contentRectForFrameRect:windowFrame]; + float windowTitleAndToolbarHeight = NSHeight(windowFrame) - NSHeight(contentRect); + + windowFrame.size.height = NSHeight([view frame]) + windowTitleAndToolbarHeight; + windowFrame.size.width = NSWidth([view frame]); + windowFrame.origin.y = NSMaxY([[self window] frame]) - NSHeight(windowFrame); + + return windowFrame; +} + + + +@end diff --git a/external/MGSFragaria/General.png b/external/MGSFragaria/General.png new file mode 100644 index 00000000..f5a8cf37 Binary files /dev/null and b/external/MGSFragaria/General.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Headers b/external/MGSFragaria/MGSFragaria.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/MGSFragaria b/external/MGSFragaria/MGSFragaria.framework/MGSFragaria new file mode 120000 index 00000000..42465650 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/MGSFragaria @@ -0,0 +1 @@ +Versions/Current/MGSFragaria \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Resources b/external/MGSFragaria/MGSFragaria.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSBreakpointDelegate.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSBreakpointDelegate.h new file mode 100644 index 00000000..374544a8 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSBreakpointDelegate.h @@ -0,0 +1,16 @@ +// +// MGSBreakpointDelegate.h +// Fragaria +// +// Created by Viktor Lidholt on 3/5/13. +// +// + +#import + +@protocol MGSBreakpointDelegate + +- (void) toggleBreakpointForFile:(NSString*)file onLine:(int)line; +- (NSSet*) breakpointsForFile:(NSString*)file; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSExtraInterfaceController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSExtraInterfaceController.h new file mode 100644 index 00000000..30d87a0e --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSExtraInterfaceController.h @@ -0,0 +1,65 @@ +/* + + MGSFragaria + Written by Jonathan Mitchell, jonathan@mugginsoft.com + Find the latest version at https://github.com/mugginsoft/Fragaria + +Smultron version 3.6b1, 2009-09-12 +Written by Peter Borg, pgw3@mac.com +Find the latest version at http://smultron.sourceforge.net + +Copyright 2004-2009 Peter Borg + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + +#import + + +@interface MGSExtraInterfaceController : NSObject { + + IBOutlet NSTextField *spacesTextFieldEntabWindow; + IBOutlet NSTextField *spacesTextFieldDetabWindow; + IBOutlet NSTextField *lineTextFieldGoToLineWindow; + IBOutlet NSWindow *entabWindow; + IBOutlet NSWindow *detabWindow; + IBOutlet NSWindow *goToLineWindow; + + IBOutlet NSView *openPanelAccessoryView; + IBOutlet NSPopUpButton *openPanelEncodingsPopUp; + //IBOutlet NSView *printAccessoryView; + + IBOutlet NSWindow *commandResultWindow; + IBOutlet NSTextView *commandResultTextView; + + IBOutlet NSWindow *projectWindow; + IBOutlet NSPanel *regularExpressionsHelpPanel; +} + + +@property (readonly) IBOutlet NSView *openPanelAccessoryView; +@property (readonly) IBOutlet NSPopUpButton *openPanelEncodingsPopUp; +@property (readonly) IBOutlet NSWindow *commandResultWindow; +@property (readonly) IBOutlet NSTextView *commandResultTextView; +@property (readonly) IBOutlet NSWindow *projectWindow; + +- (void)displayEntab; +- (void)displayDetab; +- (IBAction)entabButtonEntabWindowAction:(id)sender; +- (IBAction)detabButtonDetabWindowAction:(id)sender; +- (IBAction)cancelButtonEntabDetabGoToLineWindowsAction:(id)sender; +- (void)displayGoToLine; +- (IBAction)goButtonGoToLineWindowAction:(id)sender; + +- (NSPopUpButton *)openPanelEncodingsPopUp; +- (NSView *)openPanelAccessoryView; +- (NSWindow *)commandResultWindow; +- (NSTextView *)commandResultTextView; +- (void)showCommandResultWindow; +- (void)showRegularExpressionsHelpPanel; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragaria.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragaria.h new file mode 100644 index 00000000..01645e31 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragaria.h @@ -0,0 +1,102 @@ +/* + * MGSFragaria.h + * Fragaria + * + * Created by Jonathan on 30/04/2010. + * Copyright 2010 mugginsoft.com. All rights reserved. + * + */ + +// valid keys for +// - (void)setObject:(id)object forKey:(id)key; +// - (id)objectForKey:(id)key; + +// BOOL +extern NSString * const MGSFOIsSyntaxColoured; +extern NSString * const MGSFOShowLineNumberGutter; +extern NSString * const MGSFOIsEdited; + +// string +extern NSString * const MGSFOSyntaxDefinitionName; +extern NSString * const MGSFODocumentName; + +// integer +extern NSString * const MGSFOGutterWidth; + +// NSView * +extern NSString * const ro_MGSFOTextView; // readonly +extern NSString * const ro_MGSFOScrollView; // readonly +extern NSString * const ro_MGSFOGutterScrollView; // readonly + +// NSObject +extern NSString * const MGSFODelegate; +extern NSString * const MGSFOBreakpointDelegate; +extern NSString * const MGSFOAutoCompleteDelegate; +extern NSString * const MGSFOSyntaxColouringDelegate; +extern NSString * const ro_MGSFOLineNumbers; // readonly +extern NSString * const ro_MGSFOSyntaxColouring; // readonly + +@class MGSTextMenuController; +@class MGSExtraInterfaceController; + +#import "MGSFragariaPreferences.h" +#import "MGSBreakpointDelegate.h" +#import "SMLSyntaxError.h" +#import "SMLSyntaxColouringDelegate.h" +#import "SMLSyntaxDefinition.h" + +@protocol MGSFragariaTextViewDelegate +@optional +- (void)mgsTextDidPaste:(NSNotification *)note; +@end + +@interface MGSFragaria : NSObject +{ + @private + MGSExtraInterfaceController *extraInterfaceController; + id docSpec; + NSSet* objectGetterKeys; + NSSet* objectSetterKeys; +} + +@property (nonatomic, readonly, assign) MGSExtraInterfaceController *extraInterfaceController; +@property (nonatomic, retain) id docSpec; + +// class methods ++ (id)currentInstance; ++ (void)setCurrentInstance:(MGSFragaria *)anInstance; ++ (void)initializeFramework; ++ (id)createDocSpec; ++ (void)docSpec:(id)docSpec setString:(NSString *)string; ++ (void)docSpec:(id)docSpec setString:(NSString *)string options:(NSDictionary *)options; ++ (void)docSpec:(id)docSpec setAttributedString:(NSAttributedString *)string; ++ (void)docSpec:(id)docSpec setAttributedString:(NSAttributedString *)string options:(NSDictionary *)options; ++ (NSString *)stringForDocSpec:(id)docSpec; ++ (NSAttributedString *)attributedStringForDocSpec:(id)docSpec; ++ (NSAttributedString *)attributedStringWithTemporaryAttributesAppliedForDocSpec:(id)docSpec; + +// instance methods +- (id)initWithObject:(id)object; +- (void)setObject:(id)object forKey:(id)key; +- (id)objectForKey:(id)key; +- (void)embedInView:(NSView *)view; +- (void)setString:(NSString *)aString; +- (void)setString:(NSString *)aString options:(NSDictionary *)options; +- (void)setAttributedString:(NSAttributedString *)aString; +- (void)setAttributedString:(NSAttributedString *)aString options:(NSDictionary *)options; +- (NSAttributedString *)attributedString; +- (NSAttributedString *)attributedStringWithTemporaryAttributesApplied; +- (NSString *)string; +- (NSTextView *)textView; +- (MGSTextMenuController *)textMenuController; +- (void)setSyntaxColoured:(BOOL)value; +- (BOOL)isSyntaxColoured; +- (void)setShowsLineNumbers:(BOOL)value; +- (BOOL)showsLineNumbers; +- (void)reloadString; +- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)text options:(NSDictionary *)options; +- (void)setSyntaxErrors:(NSArray *)errors; +- (NSArray *)syntaxErrors; ++ (NSImage *)imageNamed:(NSString *)name; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaFontsAndColoursPrefsViewController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaFontsAndColoursPrefsViewController.h new file mode 100644 index 00000000..da591631 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaFontsAndColoursPrefsViewController.h @@ -0,0 +1,16 @@ +// +// MGSFragariaFontsAndColoursPrefsViewController.h +// Fragaria +// +// Created by Jonathan on 14/09/2012. +// +// + +#import +#import "MGSFragariaPrefsViewController.h" + +@interface MGSFragariaFontsAndColoursPrefsViewController : MGSFragariaPrefsViewController + +- (IBAction)setFontAction:(id)sender; +- (void)changeFont:(id)sender; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPreferences.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPreferences.h new file mode 100644 index 00000000..3f0acafe --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPreferences.h @@ -0,0 +1,100 @@ +/* + * MGSFragariaPreferences.h + * Fragaria + * + * Created by Jonathan on 06/05/2010. + * Copyright 2010 mugginsoft.com. All rights reserved. + * + */ + +// Fragraria preference keys by type + +// color data +// [NSArchiver archivedDataWithRootObject:[NSColor whiteColor]] +extern NSString * const MGSFragariaPrefsCommandsColourWell; +extern NSString * const MGSFragariaPrefsCommentsColourWell; +extern NSString * const MGSFragariaPrefsInstructionsColourWell; +extern NSString * const MGSFragariaPrefsKeywordsColourWell; +extern NSString * const MGSFragariaPrefsAutocompleteColourWell; +extern NSString * const MGSFragariaPrefsVariablesColourWell; +extern NSString * const MGSFragariaPrefsStringsColourWell; +extern NSString * const MGSFragariaPrefsAttributesColourWell; +extern NSString * const MGSFragariaPrefsBackgroundColourWell; +extern NSString * const MGSFragariaPrefsTextColourWell; +extern NSString * const MGSFragariaPrefsGutterTextColourWell; +extern NSString * const MGSFragariaPrefsInvisibleCharactersColourWell; +extern NSString * const MGSFragariaPrefsHighlightLineColourWell; +extern NSString * const MGSFragariaPrefsNumbersColourWell; + +// bool +extern NSString * const MGSFragariaPrefsColourNumbers; +extern NSString * const MGSFragariaPrefsColourCommands; +extern NSString * const MGSFragariaPrefsColourComments; +extern NSString * const MGSFragariaPrefsColourInstructions; +extern NSString * const MGSFragariaPrefsColourKeywords; +extern NSString * const MGSFragariaPrefsColourAutocomplete; +extern NSString * const MGSFragariaPrefsColourVariables; +extern NSString * const MGSFragariaPrefsColourStrings; +extern NSString * const MGSFragariaPrefsColourAttributes; +extern NSString * const MGSFragariaPrefsShowFullPathInWindowTitle; +extern NSString * const MGSFragariaPrefsShowLineNumberGutter; +extern NSString * const MGSFragariaPrefsSyntaxColourNewDocuments; +extern NSString * const MGSFragariaPrefsLineWrapNewDocuments; +extern NSString * const MGSFragariaPrefsIndentNewLinesAutomatically; +extern NSString * const MGSFragariaPrefsOnlyColourTillTheEndOfLine; +extern NSString * const MGSFragariaPrefsShowMatchingBraces; +extern NSString * const MGSFragariaPrefsShowInvisibleCharacters; +extern NSString * const MGSFragariaPrefsIndentWithSpaces; +extern NSString * const MGSFragariaPrefsColourMultiLineStrings; +extern NSString * const MGSFragariaPrefsAutocompleteSuggestAutomatically; +extern NSString * const MGSFragariaPrefsAutocompleteIncludeStandardWords; +extern NSString * const MGSFragariaPrefsAutoSpellCheck; +extern NSString * const MGSFragariaPrefsAutoGrammarCheck; +extern NSString * const MGSFragariaPrefsSmartInsertDelete; +extern NSString * const MGSFragariaPrefsAutomaticLinkDetection; +extern NSString * const MGSFragariaPrefsAutomaticQuoteSubstitution; +extern NSString * const MGSFragariaPrefsUseTabStops; +extern NSString * const MGSFragariaPrefsHighlightCurrentLine; +extern NSString * const MGSFragariaPrefsAutomaticallyIndentBraces; +extern NSString * const MGSFragariaPrefsAutoInsertAClosingParenthesis; +extern NSString * const MGSFragariaPrefsAutoInsertAClosingBrace; +extern NSString * const MGSFragariaPrefsShowPageGuide; + +// integer +extern NSString * const MGSFragariaPrefsGutterWidth; +extern NSString * const MGSFragariaPrefsTabWidth; +extern NSString * const MGSFragariaPrefsIndentWidth; +extern NSString * const MGSFragariaPrefsShowPageGuideAtColumn; +extern NSString * const MGSFragariaPrefsSpacesPerTabEntabDetab; + +// float +extern NSString * const MGSFragariaPrefsAutocompleteAfterDelay; + +// font data +// [NSArchiver archivedDataWithRootObject:[NSFont fontWithName:@"Menlo" size:11]] +extern NSString * const MGSFragariaPrefsTextFont; + +// string +extern NSString * const MGSFragariaPrefsSyntaxColouringPopUpString; + +#import "MGSFragariaPrefsViewController.h" +#import "MGSFragariaFontsAndColoursPrefsViewController.h" +#import "MGSFragariaTextEditingPrefsViewController.h" + +@interface MGSFragariaPreferences : NSObject { + + MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; + MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; +} ++ (void)initializeValues; ++ (MGSFragariaPreferences *)sharedInstance; +- (void)changeFont:(id)sender; +- (void)revertToStandardSettings:(id)sender; + +@property (readonly) MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; +@property (readonly) MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; + +@end + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPrefsViewController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPrefsViewController.h new file mode 100644 index 00000000..6bd1ae8d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaPrefsViewController.h @@ -0,0 +1,13 @@ +// +// MGSFragariaPrefsViewController.h +// Fragaria +// +// Created by Jonathan on 22/10/2012. +// +// + +#import + +@interface MGSFragariaPrefsViewController : NSViewController +- (BOOL)commitEditingAndDiscard:(BOOL)discard; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaTextEditingPrefsViewController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaTextEditingPrefsViewController.h new file mode 100644 index 00000000..01fec49c --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSFragariaTextEditingPrefsViewController.h @@ -0,0 +1,17 @@ +// +// MGSFragariaTextEditingPrefsViewController.h +// Fragaria +// +// Created by Jonathan on 14/09/2012. +// +// + +#import +#import "MGSFragariaPrefsViewController.h" + +@interface MGSFragariaTextEditingPrefsViewController : MGSFragariaPrefsViewController { + NSImage *toolbarImage; +} + +- (IBAction)changeGutterWidth:(id)sender; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSSyntaxController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSSyntaxController.h new file mode 100644 index 00000000..54026a4d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSSyntaxController.h @@ -0,0 +1,28 @@ +// +// MGSSyntaxController.h +// Fragaria +// +// Created by Jonathan on 01/05/2010. +// Copyright 2010 mugginsoft.com. All rights reserved. +// + +#import + + +@interface MGSSyntaxController : NSObject { + + NSArray *syntaxDefinitionNames; + NSMutableDictionary *syntaxDefinitions; +} + ++ (instancetype)sharedInstance; ++ (NSString *)standardSyntaxDefinitionName; +- (NSArray *)syntaxDefinitionNames; +- (void)insertSyntaxDefinitions; +- (NSDictionary *)syntaxDictionaryWithName:(NSString *)name; +- (NSDictionary *)syntaxDefinitionWithExtension:(NSString *)extension; +- (NSString *)syntaxDefinitionNameWithExtension:(NSString *)extension; + +@property (retain, nonatomic,readonly) NSArray *syntaxDefinitionNames; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSTextMenuController.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSTextMenuController.h new file mode 100644 index 00000000..4961e3fb --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/MGSTextMenuController.h @@ -0,0 +1,60 @@ +/* + + MGSFragaria + Written by Jonathan Mitchell, jonathan@mugginsoft.com + Find the latest version at https://github.com/mugginsoft/Fragaria + +Smultron version 3.6b1, 2009-09-12 +Written by Peter Borg, pgw3@mac.com +Find the latest version at http://smultron.sourceforge.net + +Copyright 2004-2009 Peter Borg + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + +#import + +@interface MGSTextMenuController : NSObject +{ + //NSArray *availableEncodingsArray; + + IBOutlet NSMenu *textEncodingMenu; + IBOutlet NSMenu *reloadTextWithEncodingMenu; + IBOutlet NSMenu *syntaxDefinitionMenu; +} + ++ (MGSTextMenuController *)sharedInstance; + +- (void)buildEncodingsMenus; +- (void)buildSyntaxDefinitionsMenu; + +- (void)changeEncodingAction:(id)sender; + +- (IBAction)removeNeedlessWhitespaceAction:(id)sender; +- (IBAction)detabAction:(id)sender; +- (IBAction)entabAction:(id)sender; +- (void)performEntab; +- (void)performDetab; +- (IBAction)shiftLeftAction:(id)sender; +- (IBAction)shiftRightAction:(id)sender; +- (IBAction)toLowercaseAction:(id)sender; +- (IBAction)toUppercaseAction:(id)sender; +- (IBAction)capitaliseAction:(id)sender; +- (IBAction)goToLineAction:(id)sender; +- (void)performGoToLine:(NSInteger)lineToGoTo; +- (IBAction)closeTagAction:(id)sender; +- (IBAction)toggleBreakpointAction:(id)sender; +- (IBAction)commentOrUncommentAction:(id)sender; +- (IBAction)emptyDummyAction:(id)sender; +- (IBAction)removeLineEndingsAction:(id)sender; +- (IBAction)changeLineEndingsAction:(id)sender; +- (IBAction)interchangeAdjacentCharactersAction:(id)sender; +- (IBAction)prepareForXMLAction:(id)sender; + +- (IBAction)changeSyntaxDefinitionAction:(id)sender; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLAutoCompleteDelegate.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLAutoCompleteDelegate.h new file mode 100644 index 00000000..0bb6ea34 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLAutoCompleteDelegate.h @@ -0,0 +1,15 @@ +// +// SMLAutoCompleteDelegate.h +// Fragaria +// +// Created by Viktor Lidholt on 4/12/13. +// +// + +#import + +@protocol SMLAutoCompleteDelegate + +- (NSArray*) completions; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxColouringDelegate.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxColouringDelegate.h new file mode 100644 index 00000000..d1921c7e --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxColouringDelegate.h @@ -0,0 +1,116 @@ +// +// SMLSyntaxColouringDelegate.h +// Fragaria +// +// Created by Jonathan on 14/04/2013. +// +// + +#import + +// syntax colouring information dictionary keys +extern NSString *SMLSyntaxGroup; +extern NSString *SMLSyntaxGroupID; +extern NSString *SMLSyntaxWillColour; +extern NSString *SMLSyntaxAttributes; +extern NSString *SMLSyntaxInfo; + +// syntax colouring group names +extern NSString *SMLSyntaxGroupNumber; +extern NSString *SMLSyntaxGroupCommand; +extern NSString *SMLSyntaxGroupInstruction; +extern NSString *SMLSyntaxGroupKeyword; +extern NSString *SMLSyntaxGroupAutoComplete; +extern NSString *SMLSyntaxGroupVariable; +extern NSString *SMLSyntaxGroupFirstString; +extern NSString *SMLSyntaxGroupSecondString; +extern NSString *SMLSyntaxGroupAttribute; +extern NSString *SMLSyntaxGroupSingleLineComment; +extern NSString *SMLSyntaxGroupMultiLineComment; +extern NSString *SMLSyntaxGroupSecondStringPass2; + +// syntax colouring group IDs +enum { + kSMLSyntaxGroupNumber = 0, + kSMLSyntaxGroupCommand = 1, + kSMLSyntaxGroupInstruction = 2, + kSMLSyntaxGroupKeyword = 3, + kSMLSyntaxGroupAutoComplete = 4, + kSMLSyntaxGroupVariable = 5, + kSMLSyntaxGroupSecondString = 6, + kSMLSyntaxGroupFirstString = 7, + kSMLSyntaxGroupAttribute = 8, + kSMLSyntaxGroupSingleLineComment = 9, + kSMLSyntaxGroupMultiLineComment = 10, + kSMLSyntaxGroupSecondStringPass2 = 11 +}; +typedef NSInteger SMLSyntaxGroupInteger; + +@protocol SMLSyntaxColouringDelegate + +/* + + Use these methods to partially customise or overridde the syntax colouring. + + Arguments used in the delegate methods + ====================================== + + document: Fragaria document spec + block: block to colour string. the arguments are a colour info dictionary and the range to be coloured + string: document string. This is supplied as a convenience. The string can also be retrieved from the document. + range: range of string to colour. + info: an information dictionary + + Info dictionary keys + ====================== + + SMLSyntaxGroup: NSString describing the group being coloured. + SMLSyntaxGroupID: NSNumber identyfying the group being coloured. + SMLSyntaxWillColour: NSNumber containing a BOOL indicating whether the caller will colour the string. + SMLSyntaxAttributes: NSDictionary of NSAttributed string attributes used to colour the string. + SMLSyntaxInfo: NSDictionary containing Fragaria syntax definition. + + Syntax Info dictionary keys + =========================== + + For key values see SMLSyntaxDefinition.h + + Delegate calling + ================ + + The delegate will receive messages in the following sequence: + + // query delegate if should colour this document + doColouring = fragariaDocument:shouldColourWithBlock:string:range:info + if !doColouring quit colouring + + // send *ColourGroupWithBlock methods for each group defined by SMLSyntaxGroupInteger + foreach group + + // query delegate if should colour this group + doColouring = fragariaDocument:shouldColourGroupWithBlock:string:range:info + + if doColouring + + colour the group + + // inform delegate group was coloured + fragariaDocument:didColourGroupWithBlock:string:range:info + + end if + end + + // inform delegate document was coloured + fragariaDocument:willDidWithBlock:string:range:info + + Colouring the string + ==================== + + Each delegate method includes a block that can can be called with a dictionary of attributes and a range to affect colouring. + + */ +- (BOOL)fragariaDocument:(id)document shouldColourWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; +- (BOOL)fragariaDocument:(id)document shouldColourGroupWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; +- (void)fragariaDocument:(id)document didColourGroupWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; +- (void)fragariaDocument:(id)document didColourWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxDefinition.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxDefinition.h new file mode 100644 index 00000000..2245cf20 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxDefinition.h @@ -0,0 +1,36 @@ +// +// SMLSyntaxDefinition.h +// Fragaria +// +// Created by Jonathan on 16/04/2013. +// +// + +#import + +// syntax definition dictionary keys +extern NSString *SMLSyntaxDefinitionAllowSyntaxColouring ; +extern NSString *SMLSyntaxDefinitionKeywords; +extern NSString *SMLSyntaxDefinitionAutocompleteWords; +extern NSString *SMLSyntaxDefinitionRecolourKeywordIfAlreadyColoured ; +extern NSString *SMLSyntaxDefinitionKeywordsCaseSensitive ; +extern NSString *SMLSyntaxDefinitionBeginCommand; +extern NSString *SMLSyntaxDefinitionEndCommand; +extern NSString *SMLSyntaxDefinitionBeginInstruction; +extern NSString *SMLSyntaxDefinitionEndInstruction ; +extern NSString *SMLSyntaxDefinitionBeginVariable; +extern NSString *SMLSyntaxDefinitionEndVariable; +extern NSString *SMLSyntaxDefinitionFirstString; +extern NSString *SMLSyntaxDefinitionSecondString; +extern NSString *SMLSyntaxDefinitionFirstSingleLineComment; +extern NSString *SMLSyntaxDefinitionSecondSingleLineComment; +extern NSString *SMLSyntaxDefinitionBeginFirstMultiLineComment; +extern NSString *SMLSyntaxDefinitionEndFirstMultiLineComment ; +extern NSString *SMLSyntaxDefinitionBeginSecondMultiLineComment; +extern NSString *SMLSyntaxDefinitionEndSecondMultiLineComment; +extern NSString *SMLSyntaxDefinitionFunctionDefinition; +extern NSString *SMLSyntaxDefinitionRemoveFromFunction ; +extern NSString *SMLSyntaxDefinitionExcludeFromKeywordStartCharacterSet; +extern NSString *SMLSyntaxDefinitionExcludeFromKeywordEndCharacterSet; +extern NSString *SMLSyntaxDefinitionIncludeInKeywordStartCharacterSet; +extern NSString *SMLSyntaxDefinitionIncludeInKeywordEndCharacterSet; diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxError.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxError.h new file mode 100644 index 00000000..81ad22d7 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLSyntaxError.h @@ -0,0 +1,26 @@ +// +// SMLSyntaxError.h +// Fragaria +// +// Created by Viktor Lidholt on 4/9/13. +// +// + +#import + +@interface SMLSyntaxError : NSObject +{ + NSString* description; + int line; + int character; + NSString* code; + int length; +} + +@property (nonatomic,copy) NSString* description; +@property (nonatomic,assign) int line; +@property (nonatomic,assign) int character; +@property (nonatomic,copy) NSString* code; +@property (nonatomic,assign) int length; + +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLTextView.h b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLTextView.h new file mode 100644 index 00000000..06217f9e --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Headers/SMLTextView.h @@ -0,0 +1,60 @@ +/* + + MGSFragaria + Written by Jonathan Mitchell, jonathan@mugginsoft.com + Find the latest version at https://github.com/mugginsoft/Fragaria + +Smultron version 3.6b1, 2009-09-12 +Written by Peter Borg, pgw3@mac.com +Find the latest version at http://smultron.sourceforge.net + +Copyright 2004-2009 Peter Borg + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + +#import + +@class MGSFragaria; + +@interface SMLTextView : NSTextView { + @private + NSInteger lineHeight; + NSPoint startPoint; + NSPoint startOrigin; + CGFloat pageGuideX; + NSColor *pageGuideColour; + + BOOL showPageGuide; + + NSCursor *colouredIBeamCursor; + + MGSFragaria *fragaria; + BOOL lineWrap; +} + +@property (retain) NSCursor *colouredIBeamCursor; +@property (retain) MGSFragaria *fragaria; +@property (nonatomic) BOOL lineWrap; + +- (void)setDefaults; + +- (void)setTextDefaults; + +- (NSInteger)lineHeight; + +- (void)setTabWidth; + +- (void)setPageGuideValues; +- (void)updateIBeamCursor; + +- (void)setString:(NSString *)text options:(NSDictionary *)options; +- (void)setAttributedString:(NSAttributedString *)text; +- (void)setAttributedString:(NSAttributedString *)text options:(NSDictionary *)options; +- (void)updateLineWrap; +- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)text options:(NSDictionary *)options; +@end diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/MGSFragaria b/external/MGSFragaria/MGSFragaria.framework/Versions/A/MGSFragaria new file mode 100755 index 00000000..14feafba Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/MGSFragaria differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/ErrorPopoverView.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/ErrorPopoverView.nib new file mode 100644 index 00000000..20792f49 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/ErrorPopoverView.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Info.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..b4f06de2 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,38 @@ + + + + + BuildMachineOSBuild + 14C109 + CFBundleDevelopmentRegion + English + CFBundleExecutable + MGSFragaria + CFBundleIdentifier + com.mugginsoft.MGSFragaria + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6A2008a + DTPlatformVersion + GM + DTSDKBuild + 14A382 + DTSDKName + macosx10.10 + DTXcode + 0611 + DTXcodeBuild + 6A2008a + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE-2.0.txt b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE.html b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE.html new file mode 100644 index 00000000..b905ddf4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/LICENSE.html @@ -0,0 +1,51 @@ + + + + +ICU License - ICU 1.8.1 and later + + + +

ICU License - ICU 1.8.1 and later

+ +

COPYRIGHT AND PERMISSION NOTICE

+ +

+Copyright (c) 1995-2006 International Business Machines Corporation and others +

+

+All rights reserved. +

+

+Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies +of the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. +

+

+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, +OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. +

+

+Except as contained in this notice, the name of a copyright holder shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization of the copyright holder. +

+ +
+

+All trademarks and registered trademarks mentioned herein are the property of their respective owners. +

+ + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesFontsAndColours.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesFontsAndColours.nib new file mode 100644 index 00000000..8efa1481 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesFontsAndColours.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesTextEditing.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesTextEditing.nib new file mode 100644 index 00000000..2be8b0fc Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/MGSPreferencesTextEditing.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/README.md b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/README.md new file mode 100644 index 00000000..1b97d432 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/README.md @@ -0,0 +1,304 @@ +#What is it? +Fragaria is an OS X Cocoa syntax colouring NSTextView implemented within a framework named MGSFragaria. It supports a wide range of programming languages and includes preference panel support. + +The MGSFragaria framework now properly supports both traditional reference counting memory management and garbage collection. + +#Where can I see it in use + +You can see Fragaria used in the following projects and products: + +* [Appium Recorder](http://appium.io) : Appium is an open source, cross-platform test automation tool for native and hybrid mobile apps. ([repo](https://github.com/appium/appium)). + +* [cocoa-rest-client](https://github.com/mmattozzi/cocoa-rest-client) A native OS X cocoa application for testing HTTP endpoints. + +* [CocosBuilder](http://www.cocosbuilder.com/). CocosBuilder is a free tool (released under MIT-licence) for rapidly developing games and apps. ([repo](https://github.com/cocos2d/CocosBuilder)) + +* [Cocoduino](https://github.com/fabiankr/Cocoduino) is an IDE for the Arduino platform written in native Cocoa. + +* [KosmicTask](http://www.mugginsoft.com) is a multi (20+) language scripting environment for OS X that features script editing, network sharing, remote execution, and file processing. + +* [nib2objc](https://github.com/akosma/nib2objc) This utility converts NIB files (or XIB ones) into Objective-C code + +If you use Fragaria in your app and want it added to the list just let us know or edit the README. + +#Features + +Most features are accessed via the framework preferences. + +* Configurable syntax colouring +* Configurable font type, size and colour. +* Invisible character display +* Line numbering +* Brace matching and auto insertion +* Page guide +* Simple word auto complete +* Tab and indent control +* Line wrapping + + +##How do I use it? + +The best way to learn how to use the framework is to look at the sample apps. + +* __Fragaria__ : a simple editor window that features language selection, a wired up text menu and a preferences panel. + +* __Fragaria GC__ : a GC version of the above. + +* __Fragaria Doc__ : a simple NSDocument based editor. + +##Show me code + +A Fragaria view is embedded in a content view. + + +```objective-c +#import "MGSFragaria/MGSFragaria.h" + +// we need a container view to host Fragaria in +NSView *containerView = nil; // loaded from nib or otherwise created + +// create our instance +MGSFragaria *fragaria = [[MGSFragaria alloc] init]; + +// we want to be the delegate +[fragaria setObject:self forKey:MGSFODelegate]; + +// Objective-C is the place to be +[self setSyntaxDefinition:@"Objective-C"]; + +// embed in our container - exception thrown if containerView is nil +[fragaria embedInView:containerView]; + +// set initial text +[fragaria setString:@"// We don't need the future."]; +``` + + +The initial appearance of a Fragaria view is determined by the framework preferences controller. The MGSFragaria framework supplies two preference view controllers whose views can be embedded in your preference panel. + + +```objective-c +MGSFragariaTextEditingPrefsViewController * textEditingPrefsViewController = [MGSFragariaPreferences sharedInstance].textEditingPrefsViewController; + +MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController = [MGSFragariaPreferences sharedInstance].fontsAndColoursPrefsViewController; +``` + + +##Setting preferences + +Preference strings are defined in MGSFragaria/MGSFragariaPreferences.h. Each preference name is prefixed with Fragaria for easy identification within the application preferences file. + +```objective-c +// default to line wrap off +[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:NO] forKey:MGSFragariaPrefsLineWrapNewDocuments]; +``` + + +All preferences are observed and instances of Fragaria views update immediately to reflect the new preference. + + +##Breakpoint Highlighting + +Use the `MGSFOBreakpointDelegate` key to define a breakpoint delegate that responds to conforms to `MGSBreakpointDelegate` + +```objective-c +[fragaria setObject:self forKey:MGSFODelegate]; +``` + +The breakpoint delegate returns an `NSSet` of breakpoint line numbers. The implementation of this feature is at an early stage. Feel free to improve it. + +## Syntax Error Highlighting + +To add clickable syntax error highlights define an `NSArray` of SMLSyntaxErrors. + +```objective-c +// define a syntax error +SMLSyntaxError *syntaxError = [[SMLSyntaxError new] autorelease]; +syntaxError.description = @"Syntax errors can be defined"; +syntaxError.line = 1; +syntaxError.character = 1; +syntaxError.length = 10; + +fragaria.syntaxErrors = @[syntaxError]; +``` + +The implementation of this feature is at an early stage. Feel free to improve it. + +##Custom colouring + +The `SMLSyntaxColouringDelegate` protocol allows a delegate to influence the syntax colouring for each of a number of syntactical groups such as numbers, attributes, comments or keywords. + +Pseudo code for the protocol method flow looks something like: + + // query delegate if should colour this document + doColouring = fragariaDocument:shouldColourWithBlock:string:range:info + if !doColouring quit colouring + + // send *ColourGroupWithBlock methods for each group defined by SMLSyntaxGroupInteger + foreach group + + // query delegate if should colour this group + doColouring = fragariaDocument:shouldColourGroupWithBlock:string:range:info + + if doColouring + + colour the group + + // inform delegate group was coloured + fragariaDocument:didColourGroupWithBlock:string:range:info + + end if + end + + // inform delegate document was coloured + fragariaDocument:willDidWithBlock:string:range:info + +The delegate can completely override the colouring for a given group or provide additional colouring support (you will have to provide you own scanning logic). Document level delegate messages provide an opportunity to provide colouring for custom group configurations. + +For more details see [SMLSyntaxColouringDelegate.h](SMLSyntaxColouringDelegate.h) and the example code in [FragariaAppDelegate.m](FragariaAppDelegate.m). + + +##Supported languages +Fragaria supports syntax colouring for a wide range of programming languages and configuration file formats: + +###A +actionscript, +actionscript3, +active4d, +ada, +ampl, +apache (config), +applescript, +asm-mips, +asm-x86, +asp-js, +asp-vb, +aspdotnet-cs, +aspdotnet-vb, +awk + +###B +batch (shell) + +###C +C, +cobol, +coffeescript, +coldfusion, +cpp, +csharp, +csound, +css + +###D +D, +dylan + +###E +eiffel, erl, eztpl + +###F +F-script, +fortran, +freefem + +###G +gedcom, +gnuassembler, +graphviz + +###H +haskell, +header, +html + +###I +idl + +###J +java, +javafx, +javascript, +jsp + +###L +latex, +lilypond, +lisp, +logtalk, +lsl, +lua + +###M +matlab, +mel, +metapost, +metaslang, +mysql, +nemerle, + +###N +nrnhoc + + +###O +objectivec, +objectivecaml, +ox + +###P +pascal, +pdf, +perl, +php, +plist, +postscript, +prolog, +python + +###R +r, +rhtml, +ruby + +###S +scala, +sgml, +shell, +sml, +sql, +stata, +supercollider + +###T +tcltk, +torquescript + +###U +udo + +###V +vb, +verilog, +vhdl + +###X +xml + +##Defining a new language syntax + +To define a new syntax definition: + +1. Generate a plist that defines the language syntax. The plist structure is simple and browsing the [existing definitions](Syntax%20Definitions) should provide some enlightenment. The plist keys are defined in ` SMLSyntaxDefinition.h`. For much deeper insight see `SMLSyntaxColouring - recolourRange:`. + +2. Insert a reference to the new plist into [SyntaxDefinitions.plist](SyntaxDefinitions.plist) + +#How can I contribute +Take a look at the [TODO](TODO.md) list. + +##Where did it come from? +Fragaria started out as the vital pulp of Smultron, now called Fraise. If you want to add additional features to Fragaria then looking at the [Fraise](https://github.com/jfmoy/Fraise) and other forked sources is a good place to start. Fraise is a GC only app so you will need to consider memory management issues when importing code into Fragaria. + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLCommandResult.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLCommandResult.nib new file mode 100644 index 00000000..de695738 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLCommandResult.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLDetab.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLDetab.nib new file mode 100644 index 00000000..f1d79a24 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLDetab.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLEntab.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLEntab.nib new file mode 100644 index 00000000..5433f947 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLEntab.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLGoToLine.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLGoToLine.nib new file mode 100644 index 00000000..c58d8d4b Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLGoToLine.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLOpenPanelAccessoryView.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLOpenPanelAccessoryView.nib new file mode 100644 index 00000000..bbac3bd9 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLOpenPanelAccessoryView.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLRegularExpressionHelp.nib b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLRegularExpressionHelp.nib new file mode 100644 index 00000000..f0a7e3f2 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SMLRegularExpressionHelp.nib differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript.plist new file mode 100644 index 00000000..d21ec60d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript.plist @@ -0,0 +1,2095 @@ + + + + + autocompleteWords + + Accessibility + isActive + updateProperties + SendEvent + arguments + callee + caller + length + Application + acceptConnection + clearSharedObjects + clearStreams + clients + disconnect + name + onAppStart + onAppStop + onConnect + onDisconnect + onStatus + registerClass + registerProxy + rejectConnection + server + Array + concat + join + length + pop + push + qsort + reverse + shift + slice + sort + sortOn + splice + toString + unshift + ASBroadcaster + addListener + broadcastMessage + initialize + removeListener + Boolean + toString + valueOf + Button + enabled + getDepth + menu + onDragOut + onDragOver + onKeyUp + onKillFocus + onPress + onRelease + onReleaseOutside + onRollOut + onRollOver + onSetFocus + tabEnabled + tabIndex + trackAsMenu + useHandCursor + Camera + activityLevel + bandwidth + currentFps + fps + get + height + index + keyFrameInterval + loopback + motionLevel + motionTimeOut + muted + name + names + onActivity + onStatus + quality + setKeyFrameInterval + setLoopback + setMode + setMotionLevel + setQuality + width + Client + agent + call + getBandwidthLimit + ip + readAccess + referrer + __resolve + setBandwidthLimit + writeAccess + Color + getRGB + getTransform + setRGB + setTransform + ContextMenu + copy + hideBuiltInItems + builtInItems + customItems + onSelect + Cookie + getCookie + setCookie + ContextMenuItem + copy + caption + enabled + separatorBefore + visible + onSelect + CustomActions + apply + get + install + isPropertyEnumerable + isPrototypeOf + list + proto + registerClass + toLocaleString + uninstall + DataGlue + bindFormatStrings + bindFormatFunction + Date + getDate + getDay + getFullYear + getHours + getMilliseconds + getMinutes + getMonth + getSeconds + getTime + getTimezoneOffset + getUTCDate + getUTCDay + getUTCFullYear + getUTCHours + getUTCMilliseconds + getUTCMinutes + getUTCMonth + getUTCSeconds + getYear + setDate + setFullYear + setHours + setMilliseconds + setMinutes + setMonth + setSeconds + setTime + setUTCDate + setUTCFullYear + setUTCHours + setUTCMilliseconds + setUTCMinutes + setUTCMonth + setUTCSeconds + setYear + toString + UTC + Error + message + toString + name + FAdvancedMessageBox + addIcon + clearTimeout + getActivateHandler + getActiveState + getButtons + getButtonWidth + getCloseHandler + getEnabled + getHeight + getIcon + getMessage + getScrollbarState + getSize + getTimeoutHandler + getTimeoutState + getTitle + getTitlebarHeight + getWidth + registerSkinElement + setActivateHandler + setActiveState + setButtons + setButtonWidth + setCloseHandler + setEnabled + setIcon + setMessage + setScrollbarState + setSize + setStyleProperty + setTimeout + setTimeoutHandler + setTitle + setTitlebarHeight + FBarChart + addItem + addItemAt + getChartTitle + getEnabled + getItemAt + getLabelSource + getLength + getValueSource + getXAxisTitle + getYAxisTitle + removeAll + removeItemAt + setChartEventHandler + setChartTitle + setDataProvider + setEnabled + setLabelSource + setSize + setValueSource + setXAxisTitle + setYAxisTitle + sortItemsBy + FCalendar + getDayOfWeekNames + getDisplayedMonth + getDisplayRange + getEnabled + getFirstDayOfWeek + getMonthNames + getSelectedItem + getSelectedItems + getSelectionRequired + getSelectionType + getShowAsDisabled + registerSkinElement + setChangeHandler + setDateFilter + setDayOfWeekNames + setDisplayedMonth + setDisplayRange + setEnabled + setFirstDayOfWeek + setMonthNames + setSelectedItem + setSelectedItems + setSelectionRequired + setSelectionType + setShowAsDisabled + setSize + setStyleProperty + FCheckbox + getEnabled + getLabel + getValue + registerSkinElement + setChangeHandler + setEnabled + setLabel + setLabelPlacement + setSize + setStyleProperty + setValue + FComboBox + addItem + addItemAt + getEnabled + getItemAt + getLength + getRowCount + getScrollPosition + getSelectedIndex + getSelectedItem + getValue + registerSkinElement + removeAll + removeItemAt + replaceItemAt + setChangeHandler + setDataProvider + setEditable + setEnabled + setItemSymbol + setRowCount + setSelectedIndex + setSize + setStyleProperty + setValue + sortItemsBy + FDataGrid + addColumn + addColumnAt + addItem + addItemAt + alternateRowColors + getColumnAt + getColumnCount + getColumnIndex + getEnabled + getItemAt + getLength + getOriginalCellData + getRowCount + getScrollPosition + getSelectedCell + getSelectedIndex + getSelectedIndices + getSelectedItem + getSelectedItems + removeAllColumns + removeAllItems + removeColumnAt + removeItemAt + replaceItemAt + setCellData + setChangeHandler + setColumns + setDataProvider + setEditable + setEditHandler + setEnabled + setResizableColumns + setRowCount + setRowHeight + setScrollPosition + setSelectable + setSelectedCell + setSelectedIndex + setSelectedIndices + setSelectMultiple + setSize + setSortableColumns + setVScroll + showBorder + showColumnHeaders + showGridLines + sort + sortItemsBy + spaceColumnsEqually + FDraggablePane + closePane + disableCloseBox + disableShader + enableCloseBox + enableShader + getEnabled + getHasCloseBox + getHasShader + getPaneMaximums + getPaneMinimums + getPaneTitle + getResizable + getScrollContent + getScrolling + getScrollPosition + getTitlebarHeight + loadScrollContent + refreshScrollContent + registerSkinElement + restorePane + setCloseHandler + setContentSize + setDragContent + setEnabled + setHasCloseBox + setHasShader + setPaneMaximumSize + setPaneMinimumSize + setPaneSize + setPaneTitle + setResizable + setScrollContent + setScrolling + setScrollPosition + setStyleProperty + setTitleBarHeight + shadePane + FIconButton + getBackground + getEnabled + getIcon + getLabel + getToggle + getValue + registerSkinElement + removeBackground + setBackground + setChangeHandler + setEnabled + setIcon + setLabel + setLabelPlacement + setSize + setStyleProperty + setToggle + setValue + FGridColumn + getHeader + getWidth + setCellSymbol + setEditable + setHeader + setHeaderSymbol + setResizable + setSortable + setSortFunction + setWidth + FLineChart + addItem + addItemAt + getChartTitle + getEnabled + getHighlights + getItemAt + getLabelSource + getLength + getLineColor + getLineWeight + getValueSource + getXAxisTitle + getYAxisTitle + removeAll + removeItemAt + setChartEventHandler + setChartTitle + setDataProvider + setEnabled + setHighlights + setLabelSource + setLineColor + setLineWeight + setSize + setValueSource + setXAxisTitle + setYAxisTitle + sortItemsBy + FListBox + addItem + addItemAt + getEnabled + getItemAt + getLength + getRowCount + getScrollPosition + getSelectedIndex + getSelectedIndices + getSelectedItem + getSelectedItems + getSelectMultiple + getValue + registerSkinElement + removeAll + removeItemAt + replaceItemAt + setAutoHideScrollBar + setChangeHandler + setDataProvider + setEnabled + setItemSymbol + setRowCount + setScrollPosition + setSelectedIndex + setSelectedIndices + setSelectMultiple + setSize + setStyleProperty + setWidth + sortItemsBy + FLoadingBox + addAnimation + clearTimeout + getActivateHandler + getActiveState + getActiveStateHandler + getAnimation + getButtons + getButtonWidth + getCloseHandler + getEnabled + getHeight + getMessage + getSize + getTimeoutHandler + getTimeoutState + getWidth + registerSkinElement + restartAnimation + setActivateHandler + setActiveState + setActiveStateHandler + setAnimation + setButtons + setButtonWidth + setCloseHandler + setEnabled + setMessage + setSize + setStyleProperty + setTimeout + setTimeoutHandler + setTitle + setTitlebarHeight + startAnimation + stopAnimation + FMessageBox + getButtons + getButtonWidth + getEnabled + getIcon + getMessage + getTitle + getTitleBarHeight + registerSkinElement + setActiveHandler + setButtons + setButtonWidth + setCloseHandler + setEnabled + setIcon + setMessage + setSize + setStyleProperty + setTitle + setTitleBarHeight + FPieChart + addItem + addItemAt + getChartTitle + getEnabled + getItemAt + getLabelSource + getLength + getValueSource + removeAll + removeItemAt + setChartEventHandler + setChartTitle + setDataProvider + setEnabled + setLabelSource + setSize + setValueSource + sortItemsBy + FProgressBar + getLoadTarget + getMaximum + getMinimum + getPercentComplete + getValue + registerSkinElement + setChangeHandler + setDisplayGraphics + setDisplayText + setLoadTarget + setMaximum + setMinimum + setPercentComplete + setProgress + setSize + setStyleProperty + setValue + FPromptBox + addIcon + getActivateHandler + getActiveState + getButtons + getButtonWidth + getCloseHandler + getEnabled + getHeight + getIcon + getMessage + getSize + getTitle + getTitlebarHeight + getUserInput + getWidth + registerSkinElement + setActivateHandler + setActiveState + setButtons + setButtonWidth + setCloseHandler + setEnabled + setIcon + setInputProperty + setMessage + setSize + setStyleProperty + setTitle + setTitlebarHeight + setUserInput + updateInputProperties + FPushButton + getEnabled + getLabel + registerSkinElement + setClickHandler + setEnabled + setLabel + setSize + setStyleProperty + FRadioButton + getData + getEnabled + getLabel + getState + getValue + registerSkinElement + setChangeHandler + setData + setEnabled + setGroupName + setLabel + setLabelPlacement + setSize + setState + setStyleProperty + setValue + FScrollBar + getEnabled + getScrollPosition + registerSkinElement + setChangeHandler + setEnabled + setHorizontal + setLargeScroll + setScrollContent + setScrollPosition + setScrollProperties + setScrollTarget + setSize + setSmallScroll + setStyleProperty + FScrollPane + getPaneHeight + getPaneWidth + getScrollContent + getScrollPosition + loadScrollContent + refreshPane + registerSkinElement + setDragContent + setHScroll + setScrollContent + setScrollPosition + setSize + setStyleProperty + setVScroll + FSplitView + getContent + getOrientation + getSplitterBarPosition + setContent + setOrientation + setSize + setSplitterBarPosition + FStyleFormat + addListener + applyChanges + arrow + background + backgroundDisabled + check + darkshadow + face + foregroundDisabled + highlight + highlight2D + highlight3D + radioDot + removeListener + scrollTrack + selection + selectionDisabled + selectionUnfocused + shadow + textAlign + textBold + textColor + textDisabled + textFont + textIndent + textItalic + textLeftMargin + textRightMargin + textSelected + textSize + textUnderline + FTicker + addItem + addItemAt + addListener + getDataAllFormat + getDataAllHeight + getDataAllProperty + getDataAllWidth + getDataItemFormat + getDataItemProperty + getDataItemText + getDataMapping + getDataMappings + getDirection + getFrameColor + getFrameWidth + getHeaderFormat + getHeaderHeight + getHeaderLocation + getHeaderProperty + getHeaderText + getHeaderWidth + getHeight + getHighlightColor + getItemAt + getItemID + getLength + getOrientation + getScrollLocation + getScrollSpeed + getSmoothness + getSpacing + getStopOnFocus + getWidth + getX + getY + removeAll + removeItemAt + replaceItemAt + setClickHandler + setDataAllFormat + setDataAllHeight + setDataAllProperty + setDataAllWidth + setDataItemFormat + setDataItemProperty + setDataItemText + setDataMapping + setDataMappings + setDataProvider + setDefaultMappings + setDirection + setFrameColor + setFrameWidth + setHeaderFormat + setHeaderHeight + setHeaderLocation + setHeaderProperty + setHeaderText + setHeaderWidth + setHighlightColor + setOrientation + setScrollLocation + setScrollSpeed + setSize + setSmoothness + setSpacing + setStopOnFocus + setX + setY + sortItemsBy + FTooltip + getActiveState + getAutoHeight + getDelay + getDisplayClip + getDisplayMode + getFadeInLength + getFadeOutLength + getMultilineMode + getSize + getTip + getTipOffset + getTipTarget + getUseFade + getUseHandCursor + getUseShadow + registerSkinElement + setActiveState + setAutoHeight + setDelay + setDisplayClip + setDisplayMode + setFadeInLength + setFadeOutLength + setMultilineMode + setSize + setStyleProperty + setTip + setTipOffset + setTipTarget + setUseFade + setUseHandCursor + setUseShadow + FTooltipLite + getActiveState + getDelay + getTip + getUseHandCursor + registerSkinElement + setActiveState + setDelay + setTip + setUseHandCursor + FTree + addNode + addNodeAt + getAutoHideScrollBar + getDefaultNodeIconSymbolName + getDrawConnectors + getEnabled + getExpanderSymbolName + getExandNodeTrigger + getFirstVisibleNode + getNodeAt + getRootNode + getRowCount + getSelectedNode + getSelectedNodes + getSelectStyle + getTreeLength + getWidth + refresh + registerSkinElement + removeAll + removeNode + removeNodeAt + setAutoHideScrollBar + setChangeHandler + setDataProvider + setDefaultNodeIconSymbolName + setDrawConnectors + setEnabled + setExpanderSymbolName + setExpandNodeTrigger + setFirstVisibleNode + setNodeExpansionHandler + setRootNode + setRowCount + setSelectedNode + setSelectedNodes + setSelectStyle + setSize + setStyleProperty + setWidth + FTreeNode + addNode + addNodeAt + getChildNodes + getData + getIconSymbolName + getLabel + getNumChildren + getParentNode + isBranch + isOpen + removeNodeAt + removeNodesAt + setChildNodes + setData + setDataProvider + setIconSymbolName + setIsBranch + setIsOpen + setLabel + setNodeProperties + Function + apply + call + prototype + Key + addListener + BACKSPACE + broadcastMessage + CAPSLOCK + CONTROL + DELETEKEY + DOWN + END + ENTER + ESCAPE + getAscii + getCode + HOME + INSERT + isDown + isToggled + LEFT + onKeyDown + onKeyUp + PGDN + PGUP + removeListener + RIGHT + SHIFT + SPACE + TAB + UP + LoadVars + addRequestHeader + contentType + decode + getBytesLoaded + getBytesTotal + load + loaded + onData + onLoad + send + sendAndLoad + toString + LocalConnection + allowDomain + close + connect + domain + send + Math + abs + acos + asin + atan + atan2 + ceil + cos + E + exp + floor + log + LOG2E + LOG10E + LN2 + LN10 + max + min + PI + pow + random + round + sin + sqrt + SQRT1_2 + SQRT2 + tan + Microphone + activityLevel + gain + get + index + muted + name + names + onActivity + onStatus + rate + setGain + setRate + setSilenceLevel + setUseEchoSuppression + silenceLevel + silenceTimeOut + useEchoSuppression + Mouse + addListener + broadcastMessage + hide + onMouseDown + onMouseMove + onMouseUp + onMouseWheel + removeListener + show + MovieClip + attachAudio + attachMovie + attachVideo + beginFill + beginGradientFill + clear + createEmptyMovieClip + createTextField + curveTo + duplicateMovieClip + enabled + endFill + focusEnabled + getBounds + getBytesLoaded + getBytesTotal + getDepth + getInstanceAtDepth + getNextHighestDepth + getSWFVersion + getURL + globalToLocal + gotoAndPlay + gotoAndStop + hitArea + hitTest + lineStyle + lineTo + loadMovie + loadVariables + localToGlobal + meth + moveTo + nextFrame + onData + onDragOut + onDragOver + onEnterFrame + onKeyDown + onKeyUp + onKillFocus + onLoad + onMouseDown + onMouseMove + onMouseUp + onPress + onRelease + onRelaseOutside + onRollOut + onRollOver + onSetFocus + onUnload + play + prevFrame + removeMovieClip + setMask + startDrag + stop + stopDrag + swapDepths + tabChildren + tabEnabled + tabIndex + trackAsMenu + unloadMovie + useHandCursor + NetConnection + addheader + call + close + connect + getDebugConfig + getDebugID + getService + onStatus + setCredentials + setDebugID + trace + NetDebug + trace + NetDebugConfig + getDebug + setDebug + NetServices + createGatewayConnection + setDefaultGatewayURL + Netstream + attachAudio + attachVideo + bufferLength + bufferTime + bytesLoaded + bytesTotal + currentFps + close + onStatus + pause + play + publish + receiveAudio + receiveVideo + seek + send + setBufferTime + time + Number + MAX_VALUE + MIN_VALUE + NaN + NEGATIVE_INFINITY + POSITIVE_INFINITY + toString + valueOf + domain + close + send + connect + constructor + Object + addProperty + hasOwnProperty + isPropertyEnumerable + isPrototypeOf + registerClass + toLocaleString + toString + unwatch + valueOf + watch + PrintJob + start + addPage + send + Recordset + getColumnNames + addView + getLength + getItemAt + getItemID + addItemAt + addItem + replaceItemAt + setField + removeItemAt + removeAll + sortItemsBy + isLocal + isFullyPopulated + getNumberAvailable + setDeliveryMode + filter + sort + Selection + addListener + broadcastMessage + getBeginIndex + getCaretIndex + getEndIndex + getFocus + onSetFocus + removeListener + setFocus + setSelection + ServiceObject + functionName + SharedObject + clear + close + connect + data + deleteAll + flush + get + getDiskUsage + getLocal + getProperty + getPropertyName + getRemote + getSize + handlerName + lock + name + onStatus + onSync + purge + resyncDepth + send + setFps + setProperty + size + unlock + version + Sound + attachSound + duration + getBytesLoaded + getBytesTotal + getDuration + getPan + getPosition + getTransform + getVolume + id3 + album + artist + comment + genre + songname + track + year + loadSound + onID3 + onLoad + onSoundComplete + position + setDuration + setPan + setPosition + setTransform + setVolume + start + stop + Stage + addListener + align + broadcastMessage + height + onResize + removeListener + scaleMode + showMenu + width + Stream + bufferTime + clear + get + length + name + onStatus + play + record + send + setBufferTime + String + charAt + charCodeAt + concat + fromCharCode + indexOf + lastIndexOf + length + slice + split + substr + substring + toLowerCase + toUpperCase + System + capabilities + avHardwareDisable + exactSettings + hasAudioEncoder + hasAccesibility + hasAudio + hasEmbeddedVideo + hasMP3 + hasPrinting + hasScreenBroadcast + hasScreenPlayback + hasStreamingVideo + hasStreamingAudio + hasVideoEncoder + input + isDebugger + language + localFileReadDisable + manufacturer + os + onStatus + pixelAspectRatio + playerType + screenColor + screenDPI + screenResolution + x + y + serverString + setClipboard + useCodepage + version + Product + Download + isInstalled + isRunning + Launch + name + security + allowDomain + allowInsecureDomain + ShowSettings + showSettings + TextField + addListener + autoSize + background + backgroundColor + border + borderColor + bottomScroll + condenseWhite + embedFonts + getDepth + getFontList + getNewTextFormat + getTextFormat + hscroll + html + htmlText + length + maxChars + maxhscroll + maxscroll + mouseWheelEnabled + multiline + onChanged + onKillFocus + onScroller + onSetFocus + password + removeListener + removeTextField + replaceSel + restrict + scroll + selectable + setNewTextFormat + setTextFormat + styleSheet + StyleSheet + getStyle + getStyleNames + load + onLoad + parseCSS + setStyle + tabEnabled + tabIndex + text + textColor + textHeight + textWidth + type + variable + wordWrap + TextFormat + align + blockIndent + bold + bullet + color + font + getTextExtent + indent + italic + leading + leftMargin + rightMargin + size + tabStops + target + underline + url + TextSnapshot + findText + getCount + getSelected + getSelectedText + getText + hitTestTextNearPos + setSelectColor + setSelected + Video + attachVideo + clear + deblocking + height + smoothing + width + Void + XML + addRequestHeader + appendChild + attributes + childNodes + cloneNode + contentType + createElement + createTextNode + docTypeDecl + firstChild + getBytesLoaded + getBytesTotal + haschildNodes + ignoreWhite + init + insertBefore + lastChild + load + loaded + nextSibling + nodeName + nodeType + nodeValue + onData + onLoad + parentNode + parseXML + previousSibling + removeNode + send + sendAndLoad + status + toString + xmlDecl + XMLNode + XMLSocket + close + connect + onClose + onConnect + onData + onXML + send + _accProps + _alpha + _changed + _currentframe + _droptarget + _flash + _focusrect + _framesloaded + _global + _height + _highquality + _level + _listeners + _lockroot + _name + _parent + __proto__ + _quality + __resolve + _root + _rotation + _soundbuftime + _target + _totalframes + _url + _visible + _width + _x + _xmouse + _xscale + _y + _ymouse + _yscale + add + and + arguments + ASClamp + ASClamp2 + ASConstructor + asfunction + ASInstanceOf + ASNative + ASNew + ASSetNative + ASSetPropFlags + break + call + callee + case + catch + chr + clearInterval + class + continue + constructor + dashBoardSave + data + default + delete + do + dragOver + dragOut + duplicateMovieClip + dynamic + else + enterFrame + eq + escape + eval + evaluate + extends + false + finally + for + fscommand + function + ge + get + getProperty + getTimer + getURL + getVersion + globalStyleFormat + gotoAndPlay + gotoAndStop + gt + if + ifFrameLoaded + implements + import + in + infinity + instanceof + int + interface + isFinite + isNaN + keyDown + keyPress + keyUp + label + le + length + load + loadMovie + loadMovieNum + loadVariables + loadVariablesNum + lt + maxscroll + mbchr + mblength + mbord + mbsubstring + method + MMSave + MMExecute + mouseDown + mouseMove + mouseUp + NaN + ne + new + newline + nextFrame + nextScene + not + null + on + onClipEvent + or + ord + parseFloat + parseInt + play + press + prevFrame + prevScene + print + printAsBitmap + printAsBitmapNum + printNum + private + prototype + public + release + releaseOutside + rollOver + rollOut + random + removeMovieClip + return + scroll + set + setInterval + setProperty + startDrag + static + stop + stopAllSounds + stopDrag + substring + super + switch + targetPath + tellTarget + this + throw + toggleHighQuality + trace + true + try + typeof + undefined + unescape + unload + unloadMovie + unloadMovieNum + updateAfterEvent + var + void + while + with + flash.accessibility + flash.display + flash.errors + flash.events + flash.external + flash.filters + flash.geom + flash.media + flash.net + flash.printing + flash.profiler + flash.system + flash.text + flash.ui + flash.utils + flash.xml + text + start + stop + import + public + private + internal + protected + override + final + dynamic + native + static + const + var + extends + interface + implements + namespace + NaN + Infinity + undefined + eval + parseInt + parseFloat + isNaN + isFinite + decodeURI + decodeURIComponent + encodeURI + encodeURIComponent + Object + Function + Array + String + Boolean + Number + Date + Error + RegExp + XML + int + uint + void + * + default + mouseX + mouseY + scaleX + scaleY + continue + break + return + throw + try + catch + finally + null + typeof + instanceof + delete + accessibility + graphics + display + errors + events + external + filters + geom + media + net + printing + profiler + system + ui + utils + AccessibilityProperties + ActionScriptVersion + AVM1Movie + Bitmap + BitmapData + BitmapDataChannel + BlendMode + CapsStyle + DisplayObject + DisplayObjectContainer + FrameLabel + GradientType + InteractiveObject + InterpolationMethod + JointStyle + LineScaleMode + Loader + LoaderInfo + MorphShape + MovieClip + PixelSnapping + Scene + Shape + SimpleButton + SpreadMethod + Sprite + StageAlign + StageQuality + StageScaleMode + SWFVersion + align + focus + frameRate + height + mouseChildren + numChildren + quality + scaleMode + showDefaultContextMenu + stageFocusRect + stageHeight + stageWidth + tabChildren + textSnapshot + width + addEventListener + dispatchEvent + hasEventListener + invalidate + isFocusInaccessible + setChildIndex + swapChildrenAt + willTrigger + mouseLeave + resize + EOFError + IllegalOperationError + InvalidSWFError + IOError + MemoryError + ScriptTimeoutError + StackOverflowError + beginBitmapFill + beginFill + beginGradientFill + clear + curveTo + drawCircle + drawEllipse + drawRect + drawRoundRect + endFill + lineGradientStyle + lineStyle + lineTo + moveTo + currentFrame + currentLabel + currentLabels + currentScene + enabled + framesLoaded + totalFrames + trackAsMenu + gotoAndPlay + gotoAndStop + nextFrame + nextScene + play + prevFrame + prevScene + stop + buttonMode + dropTarget + hitArea + soundTransform + useHandCursor + startDrag + stopDrag + ActivityEvent + AsyncErrorEvent + ContextMenuEvent + DataEvent + ErrorEvent + Event + EventDispatcher + EventPhase + FocusEvent + HTTPStatusEvent + IMEEvent + IOErrorEvent + KeyboardEvent + MouseEvent + NetStatusEvent + ProgressEvent + SecurityErrorEvent + StatusEvent + SyncEvent + TextEvent + TimerEvent + ExternalInterface + BevelFilter + BitmapFilter + BitmapFilterQuality + BitmapFilterType + BlurFilter + ColorMatrixFilter + ConvolutionFilter + DisplacementMapFilter + DisplacementMapFilterMode + DropShadowFilter + GlowFilter + GradientBevelFilter + GradientGlowFilter + ColorTransform + Matrix + Point + Rectangle + Transform + length + x + y + add + clone + distance + equals + interpolate + normalize + offset + polar + subtract + toString + bottom + bottomRight + left + right + size + top + topLeft + contains + containsPoint + containsRect + inflate + inflatePoint + intersection + intersects + isEmpty + offsetPoint + setEmpty + union + registerClassAlias + getClassByAlias + navigateToURL + sendToURL + showRedrawRegions + fscommand + ContextMenu + ContextMenuBuiltInItems + ContextMenuItem + Keyboard + KeyLocation + Mouse + hide + show + clearInterval + setInterval + clearTimeout + setTimeout + describeType + getDefinitionByName + getQualifiedClassName + getQualifiedSuperclassName + getTimer + Timer + Dictionary + ArgumentError + arguments + escape + isXMLName + unescape + XMLList + DefinitionError + EvalError + QName + RangeError + ReferenceError + SecurityError + SyntaxError + TypeError + URIError + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + // + firstString + " + functionDefinition + ^\s*(private)?(public)?\s*function\s+.*\(.*\)\n?\s*{ + keywords + + add + and + break + continue + delete + do + else + eq + for + function + ge + gt + if + ifFrameLoaded + in + le + lt + ne + new + not + on + onClipEvent + or + return + this + tellTarget + typeof + var + void + while + with + Array + Boolean + Color + Date + Function + Key + MovieClip + Math + Mouse + Number + Object + Selection + Sound + String + XML + XMLNode + XMLSocket + NaN + Infinity + false + null + true + undefined + Boolean + call + Date + escape + eval + fscommand + getProperty + getTimer + getURL + getVersion + gotoAndPlay + gotoAndStop + #include + int + isFinite + isNaN + loadMovie + loadMovieNum + loadVariables + loadVariablesNum + maxscroll + newline + nextFrame + nextScene + Number + parseFloat + parseInt + play + prevFrame + prevScene + print + printAsBitmap + printAsBitmapNum + printNum + random + removeMovieClip + scroll + setProperty + startDrag + stop + stopAllSounds + stopDrag + String + targetPath + tellTarget + toggleHighQuality + trace + unescape + unloadMovie + unloadMovieNum + updateAfterEvent + addChild + addChildAt + removeChild + removeChildAt + import + function + class + package + if + else + do + while + for + with + switch + case + default + continue + break + each + super + this + null + true + false + new + in + is + as + typeof + instanceof + delete + stage + fscommand + clearInterval + setInterval + ...rest + clearTimeout + setTimeout + Math + trace + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + function + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript3.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript3.plist new file mode 100644 index 00000000..3ef00884 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/actionscript3.plist @@ -0,0 +1,1465 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + functionDefinition + ^\s*function\s+.*\n?\s*{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + + + + Array + Boolean + Date + decodeURI + decodeURIComponent + encodeURI + encodeURIComponent + escape + int + isFinite + isNaN + isXMLName + Number + Object + parseFloat + parseInt + String + trace + uint + unescape + XML + XMLList + + + + as + delete + in + is + new + typeof + void + + + + Infinity + -Infinity + NaN + undefined + + + + break + case + catch + continue + default + do + each + else + finally + for + if + in + label + return + super + switch + throw + try + while + with + + + + dynamic + final + internal + native + override + private + protected + public + static + + + + ... + class + const + extends + function + get + implements + interface + namespace + package + set + var + + + + default xml namespace + import + include + use namespace + + + + AS3 + flash_proxy + object_proxy + + + + false + null + this + true + + + + * + void + Null + + + + flash + accessibility + display + errors + events + external + filters + geom + media + net + printing + profiler + system + text + ui + utils + xml + + + + clearInterval + clearTimeout + describeType + escapeMultiByte + fscommand + getClassByAlias + getDefinitionByName + getQualifiedClassName + getQualifiedSuperclassName + getTimer + navigateToURL + registerClassAlias + sendToURL + setInterval + setTimeout + showRedrawRegions + unescapeMultiByte + + + + Accessibility + AccessibilityProperties + ActionScriptVersion + ActivityEvent + AntiAliasType + ApplicationDomain + ArgumentError + arguments + Array + AsyncErrorEvent + AVM1Movie + BevelFilter + Bitmap + BitmapData + BitmapDataChannel + BitmapFilter + BitmapFilterQuality + BitmapFilterType + BlendMode + BlurFilter + Boolean + ByteArray + Camera + Capabilities + CapsStyle + Class + ColorMatrixFilter + ColorTransform + ContextMenu + ContextMenuBuiltInItems + ContextMenuEvent + ContextMenuItem + ConvolutionFilter + CSMSettings + DataEvent + Date + DefinitionError + Dictionary + DisplacementMapFilter + DisplacementMapFilterMode + DisplayObject + DisplayObjectContainer + DropShadowFilter + Endian + EOFError + Error + ErrorEvent + EvalError + Event + EventDispatcher + EventPhase + ExternalInterface + FileFilter + FileReference + FileReferenceList + FocusEvent + Font + FontStyle + FontType + FrameLabel + FullScreenEvent + Function + GlowFilter + GradientBevelFilter + GradientGlowFilter + GradientType + Graphics + GridFitType + HTTPStatusEvent + IBitmapDrawable + ID3Info + IDataInput + IDataOutput + IDynamicPropertyOutput + IDynamicPropertyWriter + IEventDispatcher + IExternalizable + IllegalOperationError + IME + IMEConversionMode + IMEEvent + int + InteractiveObject + InterpolationMethod + InvalidSWFError + IOError + IOErrorEvent + JointStyle + Keyboard + KeyboardEvent + KeyLocation + LabelButton + LineScaleMode + Loader + LoaderContext + LoaderInfo + LocalConnection + Math + Matrix + MemoryError + Microphone + MorphShape + Mouse + MouseEvent + MovieClip + Namespace + NetConnection + NetStatusEvent + NetStream + Number + Object + ObjectEncoding + PixelSnapping + Point + PrintJob + PrintJobOptions + PrintJobOrientation + ProgressBarDirection + ProgressEvent + Proxy + QName + RadioButtonGroup + RangeError + Rectangle + ReferenceError + RegExp + Responder + Scene + ScriptTimeoutError + ScrollBarDirection + Security + SecurityDomain + SecurityError + SecurityErrorEvent + SecurityPanel + Shape + SharedObject + SharedObjectFlushStatus + SimpleButton + SliderDirection + Socket + Sound + SoundChannel + SoundLoaderContext + SoundMixer + SpreadMethod + Sprite + StackOverflowError + Stage + StageAlign + StageDisplayState + StageQuality + StageScaleMode + StaticText + StatusEvent + String + StyleSheet + SWFVersion + SyncEvent + SyntaxError + System + TextColorType + TextDisplayMode + TextEvent + TextField + TextFieldAutoSize + TextFieldType + TextFormat + TextFormatAlign + TextLineMetrics + TextRenderer + TextSnapshot + Timer + TimerEvent + Transform + TypeError + uint + URIError + URLLoader + URLLoaderDataFormat + URLRequest + URLRequestHeader + URLRequestMethod + URLStream + URLVariables + VerifyError + Video + XML + XMLDocument + XMLList + XMLNode + XMLNodeType + XMLSocket + + + + abs + acos + add + addCallback + addChild + addChildAt + addEventListener + addHeader + addNamespace + addPage + allowDomain + allowInsecureDomain + appendChild + appendText + apply + applyFilter + areInaccessibleObjectsUnderPoint + areSoundsInaccessible + asin + atan + atan2 + attachAudio + attachCamera + attachNetStream + attribute + attributes + beginBitmapFill + beginFill + beginGradientFill + browse + call + callProperty + cancel + ceil + charAt + charCodeAt + child + childIndex + children + clear + clone + cloneNode + close + colorTransform + comments + compare + compress + computeSpectrum + concat + connect + contains + containsPoint + containsRect + copy + copyChannel + copyPixels + cos + createBox + createElement + createGradientBox + createTextNode + curveTo + decode + defaultSettings + deleteProperty + deltaTransformPoint + descendants + dispatchEvent + dispose + distance + doConversion + download + draw + drawCircle + drawEllipse + drawRect + drawRoundRect + elements + endFill + enumerateFonts + equals + every + exec + exp + fillRect + filter + findText + floodFill + floor + flush + forEach + formatToString + fromCharCode + generateFilterRect + getBounds + getCamera + getCharBoundaries + getCharIndexAtPoint + getChildAt + getChildByName + getChildIndex + getColorBoundsRect + getDate + getDay + getDefinition + getDescendants + getFirstCharInParagraph + getFullYear + getHours + getImageReference + getLineIndexAtPoint + getLineIndexOfChar + getLineLength + getLineMetrics + getLineOffset + getLineText + getLocal + getMicrophone + getMilliseconds + getMinutes + getMonth + getNamespaceForPrefix + getObjectsUnderPoint + getParagraphLength + getPixel + getPixel32 + getPixels + getPrefixForNamespace + getProperty + getRect + getRemote + getSeconds + getSelected + getSelectedText + getStackTrace + getStyle + getText + getTextFormat + getTextRunInfo + getTime + getTimezoneOffset + getUTCDate + getUTCDay + getUTCFullYear + getUTCHours + getUTCMilliseconds + getUTCMinutes + getUTCMonth + getUTCSeconds + globalToLocal + gotoAndPlay + gotoAndStop + hasChildNodes + hasComplexContent + hasDefinition + hasEventListener + hasGlyphs + hasOwnProperty + hasProperty + hasSimpleContent + hide + hideBuiltInItems + hitTest + hitTestObject + hitTestPoint + hitTestTextNearPos + identity + indexOf + inflate + inflatePoint + inScopeNamespaces + insertBefore + insertChildAfter + insertChildBefore + interpolate + intersection + intersects + invalidate + invert + isAccessible + isAttribute + isDefaultPrevented + isEmpty + isFocusInaccessible + isPrototypeOf + join + lastIndexOf + length + lineGradientStyle + lineStyle + lineTo + load + loadBytes + loadPolicyFile + localeCompare + localName + localToGlobal + lock + log + map + match + max + merge + min + moveTo + name + namespace + namespaceDeclarations + nextFrame + nextName + nextNameIndex + nextScene + nextValue + nodeKind + noise + normalize + offset + offset + offsetPoint + paletteMap + parent + parse + parseCSS + parseXML + pause + perlinNoise + pixelDissolve + play + polar + pop + pow + prependChild + preventDefault + prevFrame + prevScene + processingInstructions + propertyIsEnumerable + publish + push + random + readBoolean + readByte + readBytes + readDouble + readExternal + readFloat + readInt + readMultiByte + readObject + readShort + readUnsignedByte + readUnsignedInt + readUnsignedShort + readUTF + readUTFBytes + receiveAudio + receiveVideo + registerFont + removeChild + removeChildAt + removeEventListener + removeNamespace + removeNode + replace + replaceSelectedText + replaceText + reset + resume + reverse + rotate + round + scale + scroll + search + seek + send + setAdvancedAntiAliasingTable + setChildIndex + setChildren + setClipboard + setCompositionString + setDate + setDirty + setEmpty + setFullYear + setHours + setKeyFrameInterval + setLocalName + setLoopback + setLoopBack + setMilliseconds + setMinutes + setMode + setMonth + setMotionLevel + setName + setNamespace + setPixel + setPixel32 + setPixels + setProperty + setPropertyIsEnumerable + setQuality + setSeconds + setSelectColor + setSelected + setSelection + setSettings + setSilenceLevel + setStyle + setTextFormat + setTime + settings + setUseEchoSuppression + setUTCDate + setUTCFullYear + setUTCHours + setUTCMilliseconds + setUTCMinutes + setUTCMonth + setUTCSeconds + shift + show + showSettings + sin + slice + some + sort + sortOn + splice + split + sqrt + start + startDrag + stop + stopAll + stopDrag + stopImmediatePropagation + stopPropagation + substr + substring + subtract + swapChildren + swapChildrenAt + tan + test + text + threshold + toDateString + toExponential + toFixed + togglePause + toLocaleDateString + toLocaleLowerCase + toLocaleString + toLocaleTimeString + toLocaleUpperCase + toLowerCase + toPrecision + toString + toTimeString + toUpperCase + toUTCString + toXMLString + transform + transformPoint + translate + uncompress + union + unload + unlock + unshift + updateAfterEvent + updateProperties + upload + UTC + valueOf + willTrigger + writeBoolean + writeByte + writeBytes + writeDouble + writeDynamicProperties + writeDynamicProperty + writeExternal + writeFloat + writeInt + writeMultiByte + writeObject + writeShort + writeUnsignedInt + writeUTF + writeUTFBytes + + + + a + accessibilityProperties + actionScriptVersion + activating + active + activityLevel + album + align + alpha + alphaMultiplier + alphaOffset + alphas + altKey + alwaysShowSelection + angle + antiAliasType + applicationDomain + artist + ascent + attributes + autoSize + available + avHardwareDisable + b + background + backgroundColor + bandwidth + bias + bitmapData + blendMode + blockIndent + blueMultiplier + blueOffset + blurX + blurY + bold + border + borderColor + bottom + bottomRight + bottomScrollV + bubbles + bufferLength + bufferTime + builtInItems + bullet + buttonDown + buttonMode + bytesAvailable + bytesLoaded + bytesTotal + c + cacheAsBitmap + callee + cancelable + capsLock + caption + caretIndex + changeList + charCode + charCount + checkPolicyFile + childAllowsParent + childNodes + clamp + client + code + color + colors + colorTransform + comment + componentX + componentY + concatenatedColorTransform + concatenatedMatrix + condenseWhite + connected + connectedProxyType + constructor + content + contentLoaderInfo + contentType + contextMenu + contextMenuOwner + conversionMode + creationDate + creator + ctrlKey + currentCount + currentDomain + currentFPS + currentFrame + currentLabel + currentLabels + currentScene + currentTarget + customItems + d + data + dataFormat + date + dateUTC + day + dayUTC + deblocking + defaultObjectEncoding + defaultTextFormat + delay + delta + descent + description + displayAsPassword + displayMode + displayState + distance + divisor + docTypeDecl + domain + dotall + doubleClickEnabled + downState + dropTarget + dynamicPropertyWriter + embedFonts + enabled + endian + error + errorID + eventPhase + exactSettings + extended + extension + fileList + filters + firstChild + focus + focusRect + font + fontName + fontSize + fontStyle + fontType + forceSimple + forwardAndBack + fps + frame + frameRate + framesLoaded + fullScreen + fullYear + fullYearUTC + gain + genre + global + graphics + greenMultiplier + greenOffset + gridFitType + hasAccessibility + hasAudio + hasAudioEncoder + hasEmbeddedVideo + hasIME + hasMP3 + hasPrinting + hasScreenBroadcast + hasScreenPlayback + hasStreamingAudio + hasStreamingVideo + hasTLS + hasVideoEncoder + height + hideObject + highlightAlpha + highlightColor + hitArea + hitTestState + hours + hoursUTC + htmlText + id3 + idMap + ignoreCase + ignoreComments + ignoreProcessingInstructions + ignoreWhite + ignoreWhitespace + ime + indent + index + info + inner + insideCutoff + isBuffering + isDebugger + italic + kerning + keyCode + keyFrameInterval + keyLocation + knockout + labels + language + lastChild + lastIndex + leading + left + leftMargin + leftPeak + leftToLeft + leftToRight + length + letterSpacing + level + liveDelay + loader + loaderInfo + loaderURL + localFileReadDisable + localName + localX + localY + loop + loopback + macType + manufacturer + mapBitmap + mapPoint + mask + matrix + matrixX + matrixY + maxChars + maxLevel + maxScrollH + maxScrollV + message + method + milliseconds + millisecondsUTC + minutes + minutesUTC + mode + modificationDate + month + monthUTC + motionLevel + motionTimeout + mouseChildren + mouseEnabled + mouseTarget + mouseWheelEnabled + mouseX + mouseY + multiline + muted + name + names + namespaceURI + nextSibling + noAutoLabeling + nodeName + nodeType + nodeValue + numChildren + numFrames + numLines + numLock + objectEncoding + objectID + opaqueBackground + orientation + os + outsideCutoff + overState + pageHeight + pageWidth + pan + paperHeight + paperWidth + parameters + parent + parentAllowsChild + parentDomain + parentNode + pixelAspectRatio + pixelBounds + pixelSnapping + playerType + position + prefix + preserveAlpha + prettyIndent + prettyPrinting + previousSibling + print + printAsBitmap + prototype + proxyType + quality + rate + ratios + ratios + rect + redMultiplier + redOffset + relatedObject + repeatCount + requestHeaders + restrict + rewind + right + rightMargin + rightPeak + rightToLeft + rightToRight + root + rotation + running + sameDomain + sandboxType + save + scale9Grid + scaleMode + scaleX + scaleY + scenes + screenColor + screenDPI + screenResolutionX + screenResolutionY + scrollH + scrollRect + scrollV + seconds + secondsUTC + securityDomain + selectable + selectionBeginIndex + selectionEndIndex + separatorBefore + serverString + shadowAlpha + shadowColor + sharedEvents + sharpness + shiftKey + shortcut + showDefaultContextMenu + silenceLevel + silenceTimeout + silent + size + smoothing + songName + soundTransform + source + stage + stageFocusRect + stageHeight + stageWidth + stageX + stageY + status + strength + styleNames + styleSheet + swfVersion + tabChildren + tabEnabled + tabIndex + tabStops + target + text + textColor + textHeight + textSnapshot + textWidth + thickness + time + timezoneOffset + top + topLeft + totalFrames + totalMemory + track + trackAsMenu + trackAsMenu + transform + transparent + tx + ty + type + underline + upState + uri + url + useCodePage + useEchoSuppression + useHandCursor + useRichTextClipboard + usingTLS + value + version + videoHeight + videoWidth + visible + volume + width + wordWrap + x + xmlDecl + y + year + zoom + + + + ACTIONSCRIPT2 + ACTIONSCRIPT3 + ACTIVATE + ACTIVITY + ADD + ADDED + ADDED_TO_STAGE + ADVANCED + ALPHA + ALPHANUMERIC_FULL + ALPHANUMERIC_HALF + ALWAYS + AMF0 + AMF3 + ASYNC_ERROR + AT_TARGET + AUTO + BACKSPACE + BEST + BEVEL + BIG_ENDIAN + BINARY + BLUE + BOLD + BOLD_ITALIC + BOTTOM + BOTTOM_LEFT + BOTTOM_RIGHT + BUBBLING_PHASE + CAMERA + CANCEL + CAPS_LOCK + CAPTURING_PHASE + CASEINSENSITIVE + CENTER + CHANGE + CHINESE + CLAMP + CLICK + CLOSE + COLOR + COMPLETE + CONNECT + CONTROL + CRT + DARK_COLOR + DARKEN + DATA + DEACTIVATE + DEFAULT + DELETE + DESCENDING + DEVICE + DIFFERENCE + DOUBLE_CLICK + DOWN + DYNAMIC + E + ELEMENT_NODE + EMBEDDED + END + ENTER + ENTER_FRAME + ERASE + ERROR + ESCAPE + EXACT_FIT + F1 + F10 + F11 + F12 + F13 + F14 + F15 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + FLASH1 + FLASH2 + FLASH3 + FLASH4 + FLASH5 + FLASH6 + FLASH7 + FLASH8 + FLASH9 + FLUSHED + FOCUS_IN + FOCUS_OUT + FULL + FULL_SCREEN + FULLSCREEN + GET + GREEN + HARDLIGHT + HIGH + HOME + HORIZONTAL + HTTP_STATUS + ID3 + IGNORE + IME_COMPOSITION + INIT + INNER + INPUT + INSERT + INVERT + IO_ERROR + ITALIC + JAPANESE_HIRAGANA + JAPANESE_KATAKANA_FULL + JAPANESE_KATAKANA_HALF + JUSTIFY + KEY_DOWN + KEY_FOCUS_CHANGE + KEY_UP + KOREAN + LANDSCAPE + LAYER + LCD + LEFT + LIGHT_COLOR + LIGHTEN + LINEAR + LINEAR_RGB + LINK + LITTLE_ENDIAN + LN10 + LN2 + LOCAL_STORAGE + LOCAL_TRUSTED + LOCAL_WITH_FILE + LOCAL_WITH_NETWORK + LOG10E + LOG2E + LOW + LOW + MAX_VALUE + MEDIUM + MENU_ITEM_SELECT + MENU_SELECT + MICROPHONE + MIN_VALUE + MITER + MOUSE_DOWN + MOUSE_FOCUS_CHANGE + MOUSE_LEAVE + MOUSE_MOVE + MOUSE_OUT + MOUSE_OVER + MOUSE_UP + MOUSE_WHEEL + MULTIPLY + NaN + NaN + NEGATIVE_INFINITY + NET_STATUS + NEVER + NO_BORDER + NONE + NORMAL + NO_SCALE + NUMERIC + NUM_PAD + NUMPAD_0 + NUMPAD_1 + NUMPAD_2 + NUMPAD_3 + NUMPAD_4 + NUMPAD_5 + NUMPAD_6 + NUMPAD_7 + NUMPAD_8 + NUMPAD_9 + NUMPAD_ADD + NUMPAD_DECIMAL + NUMPAD_DIVIDE + NUMPAD_ENTER + NUMPAD_MULTIPLY + NUMPAD_SUBTRACT + OPEN + OUTER + OVERLAY + PAD + PAGE_DOWN + PAGE_UP + PENDING + PI + PIXEL + PORTRAIT + POSITIVE_INFINITY + POST + PRIVACY + PROGRESS + RADIAL + RED + REFLECT + REGULAR + REMOTE + REMOVED + REMOVED_FROM_STAGE + RENDER + REPEAT + RESIZE + RETURNINDEXEDARRAY + RGB + RIGHT + ROLL_OUT + ROLL_OVER + ROUND + SCREEN + SCROLL + SECURITY_ERROR + SELECT + SETTINGS_MANAGER + SHIFT + SHOW_ALL + SOCKET_DATA + SOUND_COMPLETE + SPACE + SQRT1_2 + SQRT2 + SQUARE + STANDARD + STATUS + SUBPIXEL + SUBTRACT + SYNC + TAB + TAB_CHILDREN_CHANGE + TAB_ENABLED_CHANGE + TAB_INDEX_CHANGE + TEXT + TEXT_INPUT + TEXT_NODE + TIMER + TIMER_COMPLETE + TOP + TOP_LEFT + TOP_RIGHT + undefined + UNIQUESORT + UNKNOWN + UNLOAD + UP + UPLOAD_COMPLETE_DATA + VARIABLES + VERTICAL + WRAP + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/active4d.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/active4d.plist new file mode 100644 index 00000000..20c56f2c --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/active4d.plist @@ -0,0 +1,338 @@ + + + + + autocompleteWords + + beginCommand + &lt; + beginFirstMultiLineComment + /* + beginInstruction + &lt;% + beginSecondMultiLineComment + + beginVariable + $ + endCommand + &gt; + endFirstMultiLineComment + */ + endInstruction + %&gt; + endSecondMultiLineComment + + endVariable + \)\:\+\=\*\; + firstSingleLineComment + ` + firstString + " + functionDefinition + ^\s*Method\s+.* + keywords + + _form + _query + _request + 4d + a + abandon + abs + add + all + an + append + array + ascii + auth + authenticate + auto + automatic + base64 + before + between + blob + blowfish + boolean + buffer + build + by + c_blob + c_boolean + c_date + c_longint + c_picture + c_pointer + c_real + c_string + c_text + c_time + cache + call + callback + case + cancel + capitalize + cell + century + chain + char + charset + choices + choose + clear + close + collection + compare + concat + console + content + control + cookie + cookies + copy + count + create + current + cut + date + datetime + day + dec + decode + deep + default + define + defined + delay + delete + delta + descriptor + difference + directory + distinct + document + each + element + else + empty + enclose + encode + encoding + end + error + execute + exists + expires + extension + false + field + fields + file + filename + fill + find + first + folder + for + form + formula + from + full + get + gif + global + globals + goto + has + header + headers + hide + hour + html + id + identical + if + import + in + include + index + indexed + info + infos + insert + int + integer + internal + interpolate + intersection + into + is + iso + item + items + iterator + jpeg + jpg + key + keys + last + length + library + licence + limit + line + list + load + local + lock + locked + log + longint + lowercase + mac + many + match + max + md5 + merge + message + method + millisecond + milliseconds + min + minute + mode + month + more + move + multisort + name + named + native + new + next + nil + not + num + number + of + one + only + open + order + output + packet + page + parameter + params + path + pattern + picture + platform + pointer + position + previous + process + property + query + quote + random + range + raw + read + real + realm + receive + record + records + redirect + reduce + regex + relate + relations + remaining + remove + replace + requested + require + resize + resolve + response + return + right + root + round + save + scan + script + second + selected + selection + semaphore + seperator + sequence + session + set + size + slice + sort + split + start + state + string + strings + structure + substring + sum + table + tables + test + text + throw + tickcount + timeout + timestamp + to + transaction + trim + true + trunc + type + undefined + union + unload + unlock + upload + uploads + uppercase + url + use + utc + validate + values + variable + variables + version + while + win + with + write + writebr + writeln + writep + year + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + method + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ada.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ada.plist new file mode 100644 index 00000000..d5521991 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ada.plist @@ -0,0 +1,116 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + -- + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(function|procedure)\s+\w* + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abort + abs + abstract + accept + access + aliased + all + and + array + at + begin + body + constant + declare + delay + delta + digits + do + else + elsif + end + entry + exception + exit + for + function + generic + goto + in + is + limited + mod + new + not + null + of + or + others + out + package + pragma + private + procedure + protected + raise + range + rem + record + renames + requeue + return + reverse + separate + subtype + tagged + task + terminate + then + type + until + use + when + while + with + xor + case + loop + if + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ampl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ampl.plist new file mode 100644 index 00000000..a122b267 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ampl.plist @@ -0,0 +1,68 @@ + + + + + beginCommand + ` + endCommand + ' + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + or + if + then + else + exists + forall + in + not + purge union diff + symbol + symdif + inter cross setof by + less + sum + prod + min + max + abs + acos acosh alias asin asinsh atan atan2 atanh ceil cos exp floor log log10 precision round sin sinh sqrt tan tanh trunc Beta Cauchy Exponential Gamma Irand224 Normal Normal01 Poisson Uniform set setof param var arc minimize maximize subject let to node binary integer check card next nextw prev prevw first last member match within ord ord0 circular ordered reversed init init0 lb lb0 lb1 lb2 lrc lslack rc slack ub ub0 ub1 ub2 urc uslack val body dinit dinit0 dual lb lbs ldual lslack slack ub ubs udual uslack + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/apache.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/apache.plist new file mode 100644 index 00000000..1a09ec06 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/apache.plist @@ -0,0 +1,411 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*<\/{0}.*> + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + AcceptMutex + AcceptPathInfo + AccessFileName + Action + AddAlt + AddAltByEncoding + AddAltByType + AddCharset + AddDefaultCharset + AddDescription + AddEncoding + AddHandler + AddIcon + AddIconByEncoding + AddIconByType + AddInputFilter + AddLanguage + AddModuleInfo + AddOutputFilter + AddOutputFilterByType + AddType + Alias + AliasMatch + Allow + AllowCONNECT + AllowEncodedSlashes + AllowOverride + Anonymous + Anonymous_Authoritative + Anonymous_LogEmail + Anonymous_MustGiveEmail + Anonymous_NoUserID + Anonymous_VerifyEmail + AssignUserID + AuthAuthoritative + AuthDBMAuthoritative + AuthDBMGroupFile + AuthDBMType + AuthDBMUserFile + AuthDigestAlgorithm + AuthDigestDomain + AuthDigestFile + AuthDigestGroupFile + AuthDigestNcCheck + AuthDigestNonceFormat + AuthDigestNonceLifetime + AuthDigestQop + AuthDigestShmemSize + AuthGroupFile + AuthLDAPAuthoritative + AuthLDAPBindDN + AuthLDAPBindPassword + AuthLDAPCharsetConfig + AuthLDAPCompareDNOnServer + AuthLDAPDereferenceAliases + AuthLDAPEnabled + AuthLDAPFrontPageHack + AuthLDAPGroupAttribute + AuthLDAPGroupAttributeIsDN + AuthLDAPRemoteUserIsDN + AuthLDAPUrl + AuthName + AuthType + AuthUserFile + BrowserMatch + BrowserMatchNoCase + BS2000Account + BufferedLogs + CacheDefaultExpire + CacheDirLength + CacheDirLevels + CacheDisable + CacheEnable + CacheExpiryCheck + CacheFile + CacheForceCompletion + CacheGcClean + CacheGcDaily + CacheGcInterval + CacheGcMemUsage + CacheGcUnused + CacheIgnoreCacheControl + CacheIgnoreHeaders + CacheIgnoreNoLastMod + CacheLastModifiedFactor + CacheMaxExpire + CacheMaxFileSize + CacheMinFileSize + CacheNegotiatedDocs + CacheRoot + CacheSize + CacheTimeMargin + CGIMapExtension + CharsetDefault + CharsetOptions + CharsetSourceEnc + CheckSpelling + ChildPerUserID + ContentDigest + CookieDomain + CookieExpires + CookieLog + CookieName + CookieStyle + CookieTracking + CoreDumpDirectory + CustomLog + Dav + DavDepthInfinity + DavLockDB + DavMinTimeout + DefaultIcon + DefaultLanguage + DefaultType + DeflateBufferSize + DeflateCompressionLevel + DeflateFilterNote + DeflateMemLevel + DeflateWindowSize + Deny + Directory + DirectoryIndex + DirectoryMatch + DirectorySlash + DocumentRoot + DumpIOInput + DumpIOOutput + EnableExceptionHook + EnableMMAP + EnableSendfile + ErrorDocument + ErrorLog + Example + ExpiresActive + ExpiresByType + ExpiresDefault + ExtendedStatus + ExtFilterDefine + ExtFilterOptions + FileETag + Files + FilesMatch + ForceLanguagePriority + ForceType + ForensicLog + Group + Header + HeaderName + HostnameLookups + IdentityCheck + IfDefine + IfModule + IfVersion + ImapBase + ImapDefault + ImapMenu + Include + IndexIgnore + IndexOptions + IndexOrderDefault + ISAPIAppendLogToErrors + ISAPIAppendLogToQuery + ISAPICacheFile + ISAPIFakeAsync + ISAPILogNotSupported + ISAPIReadAheadBuffer + KeepAlive + KeepAliveTimeout + LanguagePriority + LDAPCacheEntries + LDAPCacheTTL + LDAPConnectionTimeout + LDAPOpCacheEntries + LDAPOpCacheTTL + LDAPSharedCacheFile + LDAPSharedCacheSize + LDAPTrustedCA + LDAPTrustedCAType + Limit + LimitExcept + LimitInternalRecursion + LimitRequestBody + LimitRequestFields + LimitRequestFieldSize + LimitRequestLine + LimitXMLRequestBody + Listen + ListenBackLog + LoadFile + LoadModule + Location + LocationMatch + LockFile + LogFormat + LogLevel + MaxClients + MaxKeepAliveRequests + MaxMemFree + MaxRequestsPerChild + MaxRequestsPerThread + MaxSpareServers + MaxSpareThreads + MaxThreads + MaxThreadsPerChild + MCacheMaxObjectCount + MCacheMaxObjectSize + MCacheMaxStreamingBuffer + MCacheMinObjectSize + MCacheRemovalAlgorithm + MCacheSize + MetaDir + MetaFiles + MetaSuffix + MimeMagicFile + MinSpareServers + MinSpareThreads + MMapFile + ModMimeUsePathInfo + MultiviewsMatch + NameVirtualHost + NoProxy + NumServers + NWSSLTrustedCerts + NWSSLUpgradeable + Options + Order + PassEnv + PidFile + ProtocolEcho + Proxy + ProxyBadHeader + ProxyBlock + ProxyDomain + ProxyErrorOverride + ProxyIOBufferSize + ProxyMatch + ProxyMaxForwards + ProxyPass + ProxyPassReverse + ProxyPreserveHost + ProxyReceiveBufferSize + ProxyRemote + ProxyRemoteMatch + ProxyRequests + ProxyTimeout + ProxyVia + ReadmeName + Redirect + RedirectMatch + RedirectPermanent + RedirectTemp + RemoveCharset + RemoveEncoding + RemoveHandler + RemoveInputFilter + RemoveLanguage + RemoveOutputFilter + RemoveType + RequestHeader + Require + RewriteBase + RewriteCond + RewriteEngine + RewriteLock + RewriteLog + RewriteLogLevel + RewriteMap + RewriteOptions + RewriteRule + RLimitCPU + RLimitMEM + RLimitNPROC + Satisfy + ScoreBoardFile + Script + ScriptAlias + ScriptAliasMatch + ScriptInterpreterSource + ScriptLog + ScriptLogBuffer + ScriptLogLength + ScriptSock + SecureListen + SendBufferSize + ServerAdmin + ServerAlias + ServerLimit + ServerName + ServerPath + ServerRoot + ServerSignature + ServerTokens + SetEnv + SetEnvIf + SetEnvIfNoCase + SetHandler + SetInputFilter + SetOutputFilter + SSIEndTag + SSIErrorMsg + SSIStartTag + SSITimeFormat + SSIUndefinedEcho + SSLCACertificateFile + SSLCACertificatePath + SSLCARevocationFile + SSLCARevocationPath + SSLCertificateChainFile + SSLCertificateFile + SSLCertificateKeyFile + SSLCipherSuite + SSLEngine + SSLMutex + SSLOptions + SSLPassPhraseDialog + SSLProtocol + SSLProxyCACertificateFile + SSLProxyCACertificatePath + SSLProxyCARevocationFile + SSLProxyCARevocationPath + SSLProxyCipherSuite + SSLProxyEngine + SSLProxyMachineCertificateFile + SSLProxyMachineCertificatePath + SSLProxyProtocol + SSLProxyVerify + SSLProxyVerifyDepth + SSLRandomSeed + SSLRequire + SSLRequireSSL + SSLSessionCache + SSLSessionCacheTimeout + SSLUserName + SSLVerifyClient + SSLVerifyDepth + StartServers + StartThreads + SuexecUserGroup + ThreadLimit + ThreadsPerChild + ThreadStackSize + TimeOut + TraceEnable + TransferLog + TypesConfig + UnsetEnv + UseCanonicalName + User + UserDir + VirtualDocumentRoot + VirtualDocumentRootIP + VirtualHost + VirtualScriptAlias + VirtualScriptAliasIP + Win32DisableAcceptEx + XBitHack + AddModule + Port + MIMEMagicFile + RegisterUserSite + NoCache + EBCDICConvertByType + BindAddress + ServerType + Timeout + ProxyHTMLURLMap + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/applescript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/applescript.plist new file mode 100644 index 00000000..308a2f6f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/applescript.plist @@ -0,0 +1,218 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + -- + secondSingleLineComment + + beginFirstMultiLineComment + (* + endFirstMultiLineComment + *) + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*on (\w+) + removeFromFunction + on + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + script + property + prop + end + copy + to + set + global + local + on + to + of + in + given + with + without + return + continue + tell + if + then + else + repeat + times + while + until + from + exit + try + error + considering + ignoring + timeout + transaction + my + get + put + into + is + each + some + every + whose + where + id + index + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + last + front + back + st + nd + rd + th + middle + named + through + thru + before + after + beginning + the + close + copy + count + delete + duplicate + exists + launch + make + move + open + print + quit + reopen + run + save + saving + it + me + version + pi + result + space + tab + anything + case + diacriticals + expansion + hyphens + punctuation + bold + condensed + expanded + hidden + italic + outline + plain + shadow + strikethrough + subscript + superscript + underline + ask + no + yes + false + true + weekday + monday + mon + tuesday + tue + wednesday + wed + thursday + thu + friday + fri + saturday + sat + sunday + sun + month + january + jan + february + feb + march + mar + april + apr + may + june + jun + july + jul + august + aug + september + sep + october + oct + november + nov + december + dec + minutes + hours + days + weeks + div + mod + and + not + or + as + contains + equal + equals + isn't + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-mips.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-mips.plist new file mode 100644 index 00000000..f898b5aa --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-mips.plist @@ -0,0 +1,139 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + */ + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + /* + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + # + firstString + " + functionDefinition + + includeInKeywordStartCharacterSet + . + keywords + + ABS + ADD + ADDI + ADDIU + ADDU + DIV + DIVU + MULOU + MULO + MULT + MULTU + NEG + NOP + REMU + REM + SEQ + SGEU + SGE + SGTU + SGT + SLEU + SLE + SLT + SLTI + SLTIU + SLTU + SNE + SUB + SUBU + AND + ANDI + NOR + NOT + OR + ORI + XOR + XORI + ROL + ROR + SLL + SLLV + SRA + SRAV + SRL + SRLV + LB + LBU + LD + LH + LHU + LW + SB + SD + SH + SW + LA + LI + LUI + MFHI + MFLO + MOVE + MTHI + MTLO + B + BEQ + BEQZ + BGE + BGEU + BGEZ + BGEZAL + BGT + BGTU + BGTZ + BLE + BLEU + BLEZ + BLT + BLTU + BLTZ + BLTZAL + BNE + BNEZ + J + JAL + JALR + JR + MFC0 + MTC0 + BREAK + SYSCALL + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-x86.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-x86.plist new file mode 100644 index 00000000..5e91655f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asm-x86.plist @@ -0,0 +1,839 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + ; + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + includeInKeywordStartCharacterSet + . + keywords + + .186 + .286 + .286P + .287 + .386 + .386P + .387 + .486 + .486P + .586 + .586P + .686 + .686P + .8086 + .8087 + .ALPHA + .BREAK + .BSS + .CODE + .CONST + .CONTINUE + .CREF + .DATA + .DATA? + .DOSSEG + .ELSE + .ELSEIF + .ENDIF + .ENDW + .ERR + .ERR1 + .ERR2 + .ERRB + .ERRDEF + .ERRDIF + .ERRDIFI + .ERRE + .ERRIDN + .ERRIDNI + .ERRNB + .ERRNDEF + .ERRNZ + .EXIT + .FARDATA + .FARDATA? + .IF + .K3D + .LALL + .LFCOND + .LIST + .LISTALL + .LISTIF + .LISTMACRO + .LISTMACROALL + .MMX + .MODEL + .MSFLOAT + .NO87 + .NOCREF + .NOLIST + .NOLISTIF + .NOLISTMACRO + .RADIX + .REPEAT + .SALL + .SEQ + .SFCOND + .STACK + .STARTUP + .TEXT + .TFCOND + .UNTIL + .UNTILCXZ + .WHILE + .XALL + .XCREF + .XLIST + .XMM + __FILE__ + __LINE__ + A16 + A32 + ADDR + ALIGN + ALIGNB + ASSUME + BITS + CARRY? + CATSTR + CODESEG + COMM + COMMENT + COMMON + DATASEG + DOSSEG + ECHO + ELSE + ELSEIF + ELSEIF1 + ELSEIF2 + ELSEIFB + ELSEIFDEF + ELSEIFE + ELSEIFIDN + ELSEIFNB + ELSEIFNDEF + END + ENDIF + ENDM + ENDP + ENDS + ENDSTRUC + EVEN + EXITM + EXPORT + EXTERN + EXTERNDEF + EXTRN + FAR + FOR + FORC + GLOBAL + GOTO + GROUP + HIGH + HIGHWORD + IEND + IF + IF1 + IF2 + IFB + IFDEF + IFDIF + IFDIFI + IFE + IFIDN + IFIDNI + IFNB + IFNDEF + IMPORT + INCBIN + INCLUDE + INCLUDELIB + INSTR + INVOKE + IRP + IRPC + ISTRUC + LABEL + LENGTH + LENGTHOF + LOCAL + LOW + LOWWORD + LROFFSET + MACRO + NAME + NEAR + NOSPLIT + O16 + O32 + OFFSET + OPATTR + OPTION + ORG + OVERFLOW? + PAGE + PARITY? + POPCONTEXT + PRIVATE + PROC + PROTO + PTR + PUBLIC + PURGE + PUSHCONTEXT + RECORD + REPEAT + REPT + SECTION + SEG + SEGMENT + SHORT + SIGN? + SIZE + SIZEOF + SIZESTR + STACK + STRUC + STRUCT + SUBSTR + SUBTITLE + SUBTTL + THIS + TITLE + TYPE + TYPEDEF + UNION + USE16 + USE32 + USES + WHILE + WRT + ZERO? + DB + DW + DD + DF + DQ + DT + RESB + RESW + RESD + RESQ + REST + EQU + TEXTEQU + TIMES + DUP + BYTE + WORD + DWORD + FWORD + QWORD + TBYTE + SBYTE + TWORD + SWORD + SDWORD + REAL4 + REAL8 + REAL10 + AL + BL + CL + DL + AH + BH + CH + DH + AX + BX + CX + DX + SI + DI + SP + BP + EAX + EBX + ECX + EDX + ESI + EDI + ESP + EBP + CS + DS + SS + ES + FS + GS + ST + ST0 + ST1 + ST2 + ST3 + ST4 + ST5 + ST6 + ST7 + MM0 + MM1 + MM2 + MM3 + MM4 + MM5 + MM6 + MM7 + XMM0 + XMM1 + XMM2 + XMM3 + XMM4 + XMM5 + XMM6 + XMM7 + CR0 + CR2 + CR3 + CR4 + DR0 + DR1 + DR2 + DR3 + DR4 + DR5 + DR6 + DR7 + TR3 + TR4 + TR5 + TR6 + TR7 + AAA + AAD + AAM + AAS + ADC + ADD + ADDPS + ADDSS + AND + ANDNPS + ANDPS + ARPL + BOUND + BSF + BSR + BSWAP + BT + BTC + BTR + BTS + CALL + CBW + CDQ + CLC + CLD + CLI + CLTS + CMC + CMOVA + CMOVAE + CMOVB + CMOVBE + CMOVC + CMOVE + CMOVG + CMOVGE + CMOVL + CMOVLE + CMOVNA + CMOVNAE + CMOVNB + CMOVNBE + CMOVNC + CMOVNE + CMOVNG + CMOVNGE + CMOVNL + CMOVNLE + CMOVNO + CMOVNP + CMOVNS + CMOVNZ + CMOVO + CMOVP + CMOVPE + CMOVPO + CMOVS + CMOVZ + CMP + CMPPS + CMPS + CMPSB + CMPSD + CMPSS + CMPSW + CMPXCHG + CMPXCHGB + COMISS + CPUID + CWD + CWDE + CVTPI2PS + CVTPS2PI + CVTSI2SS + CVTSS2SI + CVTTPS2PI + CVTTSS2SI + DAA + DAS + DEC + DIV + DIVPS + DIVSS + EMMS + ENTER + F2XM1 + FABS + FADD + FADDP + FBLD + FBSTP + FCHS + FCLEX + FCMOVB + FCMOVBE + FCMOVE + FCMOVNB + FCMOVNBE + FCMOVNE + FCMOVNU + FCMOVU + FCOM + FCOMI + FCOMIP + FCOMP + FCOMPP + FCOS + FDECSTP + FDIV + FDIVP + FDIVR + FDIVRP + FFREE + FIADD + FICOM + FICOMP + FIDIV + FIDIVR + FILD + FIMUL + FINCSTP + FINIT + FIST + FISTP + FISUB + FISUBR + FLD1 + FLDCW + FLDENV + FLDL2E + FLDL2T + FLDLG2 + FLDLN2 + FLDPI + FLDZ + FMUL + FMULP + FNCLEX + FNINIT + FNOP + FNSAVE + FNSTCW + FNSTENV + FNSTSW + FPATAN + FPREM + FPREMI + FPTAN + FRNDINT + FRSTOR + FSAVE + FSCALE + FSIN + FSINCOS + FSQRT + FST + FSTCW + FSTENV + FSTP + FSTSW + FSUB + FSUBP + FSUBR + FSUBRP + FTST + FUCOM + FUCOMI + FUCOMIP + FUCOMP + FUCOMPP + FWAIT + FXAM + FXCH + FXRSTOR + FXSAVE + FXTRACT + FYL2X + FYL2XP1 + HLT + IDIV + IMUL + IN + INC + INS + INSB + INSD + INSW + INT + INTO + INVD + INVLPG + IRET + JA + JAE + JB + JBE + JC + JCXZ + JE + JECXZ + JG + JGE + JL + JLE + JMP + JNA + JNAE + JNB + JNBE + JNC + JNE + JNG + JNGE + JNL + JNLE + JNO + JNP + JNS + JNZ + JO + JP + JPE + JPO + JS + JZ + LAHF + LAR + LDMXCSR + LDS + LEA + LEAVE + LES + LFS + LGDT + LGS + LIDT + LLDT + LMSW + LOCK + LODS + LODSB + LODSD + LODSW + LOOP + LOOPE + LOOPNE + LOOPNZ + LOOPZ + LSL + LSS + LTR + MASKMOVQ + MAXPS + MAXSS + MINPS + MINSS + MOV + MOVAPS + MOVD + MOVHLPS + MOVHPS + MOVLHPS + MOVLPS + MOVMSKPS + MOVNTPS + MOVNTQ + MOVQ + MOVS + MOVSB + MOVSD + MOVSS + MOVSW + MOVSX + MOVUPS + MOVZX + MUL + MULPS + MULSS + NEG + NOP + NOT + OR + ORPS + OUT + OUTS + OUTSB + OUTSD + OUTSW + PACKSSDW + PACKSSWB + PACKUSWB + PADDB + PADDD + PADDSB + PADDSW + PADDUSB + PADDUSW + PADDW + PAND + PANDN + PAVGB + PAVGW + PCMPEQB + PCMPEQD + PCMPEQW + PCMPGTB + PCMPGTD + PCMPGTW + PEXTRW + PINSRW + PMADDWD + PMAXSW + PMAXUB + PMINSW + PMINUB + PMOVMSKB + PMULHUW + PMULHW + PMULLW + POP + POPA + POPAD + POPAW + POPF + POPFD + POPFW + POR + PREFETCH + PSADBW + PSHUFW + PSLLD + PSLLQ + PSLLW + PSRAD + PSRAW + PSRLD + PSRLQ + PSRLW + PSUBB + PSUBD + PSUBSB + PSUBSW + PSUBUSB + PSUBUSW + PSUBW + PUNPCKHBW + PUNPCKHDQ + PUNPCKHWD + PUNPCKLBW + PUNPCKLDQ + PUNPCKLWD + PUSH + PUSHA + PUSHAD + PUSHAW + PUSHF + PUSHFD + PUSHFW + PXOR + RCL + RCR + RDMSR + RDPMC + RDTSC + REP + REPE + REPNE + REPNZ + REPZ + RET + RETF + RETN + ROL + ROR + RSM + SAHF + SAL + SAR + SBB + SCAS + SCASB + SCASD + SCASW + SETA + SETAE + SETB + SETBE + SETC + SETE + SETG + SETGE + SETL + SETLE + SETNA + SETNAE + SETNB + SETNBE + SETNC + SETNE + SETNG + SETNGE + SETNL + SETNLE + SETNO + SETNP + SETNS + SETNZ + SETO + SETP + SETPE + SETPO + SETS + SETZ + SFENCE + SGDT + SHL + SHLD + SHR + SHRD + SHUFPS + SIDT + SLDT + SMSW + SQRTPS + SQRTSS + STC + STD + STI + STMXCSR + STOS + STOSB + STOSD + STOSW + STR + SUB + SUBPS + SUBSS + SYSENTER + SYSEXIT + TEST + UB2 + UCOMISS + UNPCKHPS + UNPCKLPS + WAIT + WBINVD + VERR + VERW + WRMSR + XADD + XCHG + XLAT + XLATB + XOR + XORPS + FEMMS + PAVGUSB + PF2ID + PFACC + PFADD + PFCMPEQ + PFCMPGE + PFCMPGT + PFMAX + PFMIN + PFMUL + PFRCP + PFRCPIT1 + PFRCPIT2 + PFRSQIT1 + PFRSQRT + PFSUB + PFSUBR + PI2FD + PMULHRW + PREFETCHW + PF2IW + PFNACC + PFPNACC + PI2FW + PSWAPD + PREFETCHNTA + PREFETCHT0 + PREFETCHT1 + PREFETCHT2 + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-js.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-js.plist new file mode 100644 index 00000000..b99819bc --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-js.plist @@ -0,0 +1,425 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*function\s+.*\n?\s*\{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + connect + EOF + movenext + close + Application + ASPError + Request + Response + Server + Session + Contents + StaticObjects + Remove + RemoveAll + Lock + Unlock + Application_OnStart + Application_OnEnd + ASPCode + Number + Source + Category + File + Line + Column + Description + ASPDescription + Cookies + Form + QueryString + ServerVariables + TotalBytes + Buffer + CacheControl + Charset + CodePage + ContentType + Expires + ExpiresAbsolute + IsClientConnected + LCID + PICS + Status + AddHeader + AppendToLog + BinaryWrite + Clear + End + Flush + Redirect + Write + ScriptTimeout + CreateObject + Execute + GetLastError + HTMLEncode + MapPath + Transfer + URLEncode + StaticObjects + SessionID + Timeout + break + continue + delete + else + for + function + if + in + new + return + this + typeof + var + void + while + with + if + then + else + elseif + select + case + for + to + step + next + each + in + do + while + until + loop + wend + exit + end + function + sub + class + property + get + let + set + byval + byref + const + dim + redim + preserve + as + set + with + new + public + default + private + rem + call + execute + eval + on + error + goto + resume + option + explicit + erase + randomize + is + mod + and + or + not + xor + imp + false + true + empty + nothing + null + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-vb.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-vb.plist new file mode 100644 index 00000000..14fdaccc --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/asp-vb.plist @@ -0,0 +1,409 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + ' + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*\w*(function|sub)\s+.* + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + then + else + elseif + select + case + for + to + step + next + each + in + do + while + until + loop + wend + exit + end + function + sub + class + property + get + let + set + byval + byref + const + dim + redim + preserve + as + set + with + new + public + default + private + rem + call + execute + eval + on + error + goto + resume + option + explicit + erase + randomize + is + mod + and + or + not + xor + imp + false + true + empty + nothing + null + connect + EOF + movenext + close + Application + ASPError + Request + Response + Server + Session + Contents + StaticObjects + Remove + RemoveAll + Lock + Unlock + Application_OnStart + Application_OnEnd + ASPCode + Number + Source + Category + File + Line + Column + Description + ASPDescription + Cookies + Form + QueryString + ServerVariables + TotalBytes + Buffer + CacheControl + Charset + CodePage + ContentType + Expires + ExpiresAbsolute + IsClientConnected + LCID + PICS + Status + AddHeader + AppendToLog + BinaryWrite + Clear + End + Flush + Redirect + Write + ScriptTimeout + CreateObject + Execute + GetLastError + HTMLEncode + MapPath + Transfer + URLEncode + StaticObjects + SessionID + Timeout + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-cs.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-cs.plist new file mode 100644 index 00000000..7b8b53a1 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-cs.plist @@ -0,0 +1,440 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + AspCompat + AutoEventWireup + Assembly + Buffer + ClassName + ClientTarget + CodePage + CompilerOptions + ContentType + Culture + Debug + Description + EnableSessionState + EnableViewState + EnableViewStateMac + ErrorPage + Explicit + Inherits + Language + LCID + ResponseEncoding + Src + SmartNavigation + Strict + Trace + TraceMode + Transaction + UICulture + WarningLevel + Namespace + Interface + TagPrefix + TagName + Duration + Location + VaryByCustom + VaryByHeader + VaryByParam + VaryByControl + Control + Literal + PlaceHolder + Xml + AdRotator + Button + Calendar + CheckBox + CheckBoxList + DataGrid + DataList + DropDownList + HyperLink + Image + ImageButton + Label + LinkButton + ListBox + Panel + PlaceHolder + RadioButton + RadioButtonList + Repeater + Table + TableCell + TableRow + TextBox + runat + id + OnSelectedIndexChanged + AutoPostBack + EnableViewState + abstract + as + base + break + case + catch + class + checked + continue + default + delegate + do + else + enum + event + explicit + extern + false + for + foreach + finally + fixed + goto + if + implicit + in + interface + internal + is + lock + namespace + new + null + operator + out + override + params + private + protected + public + readonly + ref + return + sealed + sizeof + stackalloc + static + struct + switch + this + throw + true + try + typeof + unchecked + unsafe + using + virtual + while + #if + #else + #elif + #endif + #define + #undef + #warning + #error + #line + bool + byte + char + const + decimal + double + float + int + long + object + uint + ushort + ulong + sbyte + short + string + void + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-vb.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-vb.plist new file mode 100644 index 00000000..a4659e94 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/aspdotnet-vb.plist @@ -0,0 +1,480 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + ' + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*\w*(function|sub)\s+.* + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + AspCompat + AutoEventWireup + Assembly + Buffer + ClassName + ClientTarget + CodePage + CompilerOptions + ContentType + Culture + Debug + Description + EnableSessionState + EnableViewState + EnableViewStateMac + ErrorPage + Explicit + Inherits + Language + LCID + ResponseEncoding + Src + SmartNavigation + Strict + Trace + TraceMode + Transaction + UICulture + WarningLevel + Namespace + Interface + TagPrefix + TagName + Duration + Location + VaryByCustom + VaryByHeader + VaryByParam + VaryByControl + Control + Literal + PlaceHolder + Xml + AdRotator + Button + Calendar + CheckBox + CheckBoxList + DataGrid + DataList + DropDownList + HyperLink + Image + ImageButton + Label + LinkButton + ListBox + Panel + PlaceHolder + RadioButton + RadioButtonList + Repeater + Table + TableCell + TableRow + TextBox + runat + id + OnSelectedIndexChanged + AutoPostBack + EnableViewState + if + then + else + elseif + select + case + for + to + step + next + each + in + do + while + until + loop + wend + exit + end + function + sub + class + property + get + let + set + byval + byref + const + dim + redim + preserve + as + set + with + new + public + default + private + rem + call + execute + eval + on + error + goto + resume + option + explicit + erase + randomize + is + mod + and + or + not + xor + imp + false + true + empty + nothing + null + connect + EOF + movenext + close + Application + ASPError + Request + Response + Server + Session + Contents + StaticObjects + Remove + RemoveAll + Lock + Unlock + Application_OnStart + Application_OnEnd + ASPCode + Number + Source + Category + File + Line + Column + Description + ASPDescription + Cookies + Form + QueryString + ServerVariables + TotalBytes + Buffer + CacheControl + Charset + CodePage + ContentType + Expires + ExpiresAbsolute + IsClientConnected + LCID + PICS + Status + AddHeader + AppendToLog + BinaryWrite + Clear + End + Flush + Redirect + Write + ScriptTimeout + CreateObject + Execute + GetLastError + HTMLEncode + MapPath + Transfer + URLEncode + StaticObjects + SessionID + Timeout + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/awk.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/awk.plist new file mode 100644 index 00000000..5d889528 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/awk.plist @@ -0,0 +1,113 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*function\s+\w.*$ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + break + close + continue + delete + do + else + exit + fflush + for + huge + if + in + function + next + nextfile + print + printf + return + while + atan2 + cos + exp + gensub + getline + gsub + index + int + length + log + match + rand + sin + split + sprintf + sqrt + srand + sub + substr + system + tolower + toupper + BEGIN + END + $0 + ARGC + ARGIND + ARGV + CONVFMT + ENVIRON + ERRNO + FIELDWIDTHS + FILENAME + FNR + FS + IGNORECASE + NF + NR + OFMT + OFS + ORS + RLENGTH + RS + RSTART + RT + SUBSEP + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/batch.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/batch.plist new file mode 100644 index 00000000..cbb86f41 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/batch.plist @@ -0,0 +1,93 @@ + + + + + beginCommand + @ + endCommand + + beginInstruction + + endInstruction + + beginVariable + % + endVariable + \.\=\\\" + firstString + " + secondString + + firstSingleLineComment + :: + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keyWordsCaseSensitive + + recolourKeyWordIfAlreadyColoured + + keywords + + assoc + call + cd + chdir + cls + cmd + color + copy + date + defined + del + dir + dpath + echo + else + endlocal + erase + errorlevel + exit + exist + for + ftype + goto + if + md + mkdir + move + not + path + pause + popd + prompt + pushd + rd + rem + rename + ren + rmdir + set + setlocal + shift + start + time + title + type + ver + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/c.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/c.plist new file mode 100644 index 00000000..1ef1b148 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/c.plist @@ -0,0 +1,97 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + char + double + enum + float + int + long + short + signed + struct + typedef + union + unsigned + void + auto + const + extern + register + static + volatile + break + case + continue + default + do + else + for + goto + if + return + sizeof + switch + while + asm + asmlinkage + far + huge + inline + near + pascal + true + false + NULL + #include + #define + #warning + #error + #ifdef + #ifndef + #endif + #else + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cobol.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cobol.plist new file mode 100644 index 00000000..8292d514 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cobol.plist @@ -0,0 +1,150 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + * + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + ACCEPT + ADD + ADVANCING + AFTER + AND + ASSIGN + AUTHOR + AT + BY + CALL + CLOSE + COMPUTE + CONTENT + CONTROL + COPY + CORRESPONDING + DATA + DELETE + DISPLAY + DIVIDE + DIVISION + END + ENVIRONMENT + ERROR + EQUAL + EOF + EVALUATE + EXAMINE + EXIT + FALSE + FD + FILE + FILLER + FROM + FUNCTION + GIVING + GO + GOTO + GREATER + HIGH + ID + IDENTIFICATION + IF + INDEXED + INPUT + INSPECT + INVALID + IS + LINE + LINKAGE + KEY + LOWER + MOVE + MULTIPLY + NO + NOT + NUMVAL + OMITTED + OPEN + ORGANIZATION + OTHER + OUTPUT + PARAGRAPH + PERFORM + PIC + PROCEDURE + PROGRAM + READ + REPLACING + RETURNING + REWRITE + RUN + SEARCH + SECTION + SELECT + SEQUENTIAL + SET + SIZE + SORT + START + STATUS + STORAGE + STOP + STRING + SUB + SUBSTRACT + TALLYING + THEN + TO + TRUE + TRANSFORM + UNTIL + USAGE + USING + VARYING + VALUES + VALUE + WHEN + WORKING + WRITE + + autocompleteWords + + + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coffeescript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coffeescript.plist new file mode 100644 index 00000000..3abcbb5d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coffeescript.plist @@ -0,0 +1,99 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + ### + endFirstMultiLineComment + ### + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(->).* + removeFromFunction + -> + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + else + for + in + while + do + loop + until + continue + break + try + catch + switch + when + then + new + return + delete + true + false + throw + typeof + parseFloat + parseInt + Date + document + window + Math + RegExp + Screen + this + Window + alert + eval + focus + setInterval + setTimeout + history + indexOf + innerHeight + innerWidth + join + length + location + locationbar + match + NaN + toString + toUpperCase + encodeURI + encodeURIComponent + URL + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coldfusion.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coldfusion.plist new file mode 100644 index 00000000..4cb85662 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/coldfusion.plist @@ -0,0 +1,527 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + else + for + in + while + do + continue + break + with + try + catch + switch + case + new + var + function + return + this + delete + true + false + void + throw + typeof + const + default + Anchor + Applet + Area + Array + Boolean + Button + Checkbox + Date + Document + Event + FileUpload + Form + Frame + Function + Hidden + History + Image + Layer + Linke + Location + Math + Navigator + Number + Object + Option + Password + Radio + RegExp + Reset + Screen + Select + String + Submit + Text + Textarea + Window + abs + acos + alert + anchor + apply + asin + atan + atan2 + back + blur + call + captureEvents + ceil + charAt + charCodeAt + clearInterval + clearTimeout + click + close + compile + concat + confirm + cos + disableExternalCapture + enableExternalCapture + eval + exec + exp + find + floor + focus + forward + fromCharCode + getDate + getDay + getFullYear + getHours + getMilliseconds + getMinutes + getMonth + getSeconds + getSelection + getTime + getTimezoneOffset + getUTCDate + getUTCDay + getUTCFullYear + getUTCHours + getUTCMilliseconds + getUTCMinutes + getUTCMonth + getUTCSeconds + go + handleEvent + home + indexOf + javaEnabled + join + lastIndexOf + link + load + log + match + max + min + moveAbove + moveBelow + moveBy + moveTo + moveToAbsolute + open + parse + plugins.refresh + pop + pow + preference + print + prompt + push + random + releaseEvents + reload + replace + reset + resizeBy + resizeTo + reverse + round + routeEvent + scrollBy + scrollTo + search + select + setDate + setFullYear + setHours + setInterval + setMilliseconds + setMinutes + setMonth + setSeconds + setTime + setTimeout + setUTCDate + setUTCFullYear + setUTCHours + setUTCMilliseconds + setUTCMinutes + setUTCMonth + setUTCSeconds + shift + sin + slice + sort + splice + split + sqrt + stop + String formatting + submit + substr + substring + taintEnabled + tan + test + toLocaleString + toLowerCase + toSource + toString + toUpperCase + toUTCString + unshift + unwatch + UTC + valueOf + watch + write + writeln + break + case + catch + continue + default + do + else + for + function + if + in + return + switch + try + var + while + Abs + ACos + ArrayAppend + ArrayAvg + ArrayClear + ArrayDeleteAt + ArrayInsertAt + ArrayIsEmpty + ArrayLen + ArrayMax + ArrayMin + ArrayNew + ArrayPrepend + ArrayResize + ArraySet + ArraySort + ArraySum + ArraySwap + ArrayToList + Asc + ASin + Atn + BitAnd + BitMaskClear + BitMaskRead + BitMaskSet + BitNot + BitOr + BitSHLN + BitSHRN + BitXor + Ceiling + Chr + CJustify + Compare + CompareNoCase + Cos + CreateDate + CreateDateTime + CreateObject + CreateODBCDate + CreateODBCDateTime + CreateODBCTime + CreateTime + CreateTimeSpan + CreateUUID + DateAdd + DateCompare + DateConvert + DateDiff + DateFormat + DatePart + Day + DayOfWeek + DayOfWeekAsString + DayOfYear + DaysInMonth + DaysInYear + DE + DecimalFormat + DecrementValue + Decrypt + DeleteClientVariable + DirectoryExists + DollarFormat + Duplicate + Encrypt + Evaluate + Exp + ExpandPath + FileExists + Find + FindNoCase + FindOneOf + FirstDayOfMonth + Fix + FormatBaseN + GetAuthUser + GetBaseTagData + GetBaseTagList + GetBaseTemplatePath + GetClientVariablesList + GetCurrentTemplatePath + GetDirectoryFromPath + GetException + GetFileFromPath + GetFunctionList + GetHttpRequestData + GetHttpTimeString + GetK2ServerDocCount + GetK2ServerDocCountLimit + GetLocale + GetMetaData + GetMetricData + GetPageContext + GetProfileSections + GetProfileString + GetServiceSettings + GetTempDirectory + GetTempFile + GetTemplatePath + GetTickCount + GetTimeZoneInfo + GetToken + Hash + Hour + HTMLCodeFormat + HTMLEditFormat + IIf + IncrementValue + InputBaseN + Insert + Int + IsArray + IsBinary + IsBoolean + IsCustomFunction + IsDate + IsDebugMode + IsDefined + IsK2ServerABroker + IsK2ServerDocCountExceeded + IsK2ServerOnline + IsLeapYear + IsNumeric + IsNumericDate + IsObject + IsQuery + IsSimpleValue + IsStruct + IsUserInRole + IsWDDX + IsXmlDoc + IsXmlElement + IsXmlRoot + JavaCast + JSStringFormat + LCase + Left + Len + ListAppend + ListChangeDelims + ListContains + ListContainsNoCase + ListDeleteAt + ListFind + ListFindNoCase + ListFirst + ListGetAt + ListInsertAt + ListLast + ListLen + ListPrepend + ListQualify + ListRest + ListSetAt + ListSort + ListToArray + ListValueCount + ListValueCountNoCase + LJustify + Log + Log10 + LSCurrencyFormat + LSDateFormat + LSEuroCurrencyFormat + LSIsCurrency + LSIsDate + LSIsNumeric + LSNumberFormat + LSParseCurrency + LSParseDateTime + LSParseEuroCurrency + LSParseNumber + LSTimeFormat + LTrim + Max + Mid + Min + Minute + Month + MonthAsString + Now + NumberFormat + ParagraphFormat + ParameterExists + ParseDateTime + Pi + PreserveSingleQuotes + Quarter + QueryAddColumn + QueryAddRow + QueryNew + QuerySetCell + QuotedValueList + Rand + Randomize + RandRange + REFind + REFindNoCase + RemoveChars + RepeatString + Replace + ReplaceList + ReplaceNoCase + REReplace + REReplaceNoCase + Reverse + Right + RJustify + Round + RTrim + Second + SetEncoding + SetLocale + SetProfileString + SetVariable + Sgn + Sin + SpanExcluding + SpanIncluding + Sqr + StripCR + StructAppend + StructClear + StructCopy + StructCount + StructDelete + StructFind + StructFindKey + StructFindValue + StructGet + StructInsert + StructIsEmpty + StructKeyArray + StructKeyExists + StructKeyList + StructNew + StructSort + StructUpdate + Tan + TimeFormat + ToBase64 + ToBinary + ToString + Trim + UCase + URLDecode + URLEncodedFormat + URLSessionFormat + Val + ValueList + Week + WriteOutput + XmlChildPos + XmlElemNew + XmlFormat + XmlNew + XmlParse + XmlSearch + XmlTransform + Year + YesNoFormat + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cpp.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cpp.plist new file mode 100644 index 00000000..1f18c2ee --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/cpp.plist @@ -0,0 +1,124 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + and_eq + asm + auto + bitand + bitor + bool + break + case + catch + char + class + compl + const + const_cast + continue + default + delete + do + double + dynamic_cast + else + enum + explicit + export + extern + false + float + for + friend + goto + if + inline + int + long + mutable + namespace + new + not + not_eq + operator + or + or_eq + private + protected + public + register + reinterpret_cast + return + short + signed + sizeof + static + static_cast + struct + switch + template + this + throw + true + try + typedef + typeid + typename + union + unsigned + using + virtual + void + volatile + wchar_t + while + xor + xor_eq + NULL + #include + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csharp.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csharp.plist new file mode 100644 index 00000000..85b45f24 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csharp.plist @@ -0,0 +1,133 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abstract + as + base + break + case + catch + class + checked + continue + default + delegate + do + else + enum + event + explicit + extern + false + for + foreach + finally + fixed + goto + if + implicit + in + interface + internal + is + lock + namespace + new + null + operator + out + override + params + private + protected + public + readonly + ref + return + sealed + sizeof + stackalloc + static + struct + switch + this + throw + true + try + typeof + unchecked + unsafe + using + virtual + while + #if + #else + #elif + #endif + #define + #undef + #warning + #error + #line + bool + byte + char + const + decimal + double + float + int + long + object + uint + ushort + ulong + sbyte + short + string + void + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csound.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csound.plist new file mode 100644 index 00000000..a0320704 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/csound.plist @@ -0,0 +1,791 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + ; + firstString + " + functionDefinition + + keywords + + a + i + db + in + or + zr + Add + Dec + Div + Inc + Mul + Sub + abs + and + cos + dam + dec + div + exp + fin + fof + fog + inh + ino + inq + ins + int + inx + inz + lfo + log + mac + mod + mul + not + out + pan + pow + rms + rnd + shl + sin + sqr + sub + sum + tab + tan + tb0 + tb1 + tb2 + tb3 + tb4 + tb5 + tb6 + tb7 + tb8 + tb9 + urd + vco + xin + xor + zar + zaw + zir + ziw + zkr + zkw + adsr + babo + buzz + cent + clip + comb + cosh + diff + divz + fini + fink + fmb3 + fof2 + fold + fout + frac + ftsr + gain + goto + in32 + inch + init + line + maca + moog + mute + nrpn + outc + outh + outo + outq + outs + outx + outz + peak + port + pset + pvoc + rand + seed + sinh + sqrt + stix + tabw + tanh + tb10 + tb11 + tb12 + tb13 + tb14 + tb15 + tone + vadd + vco2 + vdiv + vexp + vibr + vmap + vmul + vpow + wrap + xout + xyin + zacl + zarg + zawm + ziwm + zkcl + zkwm + FLbox + FLjoy + FLrun + adsyn + ampdb + atone + birnd + bqrez + butbp + butbr + buthp + butlp + clear + ctrl7 + dbamp + dconv + delay + dumpk + endin + endop + event + expon + fouti + foutk + ftgen + ftlen + gauss + gbuzz + grain + guiro + igoto + ihold + instr + integ + kgoto + limit + linen + log10 + loopg + loopl + lpf18 + madsr + max_k + metro + noise + nsamp + oscil + out32 + outch + outic + outkc + outq1 + outq2 + outq3 + outq4 + outs1 + outs2 + pareq + pitch + pluck + portk + print + pvadd + randh + randi + rbjeq + readk + reson + rezzy + rnd31 + scans + scanu + sense + space + tab_i + table + tbvcf + tempo + timek + times + tival + tonek + tonex + vaddv + vbap4 + vbap8 + vbapz + vcomb + vcopy + vdecr + vdivv + veloc + vexpv + vibes + vincr + vmult + voice + vport + vpowv + vpvoc + vsubv + vwrap + wgbow + xadsr + zamod + zkmod + FLhide + FLkeyb + FLknob + FLpack + FLshow + FLtabs + FLtext + active + adsynt + alpass + areson + atonek + atonex + bamboo + bbcutm + bbcuts + biquad + cabasa + cauchy + cggoto + cigoto + ckgoto + clfilt + cngoto + convle + cosinv + cpsoct + cpspch + cpstun + cpuprc + cross2 + crunch + ctrl14 + ctrl21 + delay1 + delayk + delayr + delayw + deltap + denorm + diskin + dumpk2 + dumpk3 + dumpk4 + envlpx + expseg + filesr + fiopen + fmbell + follow + foscil + foutir + ftlen2 + ftload + ftmorf + ftsave + grain2 + grain3 + harmon + hrtfer + initc7 + interp + jitter + linenr + lineto + linseg + locsig + loopge + loople + lorenz + loscil + lowres + lpread + lpslot + mandel + mandol + mclock + mdelay + midic7 + midiin + midion + mirror + moscil + mpulse + mrtmsg + mxadsr + nlfilt + noteon + notnum + ntrpol + octave + octcps + octpch + opcode + oscbnk + oscil1 + oscil3 + oscili + osciln + oscils + oscilx + outiat + outipb + outipc + outkat + outkpb + outkpc + pchoct + phasor + planet + poscil + printk + prints + pvread + pvsftr + pvsftw + random + readk2 + readk3 + readk4 + reinit + resonk + resonr + resonx + resony + resonz + reverb + rigoto + s16b14 + s32b14 + sekere + sfload + sfplay + shaker + sininv + spat3d + spdist + spsend + strset + table3 + tablei + tablew + tabw_i + taninv + tigoto + timout + turnon + upsamp + vbap16 + vcella + vco2ft + vdel_k + vdelay + vlimit + vmultv + vrandh + vrandi + wgclar + xscans + xscanu + FLcolor + FLcount + FLgroup + FLlabel + FLpanel + FLvalue + aftouch + ampdbfs + ampmidi + aresonk + balance + bexprnd + biquada + changed + clockon + cps2pch + cpsmidi + cpstmid + cpstuni + cpsxpch + dbfsamp + dcblock + deltap3 + deltapi + deltapn + deltapx + dispfft + display + envlpxr + exprand + expsega + expsegr + filelen + filter2 + flanger + fmmetal + fmrhode + fmvoice + follow2 + foscili + fprints + ftchnls + ftloadk + ftlptim + ftsavek + gogobel + granule + hilbert + initc14 + initc21 + invalue + jitter2 + jspline + linrand + linsegr + locsend + logbtwo + loopseg + loscil3 + lowresx + lphasor + lposcil + lpreson + lpshold + marimba + massign + midic14 + midic21 + midichn + midion2 + midiout + moogvcf + noteoff + nreverb + nstrnum + octmidi + oscil1i + outic14 + outipat + outkc14 + outkpat + pcauchy + pchbend + pchmidi + phaser1 + phaser2 + pinkish + poisson + polyaft + poscil3 + printk2 + printks + product + pvcross + pvsanal + pvsinfo + pvsynth + randomh + randomi + release + repluck + reverb2 + rspline + rtclock + seqtime + sfilist + sfinstr + sfplay3 + sfplaym + sfplist + slider8 + sndwarp + soundin + spat3di + spat3dt + specsum + streson + tableiw + tablekt + tableng + tablera + tablewa + taninv2 + tempest + tlineto + transeg + trigger + trigseq + trirand + turnoff + unirand + valpass + vco2ift + vdelay3 + vdelayk + vdelayx + vexpseg + vibrato + vlinseg + vlowres + vmirror + waveset + weibull + wgbrass + wgflute + wgpluck + wguide1 + wguide2 + xtratim + zakinit + FLbutton + FLcolor2 + FLprintk + FLroller + FLscroll + FLsetBox + FLsetVal + FLslider + FLupdate + betarand + butterbp + butterbr + butterhp + butterlp + chanctrl + clockoff + convolve + cpsmidib + ctrlinit + cuserrnd + deltapxw + distort1 + downsamp + duserrnd + filepeak + fmpercfl + fmwurlie + fprintks + hsboscil + lowpass2 + lpfreson + lpinterp + lposcil3 + maxalloc + midictrl + multitap + nestedap + octmidib + oscilikt + outvalue + pchmidib + powoftwo + prealloc + pvinterp + pvsadsyn + pvscross + pvsfread + pvsmaska + rireturn + samphold + schedule + semitone + sensekey + setksmps + sfinstr3 + sfinstrm + sfplay3m + sfpreset + slider16 + slider32 + slider64 + slider8f + soundout + specaddm + specdiff + specdisp + specfilt + spechist + specptrk + specscal + spectrum + sprintks + subinstr + svfilter + tablegpw + tableikt + tablemix + tableseg + tablewkt + tablexkt + tb0_init + tb1_init + tb2_init + tb3_init + tb4_init + tb5_init + tb6_init + tb7_init + tb8_init + tb9_init + tempoval + vco2init + vdelayxq + vdelayxs + vdelayxw + vecdelay + wgpluck2 + wterrain + xscanmap + zfilter2 + FLbutBank + FLgetsnap + FLpackEnd + FLprintk2 + FLsetFont + FLsetSize + FLsetText + FLsetsnap + FLslidBnk + FLtabsEnd + dripwater + eventname + ktableseg + noteondur + osciliktp + oscilikts + pgmassign + phasorbnk + pitchamdf + pvbufread + readclock + sandpaper + scantable + schedwhen + sfinstr3m + sfpassign + slider16f + slider32f + slider64f + sndwarpst + soundoutc + soundouts + tablecopy + tableigpw + tableimix + tablexseg + tb10_init + tb11_init + tb12_init + tb13_init + tb14_init + tb15_init + timeinstk + timeinsts + vbap4move + vbap8move + vbapzmove + vdelayxwq + vdelayxws + xscansmap + FLgroupEnd + FLloadsnap + FLpack_end + FLpanelEnd + FLsavesnap + FLsetAlign + FLsetColor + FLsetVal_i + FLtabs_end + filenchnls + noteondur2 + scanhammer + schedkwhen + tableicopy + tambourine + vbap16move + vbaplsinit + wgbowedbar + FLgroup_end + FLpanel_end + FLscrollEnd + FLsetColor2 + mididefault + midinoteoff + sleighbells + FLscroll_end + subinstrinit + FLsetPosition + FLsetTextSize + FLsetTextType + midinoteoncps + midinoteonkey + midinoteonoct + midinoteonpch + midipitchbend + schedwhenname + FLsetTextColor + schedkwhenname + midicontrolchange + midiprogramchange + midipolyaftertouch + midichannelaftertouch + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/css.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/css.plist new file mode 100644 index 00000000..00812049 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/css.plist @@ -0,0 +1,538 @@ + + + + + beginCommand + + endCommand + + beginInstruction + { + endInstruction + } + beginVariable + : + endVariable + ;, + firstString + " + secondString + + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + .*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + + autocompleteWords + + background + background-attachment + background-color + background-image + background-position + background-repeat + color + font + font-family + font-size + font-size-adjust + font-style + font-variant + font-weight + font-stretch + src + definition-src + unicode-range + panose-1 + stemv + stemh + units-per-em + slope + cap-height + x-height + ascent + descent + baseline + centerline + mathline + topline + letter-spacing + text-align + text-shadow + text-decoration + text-indent + text-transform + word-spacing + letter-spacing + white-space + border + bottom + border-collapse + border-spacing + border-bottom + border-bottom-style + border-bottom-width + border-bottom-color + border-left + border-left-style + border-left-width + border-left-color + border-right + border-right-style + border-right-width + border-right-color + border-top + border-top-style + border-top-width + border-top-color + border-color + border-style + border-width + clear + float + height + margin + margin-bottom + margin-left + margin-right + margin-top + padding + padding-bottom + padding-left + padding-right + padding-top + clear + display + position + top + right + bottom + left + float + z-index + direction + unicode-bidi + width + min-width + max-width + height + min-height + max-height + line-height + vertical-align + overflow + clip + visibility + content + :after + :before + quotes + counter-reset + counter-increment + marker-offset + list-style + list-style-image + list-style-position + list-style-type + size + marks + page-break-before + page-break-after + page-break-inside + page + orphans + widows + caption-side + table-layout + border-collapse + border-spacing + empty-cells + speak-headers + @import + @media + @page + @font-face + cursor + outline + outline-width + outline-style + outline-color + azimuth + volume + speak + pause + pause-before + pause-after + cue + cue-before + cue-after + play-during + elevation + speech-rate + voice-family + pitch + pitch-range + stress + richness + speak-punctuation + speak-numeral + speak-header-cell + rgb + url + left-side + far-left + center-left + center + right + center-right + far-right + right-side + justify + behind + leftwards + rightwards + inherit + scroll + fixed + transparent + none + repeat + repeat-x + repeat-y + no-repeat + collapse + separate + auto + open-quote + close-quote + no-open-quote + no-close-quote + cue-before + cue-after + crosshair + default + pointer + move + e-resize + ne-resize + nw-resize + n-resize + se-resize + sw-resize + s-resize + w-resize + text + wait + help + ltr + rtl + inline + block + list-item + run-in + compact + marker + table + inline-table + table-row-group + table-header-group + table-footer-group + table-row + table-column-group + table-column + table-cell + table-caption + below + level + above + higher + lower + show + hide + normal + wider + narrower + ultra-condensed + extra-condensed + condensed + semi-condensed + semi-expanded + expanded + extra-expanded + ultra-expanded + normal + italic + oblique + normal + xx-small + x-small + small + large + x-large + xx-large + thin + thick + smaller + larger + small-caps + inherit + bold + bolder + lighter + inside + outside + disc + circle + square + decimal + decimal-leading-zero + lower-roman + upper-roman + lower-greek + lower-alpha + lower-latin + upper-alpha + upper-latin + hebrew + armenian + georgian + cjk-ideographic + hiragana + katakana + hiragana-iroha + katakana-iroha + crop + cross + invert + hidden + always + avoid + x-low + low + high + x-high + absolute + fixed + relative + static + portrait + landscape + spell-out + digits + continuous + x-slow + slow + fast + x-fast + faster + slower + underline + overline + line-through + blink + capitalize + uppercase + lowercase + embed + bidi-override + baseline + sub + super + top + text-top + middle + bottom + text-bottom + visible + hidden + collapse + soft + loud + x-loud + pre + nowrap + dotted + dashed + solid + double + groove + ridge + inset + outset + once + both + silent + medium + mix + male + female + child + code + aliceblue + antiquewhite + aqua + aquamarine + azure + beige + bisque + black + blanchedalmond + blue + blueviolet + brown + burlywood + cadetblue + chartreuse + chocolate + coral + cornflowerblue + cornsilk + crimson + cyan + darkblue + darkcyan + darkgoldenrod + darkgray + darkgreen + darkgrey + darkkhaki + darkmagenta + darkolivegreen + darkorange + darkorchid + darkred + darksalmon + darkseagreen + darkslateblue + darkslategray + darkslategrey + darkturquoise + darkviolet + darkpink + deepskyblue + dimgray + dimgrey + dodgerblue + firebrick + floralwhite + forestgreen + fushia + gainsboro + ghostwhite + gold + goldenrod + gray + green + greenyellow + grey + honeydew + hotpink + indianred + indigo + ivory + khaki + lavender + lavenderblush + lawngreen + lemonchiffon + lightblue + lightcoral + lightcyan + lightgoldenrodyellow + lightgray + lightgreen + lightgrey + lightpink + lightsalmon + lightseagreen + lightskyblue + lightslategray + lightslategrey + lightsteelblue + lightyellow + lime + limegreen + linen + magenta + maroon + mediumaquamarine + mediumblue + mediumorchid + mediumpurple + mediumseagreen + mediumslateblue + mediumspringgreen + mediumturquoise + mediumvioletred + midnightblue + mintcream + mistyrose + mocassin + navawhite + navy + oldlace + olive + olidrab + orange + orangered + orchid + palegoldenrod + palegreen + paleturquoise + paletvioletred + papayawhip + peachpuff + peru + pink + plum + powderblue + purple + red + rosybrown + royalblue + saddlebrown + salmon + sandybrown + seagreen + seashell + sienna + silver + skyblue + slateblue + slategray + slategrey + snow + springgreen + steelblue + tan + teal + thistle + tomato + turquoise + violet + wheat + white + whitesmoke + yellow + yellowgreen + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/d.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/d.plist new file mode 100644 index 00000000..d5c9da78 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/d.plist @@ -0,0 +1,147 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + /+ + beginInstruction + + beginSecondMultiLineComment + /* + beginVariable + + endCommand + + endFirstMultiLineComment + +/ + endInstruction + + endSecondMultiLineComment + */ + endVariable + + firstSingleLineComment + // + firstString + " + functionDefinition + + removeFromFunction + + keywords + + abstract + alias + align + asm + auto + body + break + case + cast + catch + class + const + continue + default + delegate + delete + deprecated + do + else + enum + export + false + final + finally + for + foreach + function + goto + if + in + inout + interface + invariant + new + null + override + out + private + protected + public + return + static + struct + super + switch + synchronized + this + throw + true + try + template + typedef + union + volatile + while + with + module + import + void + bit + byte + ubyte + short + ushort + int + uint + long + ulong + cent + ucent + float + double + real + ireal + ifloat + idouble + creal + cfloat + cdouble + char + wchar + dchar + printf + extern + C + D + Windows + Pascal + debug + assert + version + DigitalMars + X86 + Win32 + linux + LittleEndian + BigEndian + D_InlineAsm + none + unittest + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/dylan.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/dylan.plist new file mode 100644 index 00000000..755445e4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/dylan.plist @@ -0,0 +1,108 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + < + endVariable + > + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + afterwards + above + abstract + below + begin + block + by + case + class + cleanup + concrete + constant + create + define + domain + else + elseif + end + exception + exclude + export + finally + for + from + function + functional + generic + handler + if + import + in + inherited + inline + instance + interface + library + let + local + macro + method + open + otherwise + primary + rename + sealed + select + sideways + signal + singleton + slot + subclass + then + to + unless + until + use + variable + virtual + when + while + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eiffel.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eiffel.plist new file mode 100644 index 00000000..4c2e93f7 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eiffel.plist @@ -0,0 +1,84 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + -- + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + indexing + class + inherit + creation + feature + rename + redefine + undefine + select + export + local + deferred + do + is + once + alias + external + rescue + debug + if + inspect + from + else + elseif + when + until + loop + then + obsolete + end + check + ensure + require + variant + invariant + create + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/erl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/erl.plist new file mode 100644 index 00000000..444d0824 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/erl.plist @@ -0,0 +1,84 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + % + secondSingleLineComment + % + beginFirstMultiLineComment + % + endFirstMultiLineComment + % + beginSecondMultiLineComment + % + endSecondMultiLineComment + % + functionDefinition + ^[a-z]+.*\(.*\)\s*-> + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + module + include + compile + author + vsn + behavior + behaviour + define + record + after + and + andalso + band + begin + bnot + bor + bsi + bsr + case + catch + cond + div + end + fun + if + let + not + of + or + orelse + query + receive + rem + try + when + xor + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eztpl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eztpl.plist new file mode 100644 index 00000000..fbe1d379 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/eztpl.plist @@ -0,0 +1,733 @@ + + + + + beginCommand + { + endCommand + } + beginInstruction + <? + endInstruction + ?> + beginVariable + $ + endVariable + :;(){}=[]+-/,*!?%&><\ + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + # + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*(static)?\s*(private|protected|public)?\s*(static)?\s*function\s+.*\n?\s*{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + case + if + while + do + for + foreach + switch + delimiter + run-once + default + set-block + let + append-block + cache-block + + as + break + continue + skip + section-exclude + section-include + else + elseif + + case + if + while + do + for + foreach + switch + delimiter + run-once + default + set-block + section + let + append-block + cache-block + + def + undef + set + ldelim + rdelim + include + + + debug_accumulator + debug_timing_point + debug_trace + + cache-block + fetch_alias + include + ldelim + literal + rdelim + run-once + + append-block + def + sequence + set + set-block + undef + + attribute_edit_gui + attribute_pdf_gui + attribute_result_gui + attribute_view_gui + class_attribute_edit_gui + class_attribute_view_gui + collaboration_icon + collaboration_participation_view + collaboration_simple_message_view + collaboration_view_gui + content_pdf_gui + content_version_view_gui + content_view_gui + event_edit_gui + node_view_gui + related_view_gui + shop_account_view_gui + tool_bar + + attribute_list + latest_list + list + override_template_list + + group_tree + item_count + item_list + message_list + participant + participant_list + participant_map + tree_count + + access + bookmarks + calendar + can_instantiate_classes + can_instantiate_class_list + class + class_attribute + class_attribute_list + collected_info_collection + collected_info_count + collected_info_count_list + contentobject_attributes + draft_count + draft_version_list + keyword + keyword_count + list + list_count + locale_list + navigation_part + navigation_parts + node + non_translation_list + object + object_by_attribute + object_count_by_user_id + pending_count + pending_list + recent + related_objects + related_objects_count + reverse_related_objects + reverse_related_objects_count + same_classattribute_node + search + section_list + tipafriend_top_list + translation_list + trash_count + trash_object_list + tree + tree_count + version + version_count + version_list + view_top_list + + sitedesign_list + + digest_handlers + digest_items + event_content + handler_list + subscribed_nodes + subscribed_nodes_count + + can_create + can_edit + can_export + can_import + can_install + can_list + can_read + can_remove + dependent_list + item + list + maintainer_role_list + repository_list + + object + object_list + object_list_count + roles + user_roles + + basket + best_sell_list + related_purchase + wish_list + wish_list_count + + list + list_count + + anonymous_count + current_user + has_access_to + is_logged_in + logged_in_count + logged_in_list + logged_in_users + member_of + user_role + + + append + array + array_sum + begins_with + compare + contains + ends_with + explode + extract + extract_left + extract_right + hash + implode + insert + merge + prepend + remove + repeat + reverse + unique + + currentdate + ezhttp + ezini + ezpreference + ezsys + fetch + module_params + + datetime + i18n + l10n + si + + image + imagefile + texttoimage + + and + choose + cond + eq + false + first_set + ge + gt + le + lt + ne + not + null + or + true + + abs + ceil + dec + div + floor + inc + max + min + mod + mul + round + sub + sum + + action_icon + attribute + classgroup_icon + class_icon + content_structure_tree + ezpackage + flag_icon + gettime + icon_info + makedate + maketime + mimetype_icon + month_overview + pdf + roman + topmenu + treemenu + + append + autolink + begins_with + break + chr + compare + concat + contains + count_chars + count_words + crc32 + downcase + ends_with + explode + extract + extract left + extract_right + indent + insert + md5 + nl2br + ord + pad + prepend + remove + repeat + reverse + rot13 + shorten + simpletags + simplify + trim + upcase + upfirst + upword + wash + wordtoimage + wrap + + exturl + ezdesign + ezimage + ezroot + ezurl + + count + float + get_class + get_type + int + is_array + is_boolean + is_class + is_float + is_integer + is_null + is_numeric + is_object + is_set + is_string + is_unset + + autocompleteWords + + case + if + while + do + for + foreach + switch + delimiter + run-once + default + set-block + let + append-block + cache-block + + as + break + continue + skip + section-exclude + section-include + else + elseif + + case + if + while + do + for + foreach + switch + delimiter + run-once + default + set-block + section + let + append-block + cache-block + + def + undef + set + ldelim + rdelim + include + + + debug_accumulator + debug_timing_point + debug_trace + + cache-block + fetch_alias + include + ldelim + literal + rdelim + run-once + + append-block + def + sequence + set + set-block + undef + + attribute_edit_gui + attribute_pdf_gui + attribute_result_gui + attribute_view_gui + class_attribute_edit_gui + class_attribute_view_gui + collaboration_icon + collaboration_participation_view + collaboration_simple_message_view + collaboration_view_gui + content_pdf_gui + content_version_view_gui + content_view_gui + event_edit_gui + node_view_gui + related_view_gui + shop_account_view_gui + tool_bar + + attribute_list + latest_list + list + override_template_list + + group_tree + item_count + item_list + message_list + participant + participant_list + participant_map + tree_count + + access + bookmarks + calendar + can_instantiate_classes + can_instantiate_class_list + class + class_attribute + class_attribute_list + collected_info_collection + collected_info_count + collected_info_count_list + contentobject_attributes + draft_count + draft_version_list + keyword + keyword_count + list + list_count + locale_list + navigation_part + navigation_parts + node + non_translation_list + object + object_by_attribute + object_count_by_user_id + pending_count + pending_list + recent + related_objects + related_objects_count + reverse_related_objects + reverse_related_objects_count + same_classattribute_node + search + section_list + tipafriend_top_list + translation_list + trash_count + trash_object_list + tree + tree_count + version + version_count + version_list + view_top_list + + sitedesign_list + + digest_handlers + digest_items + event_content + handler_list + subscribed_nodes + subscribed_nodes_count + + can_create + can_edit + can_export + can_import + can_install + can_list + can_read + can_remove + dependent_list + item + list + maintainer_role_list + repository_list + + object + object_list + object_list_count + roles + user_roles + + basket + best_sell_list + related_purchase + wish_list + wish_list_count + + list + list_count + + anonymous_count + current_user + has_access_to + is_logged_in + logged_in_count + logged_in_list + logged_in_users + member_of + user_role + + + append + array + array_sum + begins_with + compare + contains + ends_with + explode + extract + extract_left + extract_right + hash + implode + insert + merge + prepend + remove + repeat + reverse + unique + + currentdate + ezhttp + ezini + ezpreference + ezsys + fetch + module_params + + datetime + i18n + l10n + si + + image + imagefile + texttoimage + + and + choose + cond + eq + false + first_set + ge + gt + le + lt + ne + not + null + or + true + + abs + ceil + dec + div + floor + inc + max + min + mod + mul + round + sub + sum + + action_icon + attribute + classgroup_icon + class_icon + content_structure_tree + ezpackage + flag_icon + gettime + icon_info + makedate + maketime + mimetype_icon + month_overview + pdf + roman + topmenu + treemenu + + append + autolink + begins_with + break + chr + compare + concat + contains + count_chars + count_words + crc32 + downcase + ends_with + explode + extract + extract left + extract_right + indent + insert + md5 + nl2br + ord + pad + prepend + remove + repeat + reverse + rot13 + shorten + simpletags + simplify + trim + upcase + upfirst + upword + wash + wordtoimage + wrap + + exturl + ezdesign + ezimage + ezroot + ezurl + + count + float + get_class + get_type + int + is_array + is_boolean + is_class + is_float + is_integer + is_null + is_numeric + is_object + is_set + is_string + is_unset + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/f-script.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/f-script.plist new file mode 100644 index 00000000..10fc9246 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/f-script.plist @@ -0,0 +1,171 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + ' + secondString + + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + " + endFirstMultiLineComment + " + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^(-|\+).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + self + super + do: + to: + count + at + insert + put + removeAt + true + false + YES + NO + nil + with: + inject: + into: + ifFalse + ifTrue + whileTrue + whileFalse + asSortedCollection: + collect: + select: + reject: + allSatisfy: + GSMime + GSXML + NSAffineTransform + NSAriver + NSArray + NSAttributedString + NSAutoreleasePool + NSBundle + NSByteOrder + NSCalendarDate + NSaracterSet + NSClassDescription + NSCoder + NSComparisonPredicate + NSCompoundPredicate + NSConnection + NSData + NSDateFormatter + NSDate + NSDebug + NSDecimal + NSDecimalNumber + NSDictionary + NSDistantObject + NSDistributedLock + NSDistributedNotificationCenter + NSEnumerator + NSError + NSErrorRecoveryAttempting + NSException + NSExpression + NSFileHandle + NSFileManager + NSFormatter + NSGeometry + NSHashTable + NSHost + NSHTTPCookie + NSHTTPCookieStorage + NSIndexPath + NSIndexSet + NSInvocation + NSKeyedAriver + NSKeyValueCoding + NSKeyValueObserving + NSLock + NSMapTable + NSMethodSignature + NSNetServices + NSNotification + NSNotificationQueue + NSNull + NSNumberFormatter + NSObjCRuntime + NSObject + NSPaUtilities + NSPortCoder + NSPort + NSPortMessage + NSPortNameServer + NSPredicate + NSProcessInfo + NSPropertyList + NSProtocolecker + NSProxy + NSRange + NSRunLoop + NSScanner + NSSerialization + NSSet + NSSortDescriptor + NSSpellServer + NSStream + NSString + NSTask + NSRead + NSTimer + NSTimeZone + NSUndoManager + NSURLAuenticationallenge + NSURLCae + NSURLConnection + NSURLCredential + NSURLCredentialStorage + NSURLDownload + NSURLError + NSURL + NSURLHandle + NSURLProtectionSpace + NSURLProtocol + NSURLRequest + NSURLResponse + NSUserDefaults + NSUtilities + NSValue + NSValueTransformer + NSXMLParser + NSZone + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/fortran.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/fortran.plist new file mode 100644 index 00000000..a4f6ce6c --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/fortran.plist @@ -0,0 +1,213 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + ! + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(function|subroutine)\s+\w+ + removeFromFunction + subroutine + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + common + continue + block + data + date + function + include + parameter + implicit + none + equivalence + if + then + else + elseif + endif + go + to + goto + program + subroutine + end + call + while + cycle + do + enddo + for + break + pause + return + stop + access + backspace + close + inquire + open + print + read + rewind + write + format + abs + acos + aimag + aint + alog + alog10 + amax0 + amax1 + amin0 + amin1 + amod + anint + aprime + asin + atan + atan2 + acos + cabs + cexp + clog + conjg + cos + cosh + ccos + csin + csqrt + dabs + dacos + dasin + datan + datan2 + dconjg + dcos + dcosh + dfloat + ddmim + dexp + dim + dint + dlog + dlog10 + dmax1 + dmin1 + dmod + dnint + dsign + dsin + dsinh + dsqrt + dtan + dtanh + exp + iabs + idim + index + isign + len + log + log10 + max + max0 + max1 + min + min0 + min1 + mod + rand + sign + sin + sinh + sqrt + tan + tanh + character + complex + double + precision + real + real*8 + integer + logical + dimension + external + intrinsic + save + char + cmplx + dble + dcmplx + float + ichar + idint + ifix + int + sngl + use + module + endmodule + interface + endinterface + contains + type + endtype + allocate + deallocate + allocatable + private + intent + in + out + inout + pointer + target + select + endselect + case + endcase + recursive + nullify + endfunction + only + public + exit + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/freefem.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/freefem.plist new file mode 100644 index 00000000..ce1b5761 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/freefem.plist @@ -0,0 +1,149 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + adaptmesh + Cmatrix + R3 + bool + border + break + buildmesh + cin + complex + continue + cout + element + else + end + fespace + for + func + if + ifstream + include + int + intalledge + load + macro + matrix + mesh + movemesh + ofstream + namespace + plot + problem + real + return + savemesh + solve + string + vertex + varf + while + int1d + int2d + on + square + dx + dy + convect + jump + mean + wait + ps + solver + CG + LU + UMFPACK + factorize + init + endl + x + y + z + pi + i + sin + cos + tan + atan + asin + acos + cotan + sinh + cosh + tanh + cotanh + exp + log + log10 + sqrt + abs + max + min + nbvx + label + region + value + set + fill + true + false + trunc + triangulate + splitmesh + savemesh + region + readmesh + randreal1 + randreal2 + randreal3 + randint31 + randint32 + randres53 + polar + pow + on + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gedcom.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gedcom.plist new file mode 100644 index 00000000..398fce4d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gedcom.plist @@ -0,0 +1,190 @@ + + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + firstString + " + secondString + ' + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + _UID + ABBR + ADDR + ADR1 + ADR2 + ADOP + AFN + AGE + AGNC + ALIA + ANCE + ANCI + ANUL + ASSO + AUTH + BAPL + BAPM + BARM + BASM + BIRT + BLES + BLOB + BURI + CALN + CAST + CAUS + CENS + CHAN + CHAR + CHIL + CHR + CHRA + CITY + CONC + CONF + CONL + CONT + COPR + CORP + CREM + CTRY + DATA + DATE + DEAT + DESC + DESI + DEST + DIV + DIVF + DSCR + EDUC + EMAIL + EMIG + ENDL + ENGA + EVEN + FAM + FAMC + FAMF + FAMS + FCOM + FILE + FORM + GEDC + GIVN + GRAD + HEAD + HUSB + IDNO + IMMI + INDI + INFL + LANG + LEGA + MARB + MARC + MARL + MARR + MARS + MEDI + NAME + NATI + NATU + NCHI + NICK + NMR + NOTE + NPFX + NSFX + OBJE + OCCU + ORDI + ORDN + PAGE + PEDI + PHON + PLAC + POST + PROB + PROP + PUBL + QUAY + REFN + RELA + RELI + REPO + RESI + RESN + RETI + RFN + RIN + ROLE + SEX + SLGC + SLGS + SOUR + SPFX + SSN + STAE + STAT + SUBM + SUBN + SURN + TEMP + TEXT + TIME + TITL + TRLR + TYPE + VERS + WIFE + WILL + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/glsl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/glsl.plist new file mode 100644 index 00000000..1de041c8 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/glsl.plist @@ -0,0 +1,295 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + IMG_PIXEL + IMG_NORM_PIXEL + IMG_THIS_PIXEL + IMG_THIS_NORM_PIXEL + PASSINDEX + RENDERSIZE + isf_FragNormCoord + TIME + attribute + varying + const + uniform + break + continue + do + for + while + if + else + in + out + inout + true + false + discard + return + struct + invariant + centroid + lowp + mediump + highp + precision + float + int + void + bool + mat2 + mat3 + mat4 + vec2 + vec3 + vec4 + ivec2 + ivec3 + ivec4 + bvec2 + bvec3 + bvec4 + sampler2D + samplerCube + sampler1D + sampler3D + sampler1DShadow + sampler2DShadow + mat2x2 + mat3x2 + mat4x2 + mat2x3 + mat3x3 + mat4x3 + mat2x4 + mat3x4 + mat4x4 + uint + uvec2 + uvec3 + uvec4 + samplerCubeShadow + sampler1DArray + sampler2DArray + sampler1DArrayShadow + sampler2DArrayShadow + isampler1D + isampler2D + isampler3D + isamplerCube + isampler1DArray + isampler2DArray + usampler1D + usampler2D + usampler3D + usamplerCube + usampler1DArray + usampler2DArray + gl_FragColor + gl_FragData + gl_Vertex + gl_MultiTexCoord0 + gl_MultiTexCoord1 + gl_MultiTexCoord2 + gl_MultiTexCoord3 + gl_MultiTexCoord4 + gl_MultiTexCoord5 + gl_MultiTexCoord6 + gl_MultiTexCoord7 + gl_FogCoord + gl_ModelViewMatrix + gl_ProjectionMatrix + gl_ModelViewProjectionMatrix + gl_TextureMatrix + gl_NormalMatrix + gl_ModelViewMatrixInverse + gl_ProjectionMatrixInverse + gl_ModelViewProjectionMatrixInverse + gl_TextureMatrixInverse + gl_ModelViewMatrixTranspose + gl_ProjectionMatrixTranspose + gl_ModelViewProjectionMatrixTranspose + gl_TextureMatrixTranspose + gl_ModelViewMatrixInverseTranspose + gl_ProjectionMatrixInverseTranspose + gl_ModelViewProjectionMatrixInverseTranspose + gl_TextureMatrixInverseTranspose + gl_NormalScale + gl_DepthRangeParameters + gl_DepthRange + gl_ClipPlane + gl_PointParameters + gl_Point + gl_MaterialParameters + gl_FrontMaterial + gl_BackMaterial + gl_LightSourceParameters + gl_LightSource + gl_LightModelParameters + gl_LightModel + gl_LightModelProducts + gl_FrontLightModelProduct + gl_BackLightModelProduct + gl_LightProducts + gl_FrontLightProduct + gl_BackLightProduct + gl_TextureEnvColor + gl_EyePlaneS + gl_EyePlaneT + gl_EyePlaneR + gl_EyePlaneQ + gl_ObjectPlaneS + gl_ObjectPlaneT + gl_ObjectPlaneR + gl_ObjectPlaneQ + gl_FogParameters + gl_FrontColor + gl_BackColor + gl_FrontSecondaryColor + gl_BackSecondaryColor + gl_TexCoord + gl_Color + gl_SecondaryColor + gl_Position + gl_PointSize + gl_ClipDistance + gl_VertexID + gl_FragCoord + gl_FragDepth + gl_FrontFacing + gl_PointCoord + gl_MaxLights + gl_MaxClipPlanes + gl_MaxTextureUnits + gl_MaxTextureCoords + gl_MaxVertexAttribs + gl_MaxVertexUniformComponents + gl_MaxVaryingFloats + gl_MaxVertexTextureImageUnits + gl_MaxCombinedTextureImageUnits + gl_MaxTextureImageUnits + gl_MaxFragmentUniformComponents + gl_MaxDrawBuffers + gl_NumSamples + texture2D + texture2DProj + texture2DLod + texture2DProjLod + textureCube + textureCubeLod + ftransform + texture1D + texture1DProj + texture1DLod + texture1DProjLod + texture3D + texture3DProj + texture3DLod + texture3DProjLod + shadow1D + shadow2D + shadow1DProj + shadow2DProj + shadow1DLod + shadow2DLod + shadow1DProjLod + shadow2DProjLod + radians + degrees + sin + cos + tan + asin + acos + atan + pow + exp + log + exp2 + log2 + sqrt + inversesqrt + abs + sign + floor + ceil + fract + mod + min + max + clamp + mix + step + smoothstep + length + distance + dot + cross + normalize + faceforward + reflect + refract + matrixCompMult + lessThan + lessThenEqual + greaterThan + greaterThanEqual + equal + notEqual + any + all + not + dFdx + dFdy + fwidth + noise1 + noise2 + noise3 + noise4 + outerProduct + transpose + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gnuassembler.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gnuassembler.plist new file mode 100644 index 00000000..003ef898 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/gnuassembler.plist @@ -0,0 +1,228 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + @ + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + includeInKeywordStartCharacterSet + . + keywords + + .abort + .align + .appfile + .appline + .ascii + .asciz + .balign + .balignl + .balignw + .byte + .comm + .common.s + .common + .data + .dc.b + .dc.d + .dc.l + .dc.s + .dc.w + .dc.x + .dc + .dcb.b + .dcb.d + .dcb.l + .dcb.s + .dcb.w + .dcb.x + .dcb + .debug + .def + .desc + .dim + .double + .ds.b + .ds.d + .ds.l + .ds.p + .ds.s + .ds.w + .ds.x + .ds + .dsect + .eject + .else + .elsec + .elseif + .end + .endc + .endef + .endfunc + .endif + .endm + .endr + .equ + .equiv + .err + .exitm + .extend + .extern + .fail + .file + .fill + .float + .format + .func + .global + .globl + .hidden + .hword + .ident + .if + .ifc + .ifdef + .ifeq + .ifeqs + .ifge + .ifgt + .ifle + .iflt + .ifnc + .ifndef + .ifne + .ifnes + .ifnotdef + .include + .int + .internal + .irep + .irepc + .irp + .irpc + .lcomm + .lflags + .line + .linkonce + .list + .llen + .ln + .long + .lsym + .macro + .mexit + .name + .noformat + .nolist + .nopage + .octa + .offset + .org + .p2align + .p2alignl + .p2alignw + .page + .plen + .popsection + .previous + .print + .protected + .psize + .purgem + .pushsection + .quad + .rep + .rept + .rva + .sbttl + .scl + .sect.s + .sect + .section.s + .section + .set + .short + .single + .size + .skip + .sleb128 + .space + .spc + .stabd + .stabn + .stabs + .string + .struct + .subsection + .symver + .tag + .text + .title + .ttl + .type + .uleb128 + .use + .val + .version + .vtable_entry + .vtable_inherit + .weak + .word + .xcom + .xdef + .xref + .xstabs + .zero + .arm + .bss + .code + .even + .force_thumb + .ldouble + .loc + .ltorg + .packed + .pool + .req + .thumb + .thumb_func + .thumb_set + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/graphviz.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/graphviz.plist new file mode 100644 index 00000000..39082383 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/graphviz.plist @@ -0,0 +1,207 @@ + + + + + beginCommand + + endCommand + + beginInstruction + {[ + endInstruction + ]} + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + strict + graph + digraph + subgraph + node + edge + Damping + K + URL + arrowhead + arrowsize + arrowtail + aspect + bb + bgcolor + center + charset + clusterrank + color + colorscheme + comment + compound + concentrate + constraint + decorate + defaultdist + dim + dimen + dir + diredgeconstraints + distortion + dpi + edgeURL + edgehref + edgetarget + edgetooltip + epsilon + esep + fillcolor + fixedsize + fontcolor + fontname + fontnames + fontpath + fontsize + group + headURL + headclip + headhref + headlabel + headport + headtarget + headtooltip + height + href + id + image + imagescale + label + labelURL + labelangle + labeldistance + labelfloat + labelfontcolor + labelfontname + labelfontsize + labelhref + labeljust + labelloc + labeltarget + labeltooltip + landscape + layer + layers + layersep + layout + len + levels + levelsgap + lhead + lheight + lp + ltail + lwidth + margin + maxiter + mclimit + mindist + minlen + mode + model + mosek + nodesep + nojustify + normalize + nslimit + nslimit1 + ordering + orientation + orientation + outputorder + overlap + overlap_scaling + pack + packmode + pad + page + pagedir + pencolor + penwidth + peripheries + pin + pos + quadtree + quantum + rank + rankdir + ranksep + ratio + rects + regular + remincross + repulsiveforce + resolution + root + rotate + samehead + sametail + samplepoints + searchsize + sep + shape + shapefile + showboxes + sides + size + skew + smoothing + sortv + splines + start + style + stylesheet + tailURL + tailclip + tailhref + taillabel + tailport + tailtarget + tailtooltip + target + tooltip + truecolor + vertices + viewport + voro_margin + weight + width + z + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/haskell.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/haskell.plist new file mode 100644 index 00000000..c54d7f5c --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/haskell.plist @@ -0,0 +1,472 @@ + + + + + autocompleteWords + + case + data + where + then + else + class + default + deriving + import + infix + infixl + infixr + instance + module + newtype + type + unfoldr + groupBy + sortBy + group + sort + zipWith3 + zipWith + zip3 + zip + writeFile + words + userError + unzip3 + unzip + unwords + until + unlines + undefined + uncurry + truncate + toRational + toInteger + tanh + toEnum + tan + takeWhile + take + tail + sum + succ + subtract + sqrt + splitAt + snd + sinh + sin + signum + significand + showString + showsPrec + shows + showParen + showList + showChar + show + sequence_ + sequence + seq + scanr1 + scanr + scanl1 + scanl + scaleFloat + round + reverse + return + replicate + repeat + rem + recip + realToFrac + readsPrec + reads + readParen + readLn + readList + readIO + readFile + read + quotRem + quot + putStrLn + putStr + putChar + properFraction + product + print + pred + pi + otherwise + or + odd + null + notElem + not + negate + mod + minimum + minBound + min + maybe + maximum + maxBound + max + mapM_ + mapM + map + lookup + logBase + log + lines + lex + length + lcm + last + iterate + isNegativeZero + isNaN + isInfinite + isIEEE + isDenormalized + ioError + interact + init + id + head + getLine + getContents + getChar + gcd + fst + fromRational + fromIntegral + fromInteger + fromEnum + foldr1 + foldr + foldl1 + foldl + fmap + floor + floatRange + floatRadix + floatDigits + flip + filter + fail + exponent + exp + even + error + enumFromTo + enumFromThenTo + enumFromThen + enumFrom + encodeFloat + elem + either + dropWhile + drop + divMod + div + decodeFloat + cycle + curry + cos + const + concatMap + concat + compare + ceiling + catch + break + atanh + atan2 + atan + asTypeOf + asinh + asin + appendFile + any + and + all + acos + abs + + beginCommand + + beginFirstMultiLineComment + {- + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + -} + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + -- + firstString + " + functionDefinition + + keywords + + Read + Show + Ord + Num + MonadPlus + Monad + Ix + Integral + Functor + Fractional + Floating + Eq + Enum + Bounded + Maybe + IO + Integer + Either + Bool + Array + Double + Float + Char + String + Int + unfoldr + groupBy + sortBy + group + sort + zipWith3 + zipWith + zip3 + zip + writeFile + words + userError + unzip3 + unzip + unwords + until + unlines + undefined + uncurry + truncate + toRational + toInteger + tanh + toEnum + tan + takeWhile + take + tail + sum + succ + subtract + sqrt + splitAt + snd + sinh + sin + signum + significand + showString + showsPrec + shows + showParen + showList + showChar + show + sequence_ + sequence + seq + scanr1 + scanr + scanl1 + scanl + scaleFloat + round + reverse + return + replicate + repeat + rem + recip + realToFrac + readsPrec + reads + readParen + readLn + readList + readIO + readFile + read + quotRem + quot + putStrLn + putStr + putChar + properFraction + product + print + pred + pi + otherwise + or + odd + null + notElem + not + negate + mod + minimum + minBound + min + maybe + maximum + maxBound + max + mapM_ + mapM + map + lookup + logBase + log + lines + lex + length + lcm + last + iterate + isNegativeZero + isNaN + isInfinite + isIEEE + isDenormalized + ioError + interact + init + id + head + getLine + getContents + getChar + gcd + fst + fromRational + fromIntegral + fromInteger + fromEnum + foldr1 + foldr + foldl1 + foldl + fmap + floor + floatRange + floatRadix + floatDigits + flip + filter + fail + exponent + exp + even + error + enumFromTo + enumFromThenTo + enumFromThen + enumFrom + encodeFloat + elem + either + dropWhile + drop + divMod + div + decodeFloat + cycle + curry + cos + const + concatMap + concat + compare + ceiling + catch + break + atanh + atan2 + atan + asTypeOf + asinh + asin + appendFile + any + and + all + acos + abs + case + data + if + where + then + else + class + default + deriving + do + import + in + infix + infixl + infixr + instance + let + module + let + newtype + of + type + .. + : + :: + = + \ + | + <- + -> + @ + ~ + => + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/header.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/header.plist new file mode 100644 index 00000000..ef073cb1 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/header.plist @@ -0,0 +1,200 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + #import + #include + char + const + double + enum + float + int + long + short + signed + struct + typedef + union + unsigned + void + id + Class + SEL + IMP + BOOL + auto + continue + default + extern + register + return + sizeof + static + self + super + @interface + @implementation + @protocol + @end + @private + @protected + @public + @class + @selector + @endcode + @defs + NULL + nil + NIl + wchar_t + #define + #endif + #if + #ifdef + #ifndef + unichar + FoundationErrors + Foundation + GSMime + GSXML + NSAffineTransform + NSAriver + NSArray + NSAttributedString + NSAutoreleasePool + NSBundle + NSByteOrder + NSCalendarDate + NSaracterSet + NSClassDescription + NSCoder + NSComparisonPredicate + NSCompoundPredicate + NSConnection + NSData + NSDateFormatter + NSDate + NSDebug + NSDecimal + NSDecimalNumber + NSDictionary + NSDistantObject + NSDistributedLock + NSDistributedNotificationCenter + NSEnumerator + NSError + NSErrorRecoveryAttempting + NSException + NSExpression + NSFileHandle + NSFileManager + NSFormatter + NSGeometry + NSHaTable + NSHost + NSHTTPCookie + NSHTTPCookieStorage + NSIndexPa + NSIndexSet + NSInvocation + NSKeyedAriver + NSKeyValueCoding + NSKeyValueObserving + NSLock + NSMapTable + NSMeodSignature + NSNetServices + NSNotification + NSNotificationQueue + NSNull + NSNumberFormatter + NSObjCRuntime + NSObject + NSPaUtilities + NSPortCoder + NSPort + NSPortMessage + NSPortNameServer + NSPredicate + NSProcessInfo + NSPropertyList + NSProtocolecker + NSProxy + NSRange + NSRunLoop + NSScanner + NSSerialization + NSSet + NSSortDescriptor + NSSpellServer + NSStream + NSString + NSTask + NSread + NSTimer + NSTimeZone + NSUndoManager + NSURLAuenticationallenge + NSURLCae + NSURLConnection + NSURLCredential + NSURLCredentialStorage + NSURLDownload + NSURLError + NSURL + NSURLHandle + NSURLProtectionSpace + NSURLProtocol + NSURLRequest + NSURLResponse + NSUserDefaults + NSUtilities + NSValue + NSValueTransformer + NSXMLParser + NSZone + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/html.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/html.plist new file mode 100644 index 00000000..7e2ad8ad --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/html.plist @@ -0,0 +1,284 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + <!-- + endFirstMultiLineComment + --> + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*<\/{0}div.*> + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/idl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/idl.plist new file mode 100644 index 00000000..2128c86f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/idl.plist @@ -0,0 +1,1365 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + ; + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + (^pro [^[:cntrl:]]*|^PRO [^[:cntrl:]]*|^Pro [^[:cntrl:]]*|^function [^[:cntrl:]]*|^Function [^[:cntrl:]]*|^FUNCTION [^[:cntrl:]]*) + removeFromFunction + ,;* + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + eq + lt + gt + !P.MULTI + !P.FONT + openw + endif + if + then + begin + else + endelse + repeat + until + while + do + end + endcase + endfor + of + .COMPILE + .CONTINUE + .EDIT + .FULL_RESET_SESSION + .GO + .OUT + .RESET_SESSION + .RETURN + .RNEW + .RUN + .SKIP + .STEP + .STEPOVER + .TRACE + A_CORRELATE + ABS + ACOS + ADAPT_HIST_EQUAL + ALOG + ALOG10 + AMOEBA + ANNOTATE + ARG_PRESENT + ARRAY_EQUAL + ARRAY_INDICES + ARROW + ASCII_TEMPLATE + ASIN + ASSOC + ATAN + AXIS + BAR_PLOT + BESELI + BESELJ + BESELK + BESELY + BETA + BILINEAR + BIN_DATE + BINARY_TEMPLATE + BINDGEN + BINOMIAL + BLAS_AXPY + BLK_CON + BOX_CURSOR + BREAK + BREAKPOINT + BROYDEN + BYTARR + BYTE + BYTEORDER + BYTSCL + C_CORRELATE + CALDAT + CALENDAR + CALL_EXTERNAL + CALL_FUNCTION + CALL_METHOD + CALL_PROCEDURE + CASE + CATCH + CD + CEIL + CHEBYSHEV + CHECK_MATH + CHISQR_CVF + CHISQR_PDF + CHOLDC + CHOLSOL + CINDGEN + CIR_3PNT + CLOSE + CLUST_WTS + CLUSTER + COLOR_CONVERT + COLOR_QUAN + COLORMAP_APPLICABLE + COMFIT + COMMON + COMPILE_OPT + COMPLEX + COMPLEXARR + COMPLEXROUND + COMPUTE_MESH_NORMALS + COND + CONGRID + CONJ + CONSTRAINED_MIN + CONTINUE + CONTOUR + CONVERT_COORD + CONVOL + COORD2TO3 + COPY_LUN + CORRELATE + COS + COSH + CPU + CRAMER + CREATE_STRUCT + CREATE_VIEW + CROSSP + CRVLENGTH + CT_LUMINANCE + CTI_TEST + CURSOR + CURVEFIT + CV_COORD + CVTTOBM + CW_ANIMATE + CW_ANIMATE_GETP + CW_ANIMATE_LOAD + CW_ANIMATE_RUN + CW_ARCBALL + CW_BGROUP + CW_CLR_INDEX + CW_COLORSEL + CW_DEFROI + CW_FIELD + CW_FILESEL + CW_FORM + CW_FSLIDER + CW_LIGHT_EDITOR + CW_LIGHT_EDITOR_GET + CW_LIGHT_EDITOR_SET + CW_ORIENT + CW_PALETTE_EDITOR + CW_PALETTE_EDITOR_GET + CW_PALETTE_EDITOR_SET + CW_PDMENU + CW_RGBSLIDER + CW_TMPL + CW_ZOOM + DBLARR + DCINDGEN + DCOMPLEX + DCOMPLEXARR + DEFINE_KEY + DEFINE_MSGBLK + DEFINE_MSGBLK_FROM_FILE + DEFROI + DEFSYSV + DELVAR + DERIV + DERIVSIG + DETERM + DEVICE + DFPMIN + DIAG_MATRIX + DIALOG_MESSAGE + DIALOG_PICKFILE + DIALOG_PRINTERSETUP + DIALOG_PRINTJOB + DIALOG_READ_IMAGE + DIALOG_WRITE_IMAGE + DIGITAL_FILTER + DILATE + DINDGEN + DISSOLVE + DIST + DLM_LOAD + DLM_REGISTER + DOC_LIBRARY + DOUBLE + DRAW_ROI + EFONT + EIGENQL + EIGENVEC + ELMHES + EMPTY + ENABLE_SYSRTN + EOF + ERASE + ERF + ERFC + ERFCX + ERODE + ERRPLOT + EXECUTE + EXIT + EXP + EXPAND + EXPAND_PATH + EXPINT + EXTRAC + EXTRACT_SLICE + F_CVF + F_PDF + FACTORIAL + FFT + FILE_BASENAME + FILE_CHMOD + FILE_COPY + FILE_DELETE + FILE_DIRNAME + FILE_EXPAND_PATH + FILE_INFO + FILE_LINES + FILE_LINK + FILE_MKDIR + FILE_MOVE + FILE_READLINK + FILE_SAME + FILE_SEARCH + FILE_TEST + FILE_WHICH + FILEPATH + FINDFILE + FINDGEN + FINITE + FIX + FLICK + FLOAT + FLOOR + FLOW3 + FLTARR + FLUSH + FOR + FORMAT_AXIS_VALUES + FORWARD_FUNCTION + FREE_LUN + FSTAT + FULSTR + FUNCT + FUNCTION + FV_TEST + FX_ROOT + FZ_ROOTS + GAMMA + GAMMA_CT + GAUSS_CVF + GAUSS_PDF + GAUSS2DFIT + GAUSSFIT + GAUSSINT + GET_DRIVE_LIST + GET_KBRD + GET_LUN + GET_SCREEN_SIZE + GETENV + GOTO + GRID_INPUT + GRID_TPS + GRID3 + GRIDDATA + GS_ITER + H_EQ_CT + H_EQ_INT + H5_BROWSER + HANNING + HDF_BROWSER + HDF_READ + HEAP_FREE + HEAP_GC + HELP + HILBERT + HIST_2D + HIST_EQUAL + HISTOGRAM + HLS + HOUGH + HQR + HSV + IBETA + ICONTOUR + IDENTITY + IDL_VALIDNAME + IDLITSYS_CREATETOOL + IGAMMA + IIMAGE + IMAGE_CONT + IMAGE_STATISTICS + IMAGINARY + INDGEN + INT_2D + INT_3D + INT_TABULATED + INTARR + INTERPOL + INTERPOLATE + INTERVAL_VOLUME + INVERT + IOCTL + IPLOT + ISHFT + ISOCONTOUR + ISOSURFACE + ISURFACE + ITCURRENT + ITDELETE + ITGETCURRENT + ITREGISTER + ITRESET + IVOLUME + JOURNAL + JULDAY + KEYWORD_SET + KRIG2D + KURTOSIS + KW_TEST + L64INDGEN + LA_CHOLDC + LA_CHOLMPROVE + LA_CHOLSOL + LA_DETERM + LA_EIGENPROBLEM + LA_EIGENQL + LA_EIGENVEC + LA_ELMHES + LA_GM_LINEAR_MODEL + LA_HQR + LA_INVERT + LA_LEAST_SQUARE_EQUALITY + LA_LEAST_SQUARES + LA_LINEAR_EQUATION + LA_LUDC + LA_LUMPROVE + LA_LUSOL + LA_SVD + LA_TRIDC + LA_TRIMPROVE + LA_TRIQL + LA_TRIRED + LA_TRISOL + LABEL_DATE + LABEL_REGION + LADFIT + LAGUERRE + LEEFILT + LEGENDRE + LINBCG + LINDGEN + LINFIT + LINKIMAGE + LL_ARC_DISTANCE + LMFIT + LMGR + LNGAMMA + LNP_TEST + LOADCT + LOCALE_GET + LOGICAL_AND + LOGICAL_OR + LOGICAL_TRUE + LON64ARR + LONARR + LONG + LONG64 + LSODE + LU_COMPLEX + LUDC + LUMPROVE + LUSOL + M_CORRELATE + MACHAR + MAKE_ARRAY + MAKE_DLL + MAP_2POINTS + MAP_CONTINENTS + MAP_GRID + MAP_IMAGE + MAP_PATCH + MAP_PROJ_FORWARD + MAP_PROJ_INFO + MAP_PROJ_INIT + MAP_PROJ_INVERSE + MAP_SET + MATRIX_MULTIPLY + MATRIX_POWER + MAX + MD_TEST + MEAN + MEANABSDEV + MEDIAN + MEMORY + MESH_CLIP + MESH_DECIMATE + MESH_ISSOLID + MESH_MERGE + MESH_NUMTRIANGLES + MESH_OBJ + MESH_SMOOTH + MESH_SURFACEAREA + MESH_VALIDATE + MESH_VOLUME + MESSAGE + MIN + MIN_CURVE_SURF + MK_HTML_HELP + MODIFYCT + MOMENT + MORPH_CLOSE + MORPH_DISTANCE + MORPH_GRADIENT + MORPH_HITORMISS + MORPH_OPEN + MORPH_THIN + MORPH_TOPHAT + MPEG_CLOSE + MPEG_OPEN + MPEG_PUT + MPEG_SAVE + MSG_CAT_CLOSE + MSG_CAT_COMPILE + MSG_CAT_OPEN + MULTI + N_ELEMENTS + N_PARAMS + N_TAGS + NEWTON + NORM + OBJ_CLASS + OBJ_DESTROY + OBJ_ISA + OBJ_NEW + OBJ_VALID + OBJARR + ON_ERROR + ON_IOERROR + ONLINE_HELP + OPEN + OPENR + OPLOT + OPLOTERR + P_CORRELATE + PARTICLE_TRACE + PATH_CACHE + PATH_SEP + PCOMP + PLOT + PLOT_3DBOX + PLOT_FIELD + PLOTERR + PLOTS + PNT_LINE + POINT_LUN + POLAR_CONTOUR + POLAR_SURFACE + POLY + POLY_2D + POLY_AREA + POLY_FIT + POLYFILL + POLYFILLV + POLYSHADE + POLYWARP + POPD + POWELL + PRIMES + PRINT + PRINTD + PRINTF + PRO + PRODUCT + PROFILE + PROFILER + PROFILES + PROJECT_VOL + PS_SHOW_FONTS + PSAFM + PSEUDO + PTR_FREE + PTR_NEW + PTR_VALID + PTRARR + PUSHD + QGRID3 + QHULL + QROMB + QROMO + QSIMP + QUERY_* Routines + QUERY_BMP + QUERY_DICOM + QUERY_IMAGE + QUERY_JPEG + QUERY_MRSID + QUERY_PICT + QUERY_PNG + QUERY_PPM + QUERY_SRF + QUERY_TIFF + QUERY_WAV + R_CORRELATE + R_TEST + RADON + RANDOMN + RANDOMU + RANKS + RDPIX + READ/READF + READ_ASCII + READ_BINARY + READ_BMP + READ_DICOM + READ_IMAGE + READ_INTERFILE + READ_JPEG + READ_MRSID + READ_PICT + READ_PNG + READ_PPM + READ_SPR + READ_SRF + READ_SYLK + READ_TIFF + READ_WAV + READ_WAVE + READ_X11_BITMAP + READ_XWD + READS + READU + REAL_PART + REBIN + RECALL_COMMANDS + RECON3 + REDUCE_COLORS + REFORM + REGION_GROW + REGISTER_CURSOR + REGRESS + REPLICATE + REPLICATE_INPLACE + RESOLVE_ALL + RESOLVE_ROUTINE + RESTORE + RETALL + RETURN + REVERSE + RK4 + ROBERTS + ROT + ROTATE + ROUND + ROUTINE_INFO + RS_TEST + S_TEST + SAVE + SAVGOL + SCALE3 + SCALE3D + SEARCH2D + SEARCH3D + SET_PLOT + SET_SHADING + SETENV + SETUP_KEYS + SFIT + SHADE_SURF + SHADE_SURF_IRR + SHADE_VOLUME + SHIFT + SHMDEBUG + SHMMAP + SHMUNMAP + SHMVAR + SHOW3 + SHOWFONT + SIMPLEX + SIN + SINDGEN + SINH + SIZE + SKEWNESS + SKIP_LUN + SLICER3 + SLIDE_IMAGE + SMOOTH + SOBEL + SOCKET + SORT + SPAWN + SPH_4PNT + SPH_SCAT + SPHER_HARM + SPL_INIT + SPL_INTERP + SPLINE + SPLINE_P + SPRSAB + SPRSAX + SPRSIN + SPRSTP + SQRT + STANDARDIZE + STDDEV + STOP + STRARR + STRCMP + STRCOMPRESS + STREAMLINE + STREGEX + STRETCH + STRING + STRJOIN + STRLEN + STRLOWCASE + STRMATCH + STRMESSAGE + STRMID + STRPOS + STRPUT + STRSPLIT + STRTRIM + STRUCT_ASSIGN + STRUCT_HIDE + STRUPCASE + SURFACE + SURFR + SVDC + SVDFIT + SVSOL + SWAP_ENDIAN + SWAP_ENDIAN_INPLACE + SWITCH + SYSTIME + T_CVF + T_PDF + T3D + TAG_NAMES + TAN + TANH + TEK_COLOR + TEMPORARY + TETRA_CLIP + TETRA_SURFACE + TETRA_VOLUME + THIN + THREED + TIME_TEST2 + TIMEGEN + TM_TEST + TOTAL + TRACE + TRANSPOSE + TRI_SURF + TRIANGULATE + TRIGRID + TRIQL + TRIRED + TRISOL + TRUNCATE_LUN + TS_COEF + TS_DIFF + TS_FCAST + TS_SMOOTH + TV + TVCRS + TVLCT + TVRD + TVSCL + UINDGEN + UINT + UINTARR + UL64INDGEN + ULINDGEN + ULON64ARR + ULONARR + ULONG + ULONG64 + UNIQ + USERSYM + VALUE_LOCATE + VARIANCE + VECTOR_FIELD + VEL + VELOVECT + VERT_T3D + VOIGT + VORONOI + VOXEL_PROJ + WAIT + WARP_TRI + WATERSHED + Wavelet Toolkit + WDELETE + WF_DRAW + WHERE + WIDGET_ACTIVEX + WIDGET_BASE + WIDGET_BUTTON + WIDGET_COMBOBOX + WIDGET_CONTROL + WIDGET_DISPLAYCONTEXTMENU + WIDGET_DRAW + WIDGET_DROPLIST + WIDGET_EVENT + WIDGET_INFO + WIDGET_LABEL + WIDGET_LIST + WIDGET_PROPERTYSHEET + WIDGET_SLIDER + WIDGET_TAB + WIDGET_TABLE + WIDGET_TEXT + WIDGET_TREE + WINDOW + WRITE_BMP + WRITE_IMAGE + WRITE_JPEG + WRITE_NRIF + WRITE_PICT + WRITE_PNG + WRITE_PPM + WRITE_SPR + WRITE_SRF + WRITE_SYLK + WRITE_TIFF + WRITE_WAV + WRITE_WAVE + WRITEU + WSET + WSHOW + WTN + WV_* Routines + XBM_EDIT + XDISPLAYFILE + XDXF + XFONT + XINTERANIMATE + XLOADCT + XMANAGER + XMNG_TMPL + XMTOOL + XOBJVIEW + XOBJVIEW_ROTATE + XOBJVIEW_WRITE_IMAGE + XPALETTE + XPCOLOR + XPLOT3D + XREGISTERED + XROI + XSQ_TEST + XSURFACE + XVAREDIT + XVOLUME + XVOLUME_ROTATE + XVOLUME_WRITE_IMAGE + XYOUTS + ZOOM + ZOOM_24 + IDL_Container::Add + IDL_Container::Cleanup + IDL_Container::Count + IDL_Container::Get + IDL_Container::Init + IDL_Container::IsContained + IDL_Container::Move + IDL_Container::Remove + IDLanROI::AppendData + IDLanROI::Cleanup + IDLanROI::ComputeGeometry + IDLanROI::ComputeMask + IDLanROI::ContainsPoints + IDLanROI::GetProperty + IDLanROI::Init + IDLanROI::RemoveData + IDLanROI::ReplaceData + IDLanROI::Rotate + IDLanROI::Scale + IDLanROI::SetProperty + IDLanROI::Translate + IDLanROIGroup::Add + IDLanROIGroup::Cleanup + IDLanROIGroup::ComputeMask + IDLanROIGroup::ComputeMesh + IDLanROIGroup::ContainsPoints + IDLanROIGroup::GetProperty + IDLanROIGroup::Init + IDLanROIGroup::Rotate + IDLanROIGroup::Scale + IDLanROIGroup::Translate + IDLcomIDispatch::GetProperty + IDLcomIDispatch::Init + IDLcomIDispatch::SetProperty + IDLffDICOM::Cleanup + IDLffDICOM::DumpElements + IDLffDICOM::GetChildren + IDLffDICOM::GetDescription + IDLffDICOM::GetElement + IDLffDICOM::GetGroup + IDLffDICOM::GetLength + IDLffDICOM::GetParent + IDLffDICOM::GetPreamble + IDLffDICOM::GetReference + IDLffDICOM::GetValue + IDLffDICOM::GetVR + IDLffDICOM::Init + IDLffDICOM::Read + IDLffDICOM::Reset + IDLffDXF::Cleanup + IDLffDXF::GetContents + IDLffDXF::GetEntity + IDLffDXF::GetPalette + IDLffDXF::Init + IDLffDXF::PutEntity + IDLffDXF::Read + IDLffDXF::RemoveEntity + IDLffDXF::Reset + IDLffDXF::SetPalette + IDLffDXF::Write + IDLffLanguageCat::IsValid + IDLffLanguageCat::Query + IDLffLanguageCat::SetCatalog + IDLffMrSID::Cleanup + IDLffMrSID::GetDimsAtLevel + IDLffMrSID::GetImageData + IDLffMrSID::GetProperty + IDLffMrSID::Init + IDLffShape::AddAttribute + IDLffShape::Cleanup + IDLffShape::Close + IDLffShape::DestroyEntity + IDLffShape::GetAttributes + IDLffShape::GetEntity + IDLffShape::GetProperty + IDLffShape::Init + IDLffShape::Open + IDLffShape::PutEntity + IDLffShape::SetAttributes + IDLffXMLSAX::AttributeDecl + IDLffXMLSAX::Characters + IDLffXMLSAX::Cleanup + IDLffXMLSAX::Comment + IDLffXMLSAX::ElementDecl + IDLffXMLSAX::EndCDATA + IDLffXMLSAX::EndDocument + IDLffXMLSAX::EndDTD + IDLffXMLSAX::EndElement + IDLffXMLSAX::EndEntity + IDLffXMLSAX::EndPrefixMapping + IDLffXMLSAX::Error + IDLffXMLSAX::ExternalEntityDecl + IDLffXMLSAX::FatalError + IDLffXMLSAX::GetProperty + IDLffXMLSAX::IgnorableWhitespace + IDLffXMLSAX::Init + IDLffXMLSAX::InternalEntityDecl + IDLffXMLSAX::NotationDecl + IDLffXMLSAX::ParseFile + IDLffXMLSAX::ProcessingInstruction + IDLffXMLSAX::SetProperty + IDLffXMLSAX::SkippedEntity + IDLffXMLSAX::StartCDATA + IDLffXMLSAX::StartDocument + IDLffXMLSAX::StartDTD + IDLffXMLSAX::StartElement + IDLffXMLSAX::StartEntity + IDLffXMLSAX::StartPrefixmapping + IDLffXMLSAX::StopParsing + IDLffXMLSAX::UnparsedEntityDecl + IDLffXMLSAX::Warning + IDLgrAxis::Cleanup + IDLgrAxis::GetCTM + IDLgrAxis::GetProperty + IDLgrAxis::Init + IDLgrAxis::SetProperty + IDLgrBuffer::Cleanup + IDLgrBuffer::Draw + IDLgrBuffer::Erase + IDLgrBuffer::GetContiguousPixels + IDLgrBuffer::GetDeviceInfo + IDLgrBuffer::GetFontnames + IDLgrBuffer::GetProperty + IDLgrBuffer::GetTextDimensions + IDLgrBuffer::Init + IDLgrBuffer::PickData + IDLgrBuffer::Read + IDLgrBuffer::Select + IDLgrBuffer::SetProperty + IDLgrClipboard::Cleanup + IDLgrClipboard::Draw + IDLgrClipboard::GetContiguousPixels + IDLgrClipboard::GetDeviceInfo + IDLgrClipboard::GetFontnames + IDLgrClipboard::GetProperty + IDLgrClipboard::GetTextDimensions + IDLgrClipboard::Init + IDLgrClipboard::SetProperty + IDLgrColorbar::Cleanup + IDLgrColorbar::ComputeDimensions + IDLgrColorbar::GetProperty + IDLgrColorbar::Init + IDLgrColorbar::SetProperty + IDLgrContour::AdjustLabelOffsets + IDLgrContour::Cleanup + IDLgrContour::GetCTM + IDLgrContour::GetLabelInfo + IDLgrContour::GetProperty + IDLgrContour::Init + IDLgrContour::SetProperty + IDLgrFont::Cleanup + IDLgrFont::GetProperty + IDLgrFont::Init + IDLgrFont::SetProperty + IDLgrImage::Cleanup + IDLgrImage::GetCTM + IDLgrImage::GetProperty + IDLgrImage::Init + IDLgrImage::SetProperty + IDLgrLegend::Cleanup + IDLgrLegend::ComputeDimensions + IDLgrLegend::GetProperty + IDLgrLegend::Init + IDLgrLegend::SetProperty + IDLgrLight::Cleanup + IDLgrLight::GetCTM + IDLgrLight::GetProperty + IDLgrLight::Init + IDLgrLight::SetProperty + IDLgrModel::Add + IDLgrModel::Cleanup + IDLgrModel::Draw + IDLgrModel::GetByName + IDLgrModel::GetCTM + IDLgrModel::GetProperty + IDLgrModel::Init + IDLgrModel::Reset + IDLgrModel::Rotate + IDLgrModel::Scale + IDLgrModel::SetProperty + IDLgrModel::Translate + IDLgrMPEG::Cleanup + IDLgrMPEG::GetProperty + IDLgrMPEG::Init + IDLgrMPEG::Put + IDLgrMPEG::Save + IDLgrMPEG::SetProperty + IDLgrPalette::Cleanup + IDLgrPalette::GetRGB + IDLgrPalette::GetProperty + IDLgrPalette::Init + IDLgrPalette::LoadCT + IDLgrPalette::NearestColor + IDLgrPalette::SetRGB + IDLgrPalette::SetProperty + IDLgrPattern::Cleanup + IDLgrPattern::GetProperty + IDLgrPattern::Init + IDLgrPattern:SetProperty + IDLgrPlot::Cleanup + IDLgrPlot::GetCTM + IDLgrPlot::GetProperty + IDLgrPlot::Init + IDLgrPlot::SetProperty + IDLgrPolygon::Cleanup + IDLgrPolygon::GetCTM + IDLgrPolygon::GetProperty + IDLgrPolygon::Init + IDLgrPolygon::SetProperty + IDLgrPolyline::Cleanup + IDLgrPolyline::GetCTM + IDLgrPolyline::GetProperty + IDLgrPolyline::Init + IDLgrPolyline::SetProperty + IDLgrPrinter::Cleanup + IDLgrPrinter::Draw + IDLgrPrinter::GetContiguousPixels + IDLgrPrinter::GetFontnames + IDLgrPrinter::GetProperty + IDLgrPrinter::GetTextDimensions + IDLgrPrinter::Init + IDLgrPrinter::NewDocument + IDLgrPrinter::NewPage + IDLgrPrinter::SetProperty + IDLgrROI::Cleanup + IDLgrROI::GetProperty + IDLgrROI::Init + IDLgrROI::PickVertex + IDLgrROI::SetProperty + IDLgrROIGroup::Add + IDLgrROIGroup::Cleanup + IDLgrROIGroup::GetProperty + IDLgrROIGroup::Init + IDLgrROIGroup::PickRegion + IDLgrROIGroup::SetProperty + IDLgrScene::Add + IDLgrScene::Cleanup + IDLgrScene::GetByName + IDLgrScene::GetProperty + IDLgrScene::Init + IDLgrScene::SetProperty + IDLgrSurface::Cleanup + IDLgrSurface::GetCTM + IDLgrSurface::GetProperty + IDLgrSurface::Init + IDLgrSurface::SetProperty + IDLgrSymbol::Cleanup + IDLgrSymbol::GetProperty + IDLgrSymbol::Init + IDLgrSymbol::SetProperty + IDLgrTessellator::AddPolygon + IDLgrTessellator::Cleanup + IDLgrTessellator::Init + IDLgrTessellator::Reset + IDLgrTessellator::Tessellate + IDLgrText::Cleanup + IDLgrText::GetCTM + IDLgrText::GetProperty + IDLgrText::Init + IDLgrText::SetProperty + IDLgrView::Add + IDLgrView::Cleanup + IDLgrView::GetByName + IDLgrView::GetProperty + IDLgrView::Init + IDLgrView::SetProperty + IDLgrViewgroup::Add + IDLgrViewgroup::Cleanup + IDLgrViewgroup::GetByName + IDLgrViewgroup::GetProperty + IDLgrViewgroup::Init + IDLgrViewgroup::SetProperty + IDLgrVolume::Cleanup + IDLgrVolume::ComputeBounds + IDLgrVolume::GetCTM + IDLgrVolume::GetProperty + IDLgrVolume::Init + IDLgrVolume::PickVoxel + IDLgrVolume::SetProperty + IDLgrVRML::Cleanup + IDLgrVRML::Draw + IDLgrVRML::GetDeviceInfo + IDLgrVRML::GetFontnames + IDLgrVRML::GetProperty + IDLgrVRML::GetTextDimensions + IDLgrVRML::Init + IDLgrVRML::SetProperty + IDLgrWindow::Cleanup + IDLgrWindow::Draw + IDLgrWindow::Erase + IDLgrWindow::GetContiguousPixels + IDLgrWindow::GetDeviceInfo + IDLgrWindow::GetFontnames + IDLgrWindow::GetProperty + IDLgrWindow::GetTextDimensions + IDLgrWindow::Iconify + IDLgrWindow::Init + IDLgrWindow::PickData + IDLgrWindow::Read + IDLgrWindow::Select + IDLgrWindow::SetCurrentCursor + IDLgrWindow::SetProperty + IDLgrWindow::Show + IDLitCommand::AddItem + IDLitCommand::Cleanup + IDLitCommand::GetItem + IDLitCommand::GetProperty + IDLitCommand::GetSize + IDLitCommand::Init + IDLitCommand::SetProperty + IDLitCommandSet::Cleanup + IDLitCommandSet::GetSize + IDLitCommandSet::Init + IDLitComponent::Cleanup + IDLitComponent::EditUserDefProperty + IDLitComponent::GetFullIdentifier + IDLitComponent::GetProperty + IDLitComponent::GetPropertyAttribute + IDLitComponent::GetPropertyByIdentifier + IDLitComponent::Init + IDLitComponent::QueryProperty + IDLitComponent::RegisterProperty + IDLitComponent::SetProperty + IDLitComponent::SetPropertyAttribute + IDLitComponent::SetPropertyByIdentifier + IDLitContainer::Add + IDLitContainer::AddByIdentifier + IDLitContainer::Cleanup + IDLitContainer::Get + IDLitContainer::GetByIdentifier + IDLitContainer::Init + IDLitContainer::Remove + IDLitContainer::RemoveByIdentifier + IDLitData::AddDataObserver + IDLitData::Cleanup + IDLitData::Copy + IDLitData::GetByType + IDLitData::GetData + IDLitData::GetProperty + IDLitData::GetSize + IDLitData::Init + IDLitData::NotifyDataChange + IDLitData::NotifyDataComplete + IDLitData::RemoveDataObserver + IDLitData::SetData + IDLitData::SetProperty + IDLitDataContainer::Cleanup + IDLitDataContainer::GetData + IDLitDataContainer::GetIdentifiers + IDLitDataContainer::GetProperty + IDLitDataContainer::Init + IDLitDataContainer::SetData + IDLitDataContainer::SetProperty + IDLitDataOperation::Cleanup + IDLitDataOperation::DoExecuteUI + IDLitDataOperation::Execute + IDLitDataOperation::GetProperty + IDLitDataOperation::Init + IDLitDataOperation::SetProperty + IDLitDataOperation::UndoExecute + IDLitIMessaging::AddOnNotifyObserver + IDLitIMessaging::DoOnNotify + IDLitIMessaging::ErrorMessage + IDLitIMessaging::GetTool + IDLitIMessaging::ProbeStatusMessage + IDLitIMessaging::ProgressBar + IDLitIMessaging::PromptUserText + IDLitIMessaging::PromptUserYesNo + IDLitIMessaging::RemoveOnNotifyObserver + IDLitIMessaging::SignalError + IDLitIMessaging::StatusMessage + IDLitManipulator::Cleanup + IDLitManipulator::CommitUndoValues + IDLitManipulator::GetCursorType + IDLitManipulator::GetProperty + IDLitManipulator::Init + IDLitManipulator::OnKeyboard + IDLitManipulator::OnLoseCurrentManipulator + IDLitManipulator::OnMouseDown + IDLitManipulator::OnMouseMotion + IDLitManipulator::OnMouseUp + IDLitManipulator::RecordUndoValues + IDLitManipulator::SetCurrentManipulator + IDLitManipulator::SetProperty + IDLitManipulatorContainer::Add + IDLitManipulatorContainer::GetCurrent + IDLitManipulatorContainer::GetCurrentManipulator + IDLitManipulatorContainer::GetProperty + IDLitManipulatorContainer::Init + IDLitManipulatorContainer::OnKeyboard + IDLitManipulatorContainer::OnMouseDown + IDLitManipulatorContainer::OnMouseMotion + IDLitManipulatorContainer::OnMouseUp + IDLitManipulatorContainer::SetCurrent + IDLitManipulatorContainer::SetCurrentManipulator + IDLitManipulatorContainer::SetProperty + IDLitManipulatorManager::Add + IDLitManipulatorManager::AddManipulatorObserver + IDLitManipulatorManager::Init + IDLitManipulatorManager::RemoveManipulatorObserver + IDLitManipulatorVisual::Cleanup + IDLitManipulatorVisual::GetProperty + IDLitManipulatorVisual::Init + IDLitManipulatorVisual::SetProperty + IDLitOperation::Cleanup + IDLitOperation::DoAction + IDLitOperation::GetProperty + IDLitOperation::Init + IDLitOperation::RecordFinalValues + IDLitOperation::RecordInitialValues + IDLitOperation::RedoOperation + IDLitOperation::SetProperty + IDLitOperation::UndoOperation + IDLitParameter::Cleanup + IDLitParameter::GetParameter + IDLitParameter::GetParameterSet + IDLitParameter::Init + IDLitParameter::OnDataChangeUpdate + IDLitParameter::OnDataDisconnect + IDLitParameter::RegisterParameter + IDLitParameter::SetData + IDLitParameter::SetParameterSet + IDLitParameterSet::Add + IDLitParameterSet::Cleanup + IDLitParameterSet::Copy + IDLitParameterSet::Get + IDLitParameterSet::GetByName + IDLitParameterSet::GetParameterName + IDLitParameterSet::Init + IDLitParameterSet::Remove + IDLitReader::Cleanup + IDLitReader::GetData + IDLitReader::GetFileExtensions + IDLitReader::GetFilename + IDLitReader::GetProperty + IDLitReader::Init + IDLitReader::IsA + IDLitReader::SetFilename + IDLitReader::SetProperty + IDLitTool::Add + IDLitTool::AddService + IDLitTool::Cleanup + IDLitTool::CommitActions + IDLitTool::DisableUpdates + IDLitTool::DoAction + IDLitTool::DoSetProperty + IDLitTool::DoUIService + IDLitTool::EnableUpdates + IDLitTool::GetCurrentManipulator + IDLitTool::GetFileReader + IDLitTool::GetFileWriter + IDLitTool::GetManipulators + IDLitTool::GetOperations + IDLitTool::GetProperty + IDLitTool::GetSelectedItems + IDLitTool::GetService + IDLitTool::GetVisualization + IDLitTool::Init + IDLitTool::RefreshCurrentWindow + IDLitTool::Register + IDLitTool::RegisterFileReader + IDLitTool::RegisterFileWriter + IDLitTool::RegisterManipulator + IDLitTool::RegisterOperation + IDLitTool::RegisterVisualization + IDLitTool::SetProperty + IDLitTool::UnRegister + IDLitTool::UnRegisterFileReader + IDLitTool::UnRegisterFileWriter + IDLitTool::UnRegisterManipulator + IDLitTool::UnRegisterOperation + IDLitTool::UnRegisterVisualization + IDLitUI::AddOnNotifyObserver + IDLitUI::Cleanup + IDLitUI::DoAction + IDLitUI::GetProperty + IDLitUI::GetTool + IDLitUI::GetWidgetByName + IDLitUI::Init + IDLitUI::RegisterUIService + IDLitUI::RegisterWidget + IDLitUI::RemoveOnNotifyObserver + IDLitUI::SetProperty + IDLitUI::UnRegisterUIService + IDLitUI::UnRegisterWidget + IDLitVisualization::Add + IDLitVisualization::Aggregate + IDLitVisualization::Cleanup + IDLitVisualization::Get + IDLitVisualization::GetCenterRotation + IDLitVisualization::GetCurrentSelectionVisual + IDLitVisualization::GetDataSpace + IDLitVisualization::GetDataString + IDLitVisualization::GetDefaultSelectionVisual + IDLitVisualization::GetManipulatorTarget + IDLitVisualization::GetProperty + IDLitVisualization::GetSelectionVisual + IDLitVisualization::GetTypes + IDLitVisualization::GetXYZRange + IDLitVisualization::Init + IDLitVisualization::Is3D + IDLitVisualization::IsIsotropic + IDLitVisualization::IsManipulatorTarget + IDLitVisualization::IsSelected + IDLitVisualization::OnDataChange + IDLitVisualization::OnDataComplete + IDLitVisualization::OnDataRangeChange + IDLitVisualization::Remove + IDLitVisualization::Scale + IDLitVisualization::Select + IDLitVisualization::Set3D + IDLitVisualization::SetCurrentSelectionVisual + IDLitVisualization::SetData + IDLitVisualization::SetDefaultSelectionVisual + IDLitVisualization::SetParameterSet + IDLitVisualization::SetProperty + IDLitVisualization::UpdateSelectionVisual + IDLitVisualization::VisToWindow + IDLitVisualization::WindowToVis + IDLitWindow::Add + IDLitWindow::AddWindowEventObserver + IDLitWindow::Cleanup + IDLitWindow::ClearSelections + IDLitWindow::DoHitTest + IDLitWindow::GetEventMask + IDLitWindow::GetProperty + IDLitWindow::GetSelectedItems + IDLitWindow::Init + IDLitWindow::OnKeyboard + IDLitWindow::OnMouseDown + IDLitWindow::OnMouseMotion + IDLitWindow::OnMouseUp + IDLitWindow::OnScroll + IDLitWindow::Remove + IDLitWindow::RemoveWindowEventObserver + IDLitWindow::SetCurrentZoom + IDLitWindow::SetEventMask + IDLitWindow::SetManipulatorManager + IDLitWindow::SetProperty + IDLitWindow::ZoomIn + IDLitWindow::ZoomOut + IDLitWriter::Cleanup + IDLitWriter::GetFileExtensions + IDLitWriter::GetFilename + IDLitWriter::GetProperty + IDLitWriter::Init + IDLitWriter::IsA + IDLitWriter::SetData + IDLitWriter::SetFilename + IDLitWriter::SetProperty + IDLjavaObject::GetProperty + IDLjavaObject::Init + IDLjavaObject::SetProperty + TrackBall::Init + TrackBall::Reset + TrackBall::Update + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/java.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/java.plist new file mode 100644 index 00000000..b419e6b4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/java.plist @@ -0,0 +1,101 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abstract + break + case + catch + continue + default + do + else + extends + final + finally + for + if + implements + instanceof + native + new + private + protected + public + return + static + switch + synchronized + throw + throws + transient + try + volatile + while + package + import + boolean + byte + char + class + double + float + int + interface + long + short + void + assert + strictfp + false + null + super + this + true + goto + const + enum + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javafx.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javafx.plist new file mode 100644 index 00000000..bb62bb5b --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javafx.plist @@ -0,0 +1,98 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + after + as + attribute + before + bind + Boolean + break + catch + class + continue + delete + do + else + extends + finally + first + for + foreach + format + from + function + import + if + in + indexof + insert + instanceof + Integer + into + inverse + last + later + lazy + new + Number + on + operation + return + reverse + select + sizeof + String + then + this + throw + trigger + try + var + where + while + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javascript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javascript.plist new file mode 100644 index 00000000..9692f7b8 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/javascript.plist @@ -0,0 +1,421 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*function\s+.*\n?\s*\{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + else + for + in + while + do + continue + break + with + try + catch + switch + case + new + var + function + return + delete + true + false + void + throw + typeof + const + default + escape + isFinite + isNaN + Number + parseFloat + parseInt + reload + taint + unescape + untaint + write + Anchor + Applet + Area + Array + Boolean + Button + Checkbox + Date + document + window + Image + FileUpload + Form + Frame + Function + Hidden + Link + MimeType + Math + Max + Min + Layer + navigator + Object + Password + Plugin + Radio + RegExp + Reset + Screen + Select + String + Text + Textarea + this + Window + abs + acos + asin + atan + atan2 + ceil + cos + ctg + E + exp + floor + LN2 + LN10 + log + LOG2E + LOG10E + PI + pow + round + sin + sqrt + SQRT1_2 + SQRT2 + tan + onAbort + onBlur + onChange + onClick + onError + onFocus + onLoad + onMouseOut + onMouseOver + onReset + onSelect + onSubmit + onUnload + above + action + alinkColor + alert + anchor + anchors + appCodeName + applets + apply + appName + appVersion + argument + arguments + arity + availHeight + availWidth + back + background + below + bgColor + border + big + blink + blur + bold + border + call + caller + charAt + charCodeAt + checked + clearInterval + clearTimeout + click + clip + close + closed + colorDepth + complete + compile + constructor + confirm + cookie + current + cursor + data + defaultChecked + defaultSelected + defaultStatus + defaultValue + description + disableExternalCapture + domain + elements + embeds + enabledPlugin + enableExternalCapture + encoding + eval + exec + fgColor + filename + find + fixed + focus + fontcolor + fontsize + form + forms + formName + forward + frames + fromCharCode + getDate + getDay + getHours + getMiliseconds + getMinutes + getMonth + getSeconds + getSelection + getTime + getTimezoneOffset + getUTCDate + getUTCDay + getUTCFullYear + getUTCHours + getUTCMilliseconds + getUTCMinutes + getUTCMonth + getUTCSeconds + getYear + global + go + hash + height + history + home + host + hostname + href + hspace + ignoreCase + images + index + indexOf + innerHeight + innerWidth + input + italics + javaEnabled + join + language + lastIndex + lastIndexOf + lastModified + lastParen + layers + layerX + layerY + left + leftContext + length + link + linkColor + links + location + locationbar + load + lowsrc + match + MAX_VALUE + menubar + method + mimeTypes + MIN_VALUE + modifiers + moveAbove + moveBelow + moveBy + moveTo + moveToAbsolute + multiline + name + NaN + NEGATIVE_INFINITY + negative_infinity + next + open + opener + options + outerHeight + outerWidth + pageX + pageY + pageXoffset + pageYoffset + parent + parse + pathname + personalbar + pixelDepth + platform + plugins + pop + port + POSITIVE_INFINITY + positive_infinity + preference + previous + print + prompt + protocol + prototype + push + referrer + refresh + releaseEvents + reload + replace + reset + resizeBy + resizeTo + reverse + rightContext + screenX + screenY + scroll + scrollbar + scrollBy + scrollTo + search + select + selected + selectedIndex + self + setDate + setHours + setMinutes + setMonth + setSeconds + setTime + setTimeout + setUTCDate + setUTCDay + setUTCFullYear + setUTCHours + setUTCMilliseconds + setUTCMinutes + setUTCMonth + setUTCSeconds + setYear + shift + siblingAbove + siblingBelow + small + sort + source + splice + split + src + status + statusbar + strike + sub + submit + substr + substring + suffixes + sup + taintEnabled + target + test + text + title + toGMTString + toLocaleString + toLowerCase + toolbar + toSource + toString + top + toUpperCase + toUTCString + type + URL + unshift + unwatch + userAgent + UTC + value + valueOf + visibility + vlinkColor + vspace + width + watch + which + width + write + writeln + x + y + zIndex + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/jsp.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/jsp.plist new file mode 100644 index 00000000..728b64a4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/jsp.plist @@ -0,0 +1,366 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + taglib + include + page + tag + tagAttribute + tagVariable + language + session + contentType + charset + import + buffer + autoflush + isThreadSafe + info + errorPage + isErrorpage + extends + file + uri + prefix + method + name + default + required + rtexprvalue + id + type + scope + abstract + break + case + catch + continue + default + do + else + extends + final + finally + for + if + implements + instanceof + native + new + private + protected + public + return + static + switch + synchronized + throw + throws + transient + try + volatile + while + package + import + boolean + byte + char + class + double + float + int + interface + long + short + void + assert + strictfp + false + null + super + this + true + goto + const + enum + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/latex.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/latex.plist new file mode 100644 index 00000000..b99d1718 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/latex.plist @@ -0,0 +1,50 @@ + + + + + beginCommand + { + endCommand + } + beginInstruction + + endInstruction + + beginVariable + \ + endVariable + {}()[],?.;/:+=><~ + firstString + $ + secondString + + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + \\((sub)*section|part|chapter|paragraph){[^}]*} + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + \begin{document} + \end{document} + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lilypond.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lilypond.plist new file mode 100644 index 00000000..da7ea08b --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lilypond.plist @@ -0,0 +1,319 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + \0123456789# + endVariable + {}()[],?.;/:+=><~ + firstString + " + secondString + + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + %{ + endFirstMultiLineComment + %} + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*\w+\s*= + removeFromFunction + = + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + staff-spacing-interface + text-script-interface + Ottava_spanner_engraver + Figured_bass_engraver + Lyrics + Separating_line_group_engraver + cluster-interface + Glissando_engraver + key-signature-interface + clef-interface + VaticanaVoice + Rest_collision_engraver + Grace_engraver + grid-point-interface + Measure_grouping_engraver + Laissez_vibrer_engraver + Script_row_engraver + bass-figure-alignment-interface + Note_head_line_engraver + ottava-bracket-interface + rhythmic-head-interface + Accidental_engraver + Mark_engraver + hara-kiri-group-interface + Instrument_name_engraver + Vaticana_ligature_engraver + Page_turn_engraver + staff-symbol-interface + Beam_performer + accidental-suggestion-interface + Key_engraver + GrandStaff + multi-measure-interface + rest-collision-interface + Dot_column_engraver + MensuralVoice + TabStaff + Pitched_trill_engraver + line-spanner-interface + Time_signature_performer + lyric-interface + StaffGroup + text-interface + slur-interface + Drum_note_performer + TabVoice + measure-grouping-interface + stanza-number-interface + self-alignment-interface + Span_arpeggio_engraver + system-interface + Engraver + RhythmicStaff + font-interface + fret-diagram-interface + Grace_spacing_engraver + Bar_engraver + Dynamic_engraver + Grob_pq_engraver + Default_bar_line_engraver + Swallow_performer + script-column-interface + Piano_pedal_performer + metronome-mark-interface + melody-spanner-interface + FretBoards + spacing-spanner-interface + Control_track_performer + Break_align_engraver + paper-column-interface + PianoStaff + Breathing_sign_engraver + accidental-placement-interface + Tuplet_engraver + stroke-finger-interface + side-position-interface + note-name-interface + bar-line-interface + lyric-extender-interface + Staff + GregorianTranscriptionStaff + Rest_swallow_translator + dynamic-text-spanner-interface + arpeggio-interface + Cluster_spanner_engraver + Collision_engraver + accidental-interface + rest-interface + Tab_note_heads_engraver + dots-interface + staff-symbol-referencer-interface + ambitus-interface + bass-figure-interface + vaticana-ligature-interface + ledgered-interface + item-interface + Tie_performer + volta-bracket-interface + vertically-spaceable-interface + ledger-line-interface + Chord_tremolo_engraver + note-column-interface + DrumVoice + axis-group-interface + Ledger_line_engraver + Slash_repeat_engraver + ligature-bracket-interface + Pitch_squash_engraver + Instrument_switch_engraver + Voice + Script_column_engraver + Volta_engraver + Stanza_number_align_engraver + Vertical_align_engraver + span-bar-interface + Staff_collecting_engraver + Ligature_bracket_engraver + Time_signature_engraver + Beam_engraver + Note_name_engraver + Note_heads_engraver + Forbid_line_break_engraver + spacing-options-interface + spacing-interface + Span_dynamic_performer + piano-pedal-script-interface + MensuralStaff + Global + trill-pitch-accidental-interface + grob-interface + Horizontal_bracket_engraver + Grid_line_span_engraver + NoteNames + piano-pedal-interface + Axis_group_engraver + Staff_symbol_engraver + stem-interface + Slur_engraver + pitched-trill-interface + tie-column-interface + stem-tremolo-interface + Grid_point_engraver + System_start_delimiter_engraver + Completion_heads_engraver + Drum_notes_engraver + Swallow_engraver + Slur_performer + lyric-hyphen-interface + Clef_engraver + dynamic-interface + Score + Output_property_engraver + Repeat_tie_engraver + Rest_engraver + break-aligned-interface + String_number_engraver + only-prebreak-interface + Lyric_engraver + Tempo_performer + Parenthesis_engraver + Repeat_acknowledge_engraver + mensural-ligature-interface + align-interface + Stanza_number_engraver + system-start-delimiter-interface + lyric-syllable-interface + bend-after-interface + dynamic-line-spanner-interface + Staff_performer + Bar_number_engraver + Fretboard_engraver + tablature-interface + Fingering_engraver + chord-name-interface + Note_swallow_translator + Chord_name_engraver + note-head-interface + breathing-sign-interface + Extender_engraver + Ambitus_engraver + DrumStaff + dot-column-interface + Lyric_performer + enclosing-bracket-interface + Trill_spanner_engraver + Key_performer + Vertically_spaced_contexts_engraver + hairpin-interface + Hyphen_engraver + Dots_engraver + multi-measure-rest-interface + break-alignment-align-interface + Multi_measure_rest_engraver + InnerStaffGroup + text-spanner-interface + Grace_beam_engraver + separation-item-interface + Balloon_engraver + Translator + separation-spanner-interface + Tweak_engraver + Devnull + Bend_after_engraver + Spacing_engraver + Piano_pedal_align_engraver + system-start-text-interface + parentheses-interface + Melisma_translator + ChoirStaff + Span_bar_engraver + Text_engraver + GregorianTranscriptionVoice + Timing_translator + script-interface + semi-tie-interface + Percent_repeat_engraver + Tab_staff_symbol_engraver + line-interface + rhythmic-grob-interface + Dynamic_performer + note-spacing-interface + spanner-interface + break-alignment-interface + tuplet-number-interface + Rhythmic_column_engraver + cluster-beacon-interface + horizontal-bracket-interface + Mensural_ligature_engraver + ChordNames + gregorian-ligature-interface + Melody_engraver + ligature-interface + Paper_column_engraver + FiguredBass + grace-spacing-interface + tie-interface + New_fingering_engraver + Script_engraver + Metronome_mark_engraver + string-number-interface + Hara_kiri_engraver + grid-line-interface + Skip_event_swallow_translator + Auto_beam_engraver + spaceable-grob-interface + Font_size_engraver + figured-bass-continuation-interface + semi-tie-column-interface + CueVoice + Phrasing_slur_engraver + InnerChoirStaff + Arpeggio_engraver + mark-interface + VaticanaStaff + piano-pedal-bracket-interface + beam-interface + Note_performer + custos-interface + percent-repeat-interface + time-signature-interface + Custos_engraver + Part_combine_engraver + Piano_pedal_engraver + tuplet-bracket-interface + Stem_engraver + finger-interface + note-collision-interface + Text_spanner_engraver + text-balloon-interface + Tie_engraver + Figured_bass_position_engraver + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lisp.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lisp.plist new file mode 100644 index 00000000..f12f558b --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lisp.plist @@ -0,0 +1,476 @@ + + + + + beginCommand + ( + endCommand + + beginInstruction + '( + endInstruction + ) + beginVariable + : + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + ; + secondSingleLineComment + + beginFirstMultiLineComment + #| + endFirstMultiLineComment + |# + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abort + abs + access + acons + acos + acosh + add-method + adjoin + adjustable-array-p + allocate-instance + alpha-char-p + alphanumericp + and + append + applyhook + apply + apropos + aref + arrayp + array + array-dimension + array-dimension-limit + array-dimensions + array-element-type + array-in-bounds-p + ash + asinh + asin + assoc-if + assoc-if-not + assert + array-rank + array-rank-limit + array-row-major-index + array-total-size + atanh + atan + bit + bit-and + bit-eqv + bit-ior + bit-nand + bit-nor + bit-not + bit-vector + bit-vector-p + bit-xor + block + boolean + boole-and + boole-nor + boole-xor + boundp + butlast + byte + call-next-method + call-method + car + case + catch + cdr + ceiling + char-downcase + char-equal + char-greaterp + char-int + char-lessp + char-name + char-not-equal + char-not-greaterp + char-not-lessp + char-upcase + check-type + characterp + check-type + class + class-name + class-of + close + coerce + compile + compile-file + complement + complexp + complex + concatenate + concatenated-stream + concatenated-stream-streams + condition + cond + consp + constantp + cons + copy-alist + copy-list + copy-readtable + copy-seq + copy-structure + copy-symbol + copy-tree + cosh + cos + count + count-if + count-if-not + decf + declaim + declare + defclass + defconstant + defgeneric + defmacro + defmethod + defpackage + defparameter + defsetf + defstruct + deftype + defun + defvar + define-condition + define-method-combination + define-setf-expander + define-setf-method + delete-if + delete-if-not + display + do* + do + dolist + dotimes + elt + end-of-file + endp + eq + eql + equalp + equal + error + eval + eval-when + evenp + every + export + expt + exp + fboundp + fceiling + ffloor + find-class + find-if + find-if-not + file-length + find-method + find-package + find-restart + find-symbol + finish-output + first + fixnum + flet + floatp + float + floor + fmakunbound + force-output + format + fresh-line + fround + ftruncate + ftype + funcall + functionp + gcd + gensym + gentemp + getf + gethash + get + generic-function + handler-bind + handler-case + hash-table + hash-table-count + hash-table-p + hash-table-rehash-size + hash-table-size + if + if-exists + in-package + incf + input-stream-p + integerp + integer + interactive-stream-p + lambda + last + lcm + length + let* + let + list* + listp + list + list-length + load + logand + logbitp + logcount + logeqv + logior + lognand + lognor + lognot + logxor + log + loop + loop-finish + macro-function + macrolet + make-array + make-char + make-condition + make-hash-table + make-instance + make-list + make-method + make-package + make-pathname + make-sequence + make-string + make-string-input-stream + make-string-output-stream + make-symbol + makunbound + mapcan + mapcar + mapcon + mapc + maphash + maplist + mapl + map + map-into + max + member + member-if + member-if-not + minusp + min + mod + multiple-value-bind + multiple-value-call + multiple-value-list + multiple-value-prog1 + multiple-value-seteq + multiple-value-setq + nbutlast + nconc + next-method-p + nil + not + nreconc + nreverse + nsubstitute + nsubstitute-if-not + nthcdr + nth + nth-value + null + numberp + number + numerator + nunion + nsubst-if + nsubst-if-not + oddp + open + open-stream-p + optimize + or + otherwise + output-stream-p + packagep + pathnamep + peek-char + plusp + pop + pprint + prin1 + princ + print + print-object + proclaim + prog + prog* + prog1 + progn + progv + provide + push + pushnew + putprop + quote + random + rassoc + rassoc-if + rassoc-if-not + ratio + rational + rationalp + rationalize + read + read-byte + read-char + read-delimited-list + read-eval-print + read-from-string + read-line + read-preserving-whitespace + read-sequence + real + realp + reduce + rem + remf + remhash + remove-method + remprop + restart-bind + restart-case + restart-name + return + revappend + reverse + rlet + rotatef + round + second + sequence + set + set-difference + set-exclusive-or + set-macro-character + setf + setq + shiftf + sin + sinh + single-float + sleep + slot-boundp + slot-exists-p + slot-makunbound + slot-missing + slot-unbound + slot-value + sort + special-form-p + step + streamp + string + stringp + string-capitalize + string-char + string-char-p + string-downcase + string-equal + string-greaterp + string-left-trim + string-lessp + string-not-equal + string-not-greaterp + string-not-lessp + string-right-strim + string-right-trim + string-stream + string-trim + string-upcase + subsetp + sqrt + symbolp + tailp + tan + tanh + throw + type + type-of + typep + unbound-slot + unbound-slot-instance + unbound-variable + union + unless + unwind-protect + unread + unread-char + use-package + use-value + values + values-list + vector + vector-pop + vector-push + vector-push-extend + vectorp + warn + warning + when + with-accessors + with-input-from-string + with-open-file + with-open-stream + with-output-to-string + with-package-iterator + with-simple-restart + with-slots + with-standard-io-syntax + without-interrupts + write + write-byte + write-char + write-line + write-to-string + write-sequence + zerop + + autocompleteWords + + + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/logtalk.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/logtalk.plist new file mode 100644 index 00000000..c23a8abe --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/logtalk.plist @@ -0,0 +1,190 @@ + + + + + autocompleteWords + + encoding + calls + category + dynamic + end_category + end_object + end_protocol + info + initialization + object + protocol + threaded + uses + alias + discontiguous + meta_predicate + mode + op + private + protected + public + current_object + current_protocol + current_category + object_property + protocol_property + category_property + create_object + create_protocol + create_category + abolish_object + abolish_protocol + abolish_category + extends_object + extends_protocol + implements_protocol + imports_category + instantiates_class + specializes_class + abolish_events + current_event + define_events + logtalk_load + logtalk_compile + logtalk_library_path + current_logtalk_flag + set_logtalk_flag + threaded_call + threaded_once + threaded_ignore + threaded_exit + threaded_peek + threaded_wait + threaded_notify + synchronized + self + this + sender + parameter + before + after + phrase + expand_term + term_expansion + true + fail + call + catch + throw + unify_with_occurs_check + var + atom + integer + float + atomic + compound + nonvar + number + arg + copy_term + functor + current_predicate + predicate_property + abolish + assertz + asserta + clause + retract + retractall + bagof + findall + forall + setof + current_input + current_output + set_input + set_output + open + close + flush_output + stream_property + at_end_of_stream + set_stream_position + get_char + get_code + peek_char + peek_code + put_char + put_code + nl + get_byte + peek_byte + put_byte + read + read_term + write + writeq + write_canonical + atom_chars + atom_codes + atom_concat + number_chars + number_codes + current_op + char_conversion + current_char_conversion + once + repeat + atom_length + atom_concat + sub_atom + atom_chars + atom_codes + char_code + number_chars + number_codes + set_prolog_flag + current_prolog_flag + halt + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + % + firstString + " + functionDefinition + ((?<=:-\sobject\()|(?<=:-\sprotocol\()|(?<=:-\scategory\())[a-z][a-zA-Z0-9_]* + removeFromFunction + + keywords + + :: + ^^ + << + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lsl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lsl.plist new file mode 100644 index 00000000..ab294a40 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lsl.plist @@ -0,0 +1,417 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + default + delete + do + else + FALSE + float + for + if + integer + jump + key + list + return + rotation + state + TRUE + vector + void + while + NULL + + autocompleteWords + + llAbs + llAcos + llAddToLandBanList + llAddToLandPassList + llAdjustSoundVolume + llAllowInventoryDrop + llAngleBetween + llApplyImpulse + llApplyRotationalImpulse + llAsin + llAtan2 + llAttachToAvatar + llAvatarOnSitTarget + llAxes2Rot + llAxisAngle2Rot + llBase64ToInteger + llBase64ToString + llBreakAllLinks + llBreakLink + llCeil + llClearCameraParams + llCloseRemoteDataChannel + llCloud + llCollisionFilter + llCollisionSound + llCollisionSprite + llCos + llCreateLink + llCSV2List + llDeleteSubList + llDeleteSubString + llDetachFromAvatar + llDetectedGrab + llDetectedGroup + llDetectedKey + llDetectedLinkNumber + llDetectedName + llDetectedOwner + llDetectedPos + llDetectedRot + llDetectedType + llDetectedVel + llDialog + llDie + llDumpList2String + llEdgeOfWorld + llEjectFromLand + llEmail + llEscapeURL + llEuler2Rot + llFabs + llFloor + llForceMouselook + llFrand + llGetAccel + llGetAgentInfo + llGetAgentSize + llGetAlpha + llGetAndResetTime + llGetAnimation + llGetAnimationList + llGetAttached + llGetBoundingBox + llGetCameraPos + llGetCameraRot + llGetCenterOfMass + llGetCreator + llGetColor + llGetDate + llGetEnergy + llGetForce + llGetFreeMemory + llGetGeometricCenter + llGetGMTclock + llGetInventoryCreator + llGetInventoryKey + llGetInventoryName + llGetInventoryNumber + llGetInventoryPermMask + llGetInventoryType + llGetKey + llGetLandOwnerAt + llGetLinkKey + llGetLinkName + llGetLinkNumber + llGetListEntryType + llGetListLength + llGetLocalPos + llGetLocalRot + llGetMass + llGetNextEmail + llGetNotecardLine + llGetNumberOfNotecardLines + llGetNumberOfPrims + llGetNumberOfSides + llGetObjectDesc + llGetObjectMass + llGetObjectName + llGetObjectPermMask + llGetObjectPrimCount + llGetOmega + llGetOwner + llGetOwnerKey + llGetParcelDetails + llGetParcelFlags + llGetParcelMaxPrims + llGetParcelPrimCount + llGetParcelPrimOwners + llGetPermissions + llGetPermissionsKey + llGetPos + llGetPrimitiveParams + llGetRegionCorner + llGetRegionFlags + llGetRegionFPS + llGetRegionName + llGetRegionTimeDilation + llGetRootPosition + llGetRootRotation + llGetRot + llGetScale + llGetScriptName + llGetScriptState + llGetSimulatorHostname + llGetStartParameter + llGetStatus + llGetSubString + llGetSunDirection + llGetTexture + llGetTextureOffset + llGetTextureRot + llGetTextureScale + llGetTime + llGetTimeOfDay + llGetTimestamp + llGetTorque + llGetUnixTime + llGetVel + llGetWallclock + llGiveInventory + llGiveInventoryList + llGiveMoney + llGodLikeRezObject + llGround + llGroundContour + llGroundNormal + llGroundRepel + llGroundSlope + llHTTPRequest + llInsertString + llInstantMessage + llIntegerToBase64 + llKey2Name + llList2CSV + llList2Float + llList2Integer + llList2Key + llList2List + llList2ListStrided + llList2Rot + llList2String + llList2Vector + llListFindList + llListInsertList + llListRandomize + llListReplaceList + llListSort + llListStatistics + llListen + llListenControl + llListenRemove + llLoadURL + llLog + llLog10 + llLookAt + llLoopSound + llLoopSoundMaster + llLoopSoundSlave + llMapDestination + llMD5String + llMessageLinked + llMinEventDelay + llModifyLand + llModPow + llMoveToTarget + llOffsetTexture + llOpenRemoteDataChannel + llOverMyLand + llOwnerSay + llParcelMediaCommandList + llParcelMediaQuery + llParseString2List + llParseStringKeepNulls + llParticleSystem + llPassCollisions + llPassTouches + llPlaySound + llPlaySoundSlave + llPointAt + llPow + llPreloadSound + llPushObject + llRefreshPrimURL + llReleaseCamera + llReleaseControls + llRemoteDataReply + llRemoteDataSetRegion + llRemoteLoadScriptPin + llRemoveFromLandBanList + llRemoveFromLandPassList + llRemoveInventory + llRemoveVehicleFlags + llRequestAgentData + llRequestInventoryData + llRequestPermissions + llRequestSimulatorData + llResetOtherScript + llResetScript + llResetTime + llRezAtRoot + llRezObject + llRot2Angle + llRot2Axis + llRot2Euler + llRot2Fwd + llRot2Left + llRot2Up + llRotBetween + llRotLookAt + llRotTarget + llRotTargetRemove + llRotateTexture + llRound + llSameGroup + llSay + llScaleTexture + llScriptDanger + llSendRemoteData + llSensor + llSensorRemove + llSensorRepeat + llSetAlpha + llSetBuoyancy + llSetCameraAtOffset + llSetCameraEyeOffset + llSetCameraParams + llSetColor + llSetDamage + llSetForce + llSetForceAndTorque + llSetHoverHeight + llSetLinkAlpha + llSetLinkColor + llSetLocalRot + llSetObjectDesc + llSetObjectName + llSetParcelMusicURL + llSetPayPrice + llSetPos + llSetPrimURL + llSetPrimitiveParams + llSetRemoteScriptAccessPin + llSetRot + llSetScale + llSetScriptState + llSetSitText + llSetSoundQueueing + llSetSoundRadius + llSetStatus + llSetText + llSetTexture + llSetTextureAnim + llSetTimerEvent + llSetTorque + llSetTouchText + llSetVehicleFlags + llSetVehicleFloatParam + llSetVehicleRotationParam + llSetVehicleType + llSetVehicleVectorParam + llShout + llSin + llSitTarget + llSleep + llSqrt + llStartAnimation + llStopAnimation + llStopHover + llStopLookAt + llStopMoveToTarget + llStopPointAt + llStopSound + llStringLength + llStringToBase64 + llSubStringIndex + llTakeCamera + llTakeControls + llTan + llTarget + llTargetOmega + llTargetRemove + llTeleportAgentHome + llToLower + llToUpper + llTriggerSound + llTriggerSoundLimited + llUnescapeURL + llUnSit + llVecDist + llVecMag + llVecNorm + llVolumeDetect + llWater + llWhisper + llWind + llXorBase64StringsCorrect + at_rot_target + at_target + attach + changed + collision + collision_end + collision_start + control + dataserver + email + http_response + land_collision + land_collision_end + land_collision_start + link_message + listen + money + moving_end + moving_start + no_sensor + not_at_rot_target + not_at_target + object_rez + on_rez + remote_data + run_time_permissions + sensor + state_entry + state_exit + timer + touch + touch_start + touch_end + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lua.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lua.plist new file mode 100644 index 00000000..a1ac856a --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/lua.plist @@ -0,0 +1,209 @@ + + + + + beginCommand + + endCommand + + beginFirstMultiLineComment + --[[ + endFirstMultiLineComment + ]] + beginInstruction + [[ + endInstruction + ]] + beginSecondMultiLineComment + + endSecondMultiLineComment + + beginVariable + + endVariable + + firstSingleLineComment + -- + secondSingleLineComment + + firstString + " + secondString + ' + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + break + do + else + elseif + end + false + for + function + if + in + local + nil + not + or + repeat + return + then + true + until + while + assert + collectgarbage + dofile + error + _G + getfenv + getmetatable + gcinfo + ipairs + loadfile + loadlib + loadstring + next + pairs + pcall + print + rawequal + rawget + rawset + require + setfenv + setmetatable + tonumber + tostring + type + unpack + _VERSION + xpcall + coroutine.create + coroutine.resume + coroutine.status + coroutine.wrap + coroutine.yield + string.byte + string.char + string.dump + string.find + string.len + string.lower + string.rep + string.sub + string.upper + string.format + string.gfind + string.gsub + table.concat + table.foreach + table.foreachi + table.getn + table.sort + table.insert + table.remove + table.setn + math.abs + math.acos + math.asin + math.atan + math.atan2 + math.ceil + math.cos + math.deg + math.exp + math.floor + math.log + math.log10 + math.max + math.min + math.mod + math.pow + math.rad + math.sin + math.sqrt + math.tan + math.frexp + math.ldexp + math.random + math.randomseed + math.pi + io.stdin + io.stdout + io.stderr + io.close + io.flush + io.input + io.lines + io.open + io.output + io.read + io.tmpfile + io.type + io.write + :close + :flush + :lines + :read + :seek + :write + os.clock + os.date + os.difftime + os.execute + os.exit + os.getenv + os.remove + os.rename + os.setlocale + os.time + os.tmpname + debug.debug + debug.gethook + debug.getinfo + debug.getlocal + debug.getupvalue + debug.setlocal + debug.setupvalue + debug.sethook + debug.traceback + __index + __newindex + __call + __plus + __sub + __mul + __div + __pow + __unm + __concat + __eq + __lt + __le + __mode + __metatable + __fenv + __tostring + self + LUA_PATH + _LOADED + _REQUIREDNAME + _PROMPT + _TRACEBACK + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/matlab.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/matlab.plist new file mode 100644 index 00000000..fd191baf --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/matlab.plist @@ -0,0 +1,1302 @@ + + + + + beginCommand + + endCommand + + beginFirstMultiLineComment + %{ + endFirstMultiLineComment + %} + beginInstruction + + endInstruction + + beginSecondMultiLineComment + + endSecondMultiLineComment + + beginVariable + + endVariable + + firstSingleLineComment + % + secondSingleLineComment + + firstString + ' + secondString + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + functionDefinition + + removeFromFunction + + keywords + + abs + accumarray + acos + acosd + acosh + acot + acotd + acoth + acsc + acscd + acsch + actxcontrol + actxcontrollist + actxcontrolselect + actxserver + addevent + addframe + addpath + addpref + addproperty + addsample + addsampletocollection + addtodate + addts + airy + align + alim + all + allchild + alpha + alphamap + ancestor + and + angle + annotation + Annotation Arrow Properties + Annotation Doublearrow Properties + Annotation Ellipse Properties + Annotation Line Properties + Annotation Rectangle Properties + Annotation Textarrow Properties + Annotation Textbox Properties + ans + any + area + Areaseries Properties + arrayfun + ascii + asec + asecd + asech + asin + asind + asinh + assignin + atan + atan2 + atand + atanh + audioplayer + audiorecorder + aufinfo + auread + auwrite + avifile + aviinfo + aviread + axes + Axes Properties + axis + balance + bar, barh + bar3, bar3h + Barseries Properties + base2dec + beep + besselh + besseli + besselj + besselk + bessely + beta + betainc + betaln + bicg + bicgstab + bin2dec + binary + bitand + bitcmp + bitget + bitmax + bitor + bitset + bitshift + bitxor + blanks + blkdiag + box + break + brighten + builtin + bvp4c + bvpget + bvpinit + bvpset + bvpval + calendar + calllib + callSoapService + camdolly + cameratoolbar + camlight + camlookat + camorbit + campan + campos + camproj + camroll + camtarget + camup + camva + camzoom + cart2pol + cart2sph + case + cast + cat + catch + caxis + cd + cd (ftp) + cdf2rdf + cdfepoch + cdfinfo + cdfread + cdfwrite + ceil + cell + cell2mat + cell2struct + celldisp + cellfun + cellplot + cellstr + cgs + char + checkin + checkout + chol + cholinc + cholupdate + circshift + cla + clabel + class + clc + clear + clear (serial) + clf + clipboard + clock + close + close (avifile) + close (ftp) + closereq + cmopts + colamd + colmmd + colorbar + colordef + colormap + colormapeditor + ColorSpec + colperm + comet + comet3 + commandhistory + commandwindow + compan + compass + complex + computer + cond + condeig + condest + coneplot + conj + continue + contour + contour3 + contourc + contourf + Contourgroup Properties + contourslice + contrast + conv + conv2 + convhull + convhulln + convn + copyfile + copyobj + corrcoef + cos + cosd + cosh + cot + cotd + coth + cov + cplxpair + cputime + createClassFromWsdl + createSoapMessage + cross + csc + cscd + csch + csvread + csvwrite + ctranspose (timeseries) + cumprod + cumsum + cumtrapz + curl + customverctrl + cylinder + daspect + datacursormode + datatipinfo + date + datenum + datestr + datetick + datevec + dbclear + dbcont + dbdown + dblquad + dbmex + dbquit + dbstack + dbstatus + dbstep + dbstop + dbtype + dbup + dde23 + ddeadv + ddeexec + ddeget + ddeinit + ddepoke + ddereq + ddesd + ddeset + ddeterm + ddeunadv + deal + deblank + debug + dec2base + dec2bin + dec2hex + decic + deconv + del2 + delaunay + delaunay3 + delaunayn + delete + delete (COM) + delete (ftp) + delete (serial) + delete (timer) + deleteproperty + delevent + delsample + delsamplefromcollection + demo + depdir + depfun + det + detrend + detrend (timeseries) + deval + diag + dialog + diary + diff + dir + dir (ftp) + disp + disp (memmapfile) + disp (serial) + disp (timer) + display + divergence + dlmread + dlmwrite + dmperm + doc + docopt + docsearch + dos + dot + double + dragrect + drawnow + dsearch + dsearchn + echo + echodemo + edit + eig + eigs + ellipj + ellipke + ellipsoid + else + elseif + enableservice + end + eomday + eps + eq + erf, erfc, erfcx, erfinv, erfcinv + error + errorbar + Errorbarseries Properties + errordlg + etime + etree + etreeplot + eval + evalc + evalin + eventlisteners + events + Execute + exifread + exist + exit + exp + expint + expm + expm1 + eye + ezcontour + ezcontourf + ezmesh + ezmeshc + ezplot + ezplot3 + ezpolar + ezsurf + ezsurfc + factor + factorial + false + fclose + fclose (serial) + feather + feof + ferror + feval + Feval (COM) + fft + fft2 + fftn + fftshift + fftw + fgetl + fgetl (serial) + fgets + fgets (serial) + fieldnames + figure + Figure Properties + figurepalette + File Formats + fileattrib + filebrowser + filemarker + fileparts + filesep + fill + fill3 + filter + filter (timeseries) + filter2 + find + findall + findfigs + findobj + findstr + finish + fitsinfo + fitsread + fix + flipdim + fliplr + flipud + floor + flops + flow + fminbnd + fminsearch + fopen + fopen (serial) + for + format + fplot + fprintf + fprintf (serial) + frame2im + frameedit + fread + fread (serial) + freqspace + frewind + fscanf + fscanf (serial) + fseek + ftell + ftp + full + fullfile + func2str + function + function_handle (@) + functions + funm + fwrite + fwrite (serial) + fzero + gallery + gamma, gammainc, gammaln + gca + gcbf + gcbo + gcd + gcf + gco + ge + genpath + genvarname + get + get (COM) + get (memmapfile) + get (serial) + get (timer) + get (timeseries) + get (tscollection) + getabstime (timeseries) + getabstime (tscollection) + getappdata + GetCharArray + getdatasamplesize + getenv + getfield + getframe + GetFullMatrix + getinterpmethod + getplottool + getpref + getqualitydesc + getsampleusingtime (timeseries) + getsampleusingtime (tscollection) + gettimeseriesnames + gettsafteratevent + gettsafterevent + gettsatevent + gettsbeforeatevent + gettsbeforeevent + gettsbetweenevents + GetVariable + GetWorkspaceData + ginput + global + gmres + gplot + grabcode + gradient + graymon + grid + griddata + griddata3 + griddatan + gsvd + gt + gtext + guidata + guide + guihandles + gunzip + gzip + hadamard + hankel + hdf + hdf5 + hdf5info + hdf5read + hdf5write + hdfinfo + hdfread + hdftool + help + helpbrowser + helpdesk + helpdlg + helpwin + hess + hex2dec + hex2num + hgexport + hggroup + Hggroup Properties + hgload + hgsave + hgtransform + Hgtransform Properties + hidden + hilb + hist + histc + hold + home + horzcat + horzcat (tscollection) + hostid + hsv2rgb + hypot + i + idealfilter (timeseries) + idivide + if + ifft + ifft2 + ifftn + ifftshift + im2frame + im2java + imag + image + Image Properties + imagesc + imfinfo + imformats + import + importdata + imread + imwrite + ind2rgb + ind2sub + Inf + inferiorto + info + inline + inmem + inpolygon + input + inputdlg + inputname + inspect + instrcallback + instrfind + int2str + int8, int16, int32, int64 + interfaces + interp1 + interp1q + interp2 + interp3 + interpft + interpn + interpstreamspeed + intersect + intmax + intmin + intwarning + inv + invhilb + invoke + ipermute + iqr (timeseries) + is* + isa + isappdata + iscell + iscellstr + ischar + iscom + isdir + isempty + isempty (timeseries) + isempty (tscollection) + isequal + isequalwithequalnans + isevent + isfield + isfinite + isfloat + isglobal + ishandle + ishold + isinf + isinteger + isinterface + isjava + iskeyword + isletter + islogical + ismember + ismethod + isnan + isnumeric + isobject + isocaps + isocolors + isonormals + isosurface + ispc + ispref + isprime + isprop + isreal + isscalar + issorted + isspace + issparse + isstr + isstrprop + isstruct + isstudent + isunix + isvalid + isvalid (timer) + isvarname + isvector + j + javaaddpath + javaArray + javachk + javaclasspath + javaMethod + javaObject + javarmpath + keyboard + kron + lasterr + lasterror + lastwarn + lcm + ldivide, rdivide + le + legend + legendre + length + length (serial) + length (timeseries) + length (tscollection) + libfunctions + libfunctionsview + libisloaded + libpointer + libstruct + license + light + Light Properties + lightangle + lighting + lin2mu + line + Line Properties + Lineseries Properties + LineSpec + linkaxes + linkprop + linsolve + linspace + listdlg + load + load (COM) + load (serial) + loadlibrary + loadobj + log + log10 + log1p + log2 + logical + loglog + logm + logspace + lookfor + lower + ls + lscov + lsqnonneg + lsqr + lt + lu + luinc + magic + makehgtform + mat2cell + mat2str + material + matlab (UNIX) + matlab (Windows) + matlabcolon (matlab:) + matlabrc + matlabroot + max + max (timeseries) + MaximizeCommandWindow + mean + mean (timeseries) + median + median (timeseries) + memmapfile + memory + menu + mesh, meshc, meshz + meshgrid + methods + methodsview + mex + mexext + mfilename + mget + min + min (timeseries) + MinimizeCommandWindow + minres + mislocked + mkdir + mkdir (ftp) + mkpp + mldivide \, mrdivide / + mlint + mlintrpt + mlock + mmfileinfo + mod + mode + more + move + movefile + movegui + movie + movie2avi + mput + msgbox + mtimes + mu2lin + multibandread + multibandwrite + munlock + namelengthmax + NaN + nargchk + nargin, nargout + nargoutchk + native2unicode + nchoosek + ndgrid + ndims + ne + newplot + nextpow2 + nnz + noanimate + nonzeros + norm + normest + not + notebook + now + nthroot + null + num2cell + num2hex + num2str + numel + nzmax + ode15i + ode23, ode45, ode113, ode15s, ode23s, ode23t, ode23tb + odefile + odeget + odeset + odextend + ones + open + openfig + opengl + openvar + optimget + optimset + or + ordeig + orderfields + ordqz + ordschur + orient + orth + otherwise + pack + pagesetupdlg + pan + pareto + parseSoapResponse + partialpath + pascal + patch + Patch Properties + path + path2rc + pathdef + pathsep + pathtool + pause + pbaspect + pcg + pchip + pcode + pcolor + pdepe + pdeval + peaks + perl + perms + permute + persistent + pi + pie + pie3 + pinv + planerot + playshow + plot + plot (timeseries) + plot3 + plotbrowser + plotedit + plotmatrix + plottools + plotyy + pol2cart + polar + poly + polyarea + polyder + polyeig + polyfit + polyint + polyval + polyvalm + pow2 + power + ppval + prefdir + preferences + primes + print, printopt + printdlg + printpreview + prod + profile + profsave + propedit + propedit (COM) + propertyeditor + psi + publish + PutCharArray + PutFullMatrix + PutWorkspaceData + pwd + qmr + qr + qrdelete + qrinsert + qrupdate + quad, quad8 + quadl + quadv + questdlg + quit + Quit (COM) + quiver + quiver3 + Quivergroup Properties + qz + rand + randn + randperm + rank + rat, rats + rbbox + rcond + readasync + real + reallog + realmax + realmin + realpow + realsqrt + record + rectangle + Rectangle Properties + rectint + recycle + reducepatch + reducevolume + refresh + refreshdata + regexp, regexpi + regexprep + regexptranslate + registerevent + rehash + release + rem + removets + rename + repmat + resample (timeseries) + resample (tscollection) + reset + reshape + residue + restoredefaultpath + rethrow + return + rgb2hsv + rgbplot + ribbon + rmappdata + rmdir + rmdir (ftp) + rmfield + rmpath + rmpref + root object + Root Properties + roots + rose + rosser + rot90 + rotate + rotate3d + round + rref + rsf2csf + run + save + save (COM) + save (serial) + saveas + saveobj + savepath + scatter + scatter3 + Scattergroup Properties + schur + script + sec + secd + sech + selectmoveresize + semilogx, semilogy + send + sendmail + serial + serialbreak + set + set (COM) + set (serial) + set (timer) + set (timeseries) + set (tscollection) + setabstime (timeseries) + setabstime (tscollection) + setappdata + setdiff + setenv + setfield + setinterpmethod + setpref + setstr + settimeseriesnames + setxor + shading + shiftdim + showplottool + shrinkfaces + sign + sin + sind + single + sinh + size + size (serial) + size (timeseries) + size (tscollection) + slice + smooth3 + sort + sortrows + sound + soundsc + spalloc + sparse + spaugment + spconvert + spdiags + speye + spfun + sph2cart + sphere + spinmap + spline + spones + spparms + sprand + sprandn + sprandsym + sprank + sprintf + spy + sqrt + sqrtm + squeeze + ss2tf + sscanf + stairs + Stairseries Properties + start + startat + startup + std + std (timeseries) + stem + stem3 + Stemseries Properties + stop + stopasync + str2double + str2func + str2mat + str2num + strcat + strcmp + strcmpi + stream2 + stream3 + streamline + streamparticles + streamribbon + streamslice + streamtube + strfind + strings + strjust + strmatch + strncmp + strncmpi + strread + strrep + strtok + strtrim + struct + struct2cell + structfun + strvcat + sub2ind + subplot + subsasgn + subsindex + subspace + subsref + substruct + subvolume + sum + sum (timeseries) + superiorto + support + surf, surfc + surf2patch + surface + Surface Properties + Surfaceplot Properties + surfl + surfnorm + svd + svds + swapbytes + switch + symamd + symbfact + symmlq + symmmd + symrcm + symvar + synchronize + syntax + system + tan + tand + tanh + tar + tempdir + tempname + tetramesh + texlabel + text + Text Properties + textread + textscan + textwrap + tic, toc + timer + timerfind + timerfindall + timeseries + title + todatenum + toeplitz + toolboxdir + trace + transpose (timeseries) + trapz + treelayout + treeplot + tril + trimesh + triplequad + triplot + trisurf + triu + true + try + tscollection + tsdata.event + tsearch + tsearchn + tsprops + tstool + type + typecast + uibuttongroup + Uibuttongroup Properties + uicontextmenu + Uicontextmenu Properties + uicontrol + Uicontrol Properties + uigetdir + uigetfile + uigetpref + uiimport + uimenu + Uimenu Properties + uint8, uint16, uint32, uint64 + uiopen + uipanel + Uipanel Properties + uipushtool + Uipushtool Properties + uiputfile + uiresume, uiwait + uisave + uisetcolor + uisetfont + uisetpref + uistack + uitoggletool + Uitoggletool Properties + uitoolbar + Uitoolbar Properties + undocheckout + unicode2native + union + unique + unix + unloadlibrary + unmkpp + unregisterallevents + unregisterevent + untar + unwrap + unzip + upper + urlread + urlwrite + usejava + vander + var + var (timeseries) + varargin + varargout + vectorize + ver + verctrl + version + vertcat + vertcat (timeseries) + vertcat (tscollection) + view + viewmtx + volumebounds + voronoi + voronoin + wait + waitbar + waitfor + waitforbuttonpress + warndlg + warning + waterfall + wavfinfo + wavplay + wavread + wavrecord + wavwrite + web + weekday + what + whatsnew + which + while + whitebg + who, whos + wilkinson + winopen + winqueryreg + wk1finfo + wk1read + wk1write + workspace + xlabel, ylabel, zlabel + xlim, ylim, zlim + xlsfinfo + xlsread + xlswrite + xmlread + xmlwrite + xor + xslt + zeros + zip + zoom + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mel.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mel.plist new file mode 100644 index 00000000..9e4452c9 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mel.plist @@ -0,0 +1,1133 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + $%@ + endVariable + :;(){}=+-/.,*!?%&><\` + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + source + global + proc + int + float + string + vector + matrix + true + false + for + foreach + in + if + else + while + do + switch + case + default + break + continue + time + frame + about + abs + addAttr + addAttributeEditorNodeHelp  + addDynamic + addNewShelfTab  + addPP + advanceToNextDrivenKey  + affectedNet + affects + aimConstraint + air + alias + aliasAttr + align + alignCtx + alignCurve + alignSurface + allViewFit  + ambientLight + angle + angleBetween + animCone  + animCurveEditor + animDisplay + animView + annotate + appendStringArray  + applicationName  + applyAttrPreset  + applyTake + arcLenDimContext + arcLengthDimension + arclen + arrayMapper + art3dPaintCtx + artAttrCtx + artAttrPaintVertexCtx + artBuildPaintMenu + artFluidAttrCtx + artPuttyCtx + artSelectCtx + artSetPaintCtx + artUserPaintCtx + assignCommand + assignInputDevice + attachCurve + attachDeviceAttr + attachSurface + attrColorSliderGrp + attrCompatibility + attrControlGrp + attrEnumOptionMenu + attrEnumOptionMenuGrp + attrFieldGrp + attrFieldSliderGrp + attrNavigationControlGrp + attrPresetEditWin  + attributeExists  + attributeInfo + attributeMenu + attributeQuery + autoKeyframe + autoPlace + bakeClip + bakeResults + bakeSimulation + basename  + basenameEx  + batchRender + bessel + bevel + bevelPlus + binMembership + bindPose + bindSkin + blend2 + blendShape + blendShapeEditor + blendShapePanel + blendTwoAttr + blindDataType + boneLattice + boundary + boxDollyCtx + boxZoomCtx + bufferCurve + buildBookmarkMenu + buildKeyframeMenu + button + buttonManip + CBG  + camera + cameraView + canCreateManip + canvas + capitalizeString  + catch + catchQuiet + ceil + changeSubdivComponentDisplayLevel + changeSubdivRegion + channelBox + character + characterMap + characterOutlineEditor + chdir + checkBox + checkBoxGrp + checkDefaultRenderGlobals + choice + circle + circularFillet + clamp + clear + clearCache + clip + clipEditor + clipEditorCurrentTimeCtx + clipSchedule + clipSchedulerOutliner + clipTrimBefore  + closeCurve + closeSurface + cluster + cmdFileOutput + cmdShell + collision + color + colorAtPoint + colorEditor + colorIndex + colorIndexSliderGrp + colorSliderButtonGrp + colorSliderGrp + columnLayout + commandEcho + commandLine + commandPort + componentEditor + computePolysetVolume  + condition + cone + confirmDialog + connectAttr + connectControl + connectDynamic + connectJoint + connectionInfo + constrain + constrainValue + constructionHistory + contextInfo + control + convertFromOldLayers  + convertLightmap + convertSolidTx + convertTessellation + convertUnit + copyArray  + copyFlexor + copyKey + copySkinWeights + cos + cpButton + cpCache + cpCollision + cpConstraint + cpPanel + cpProperty + cpSeam + cpSolver + cpTool + createDisplayLayer + createDrawCtx + createEditor + createMotionField  + createNewShelf  + createNode + createRenderLayer + createSubdivRegion + cross + crossProduct  + ctxAbort + ctxCompletion + ctxEditMode + ctxTraverse + currentCtx + currentTime + currentTimeCtx + currentUnit + curve + curveAddPtCtx + curveCVCtx + curveEPCtx + curveEditorCtx + curveIntersect + curveMoveEPCtx + curveOnSurface + curveSketchCtx + cutKey + cycleCheck + cylinder + dagPose + defaultLightListCheckBox + defaultNavigation + defineDataServer + defineVirtualDevice + deformer + deg_to_rad + delete + deleteAttr + deleteShadingGroupsAndMaterials  + deleteShelfTab  + deleteUI + deleteUnusedBrushes  + delrandstr + detachCurve + detachDeviceAttr + detachSurface + deviceEditor + devicePanel + dgInfo + dgdirty + dgeval + dgtimer + dimWhen + directKeyCtx + directionalLight + dirmap + dirname  + disable + disconnectAttr + disconnectJoint + diskCache + displacementToPoly + displayAffected + displayColor + displayCull + displayLevelOfDetail + displayPref + displayRGBColor + displaySmoothness + displayStats + displaySurface + distanceDimContext + distanceDimension + doBlur + dolly + dollyCtx + dopeSheetEditor + dot + dotProduct  + doubleProfileBirailSurface + drag + draggerContext + dropoffLocator + duplicate + duplicateCurve + duplicateSurface + dynCache + dynControl + dynExport + dynExpression + dynGlobals + dynPaintEditor + dynParticleCtx + dynPref + dynRelEdPanel + dynRelEditor + dynamicLoad + editAttrLimits  + editDisplayLayerGlobals + editDisplayLayerMembers + editRenderLayerGlobals + editRenderLayerMembers + editor + editorTemplate + effector + emit + emitter + enableDevice + encodeString + endString  + endsWith  + env + equivalent  + equivalentTol  + erf + error + eval + evalDeferred + evalEcho + event + exactWorldBoundingBox + exclusiveLightCheckBox + exec + executeForEachObject  + exists + exp + exportComposerCurves  + expression + expressionEditorListen + extendCurve + extendSurface + extrude + fcheck + fclose + feof + fflush + fgetline + fgetword + file + fileBrowserDialog + fileDialog + fileExtension  + fileInfo + filetest + filletCurve + filter + filterCurve + filterExpand + filterStudioImport + findAllIntersections  + findKeyframe + findMenuItem  + findRelatedSkinCluster  + finder + firstParentOf  + fitBspline + flexor + floatEq  + floatField + floatFieldGrp + floatScrollBar + floatSlider + floatSliderButtonGrp + floatSliderGrp + floor + flow + fluidCacheInfo + fluidEmitter + fluidVoxelInfo + flushUndo + fmod + fontDialog + fopen + formLayout + fprint + frameLayout + fread + freeFormFillet + frewind + fromNativePath  + fwrite + gamma + gauss + geometryConstraint + getApplicationVersionAsFloat  + getAttr + getClassification + getDefaultBrush + getFileList + getFluidAttr + getInputDeviceRange + getMayaPanelTypes  + getModifiers + getPanel + getParticleAttr + getenv + getpid + glRender + glRenderEditor + globalStitch + gmatch + goal + gotoBindPose  + grabColor + gradientControl + gradientControlNoAttr + graphDollyCtx + graphSelectContext + graphTrackCtx + gravity + grid + gridLayout + group + groupObjectsByName + hardenPointCurve + hardware + hardwareRenderPanel + headsUpDisplay + help + helpLine + hermite + hide + hilite + hitTest + hotBox + hotkey + hotkeyCheck + hsv_to_rgb + hwReflectionMap + hwRender + hwRenderLoad + hyperGraph + hyperPanel + hyperShade + hypot + iconTextButton + iconTextCheckBox + iconTextRadioButton + iconTextRadioCollection + iconTextStaticLabel + ikHandle + ikHandleCtx + ikHandleDisplayScale + ikSolver + ikSplineHandleCtx + ikSystem + ikSystemInfo + ikfkDisplayMethod + image + imfPlugins + importComposerCurves  + inheritTransform + insertJoint + insertJointCtx + insertKeyCtx + insertKnotCurve + insertKnotSurface + instance + instancer + intField + intFieldGrp + intScrollBar + intSlider + intSliderGrp + interToUI  + internalVar + intersect + iprEngine + isAnimCurve  + isConnected + isDirty + isParentOf  + isTrue + isValidObjectName  + isValidString  + isValidUiName  + isolateSelect + itemFilter + itemFilterAttr + itemFilterRender + itemFilterType + joint + jointCluster + jointCtx + jointDisplayScale + jointLattice + keyTangent + keyframe + keyframeOutliner + keyframeRegionCurrentTimeCtx + keyframeRegionDirectKeyCtx + keyframeRegionDollyCtx + keyframeRegionInsertKeyCtx + keyframeRegionMoveKeyCtx + keyframeRegionScaleKeyCtx + keyframeRegionSelectKeyCtx + keyframeRegionSetKeyCtx + keyframeRegionTrackCtx + keyframeStats + lassoContext + lattice + latticeDeformKeyCtx + launch + layerButton + layeredShaderPort + layeredTexturePort + layout + lightList + lightListEditor + lightListPanel + lightlink + lineIntersection  + linstep + listAnimatable + listAttr + listCameras + listConnections + listDeviceAttachments + listHistory + listInputDeviceAxes + listInputDeviceButtons + listInputDevices + listMenuAnnotation  + listNodeTypes + listRelatives + listSets + listTransforms  + listUnselected  + listerEditor + loadFluid + loadNewShelf  + loadPlugin + loadPrefObjects + lockNode + loft + log + lookThru + ls + lsThroughFilter + lsType  + lsUI + Mayatomr + mag + makeIdentity + makeLive + makePaintable + makeRoll  + makeSingleSurface + makebot + manipMoveContext + manipMoveLimitsCtx + manipOptions + manipRotateContext + manipRotateLimitsCtx + manipScaleContext + manipScaleLimitsCtx + marker + match + max + memory + menu + menuBarLayout + menuEditor + menuItem + menuItemToShelf  + messageLine + min + minimizeApp + mirrorJoint + modelCurrentTimeCtx + modelEditor + modelPanel + movIn + movOut + move + moveIKtoFK  + moveKeyCtx + moveVertexAlongDirection + multiProfileBirailSurface + mute + nameCommand + nameField + namespace + namespaceInfo + newPanelItems + newton + nodeIconButton + nodeOutliner + nodePreset + nodeType + noise + nonLinear + normalConstraint + normalize  + nurbsBoolean + nurbsCopyUVSet + nurbsCube + nurbsPlane + nurbsSelect + nurbsSquare + nurbsToPoly + nurbsToPolygonsPref + nurbsToSubdiv + nurbsViewDirectionVector + objExists + objectCenter + objectLayer  + objectType + objectTypeUI + obsoleteProc  + offsetCurve + offsetCurveOnSurface + offsetSurface + openGLExtension + openMayaPref + optionMenu + optionMenuGrp + optionVar + orbit + orbitCtx + orientConstraint + outlinerEditor + outlinerPanel + overrideModifier + pairBlend + palettePort + paneLayout + panel + panelConfiguration + panelHistory + paramDimContext + paramDimension + paramLocator + parent + parentConstraint + particle + particleExists + particleInstancer + particleRenderInfo + partition + pasteKey + pathAnimation + pause + pclose + percent + performanceOptions + pfxstrokes + pickWalk + picture + pixelMove + planarSrf + plane + play + playbackOptions + playblast + pluginInfo + pointConstraint + pointCurveConstraint + pointLight + pointMatrixMult  + pointOnCurve + pointOnSurface + pointPosition + poleVectorConstraint + polyAppend + polyAppendFacetCtx + polyAppendVertex + polyAutoProjection + polyAverageNormal + polyAverageVertex + polyBevel + polyBlindData + polyBoolOp + polyChipOff + polyClipboard + polyCloseBorder + polyCollapseEdge + polyCollapseFacet + polyColorBlindData + polyColorPerVertex + polyCone + polyCopyUV + polyCreateFacet + polyCreateFacetCtx + polyCube + polyCut + polyCutCtx + polyCylinder + polyCylindricalProjection + polyDelEdge + polyDelFacet + polyDelVertex + polyDuplicateAndConnect + polyEditUV + polyEvaluate + polyExtrudeEdge + polyExtrudeFacet + polyFlipEdge + polyFlipUV + polyForceUV + polyGeoSampler + polyInfo + polyInstallAction + polyLayoutUV + polyListComponentConversion + polyMapCut + polyMapDel + polyMapSew + polyMapSewMove + polyMergeEdge + polyMergeEdgeCtx + polyMergeFacet + polyMergeFacetCtx + polyMergeUV + polyMergeVertex + polyMoveEdge + polyMoveFacet + polyMoveFacetUV + polyMoveUV + polyMoveVertex + polyNormal + polyNormalPerVertex + polyNormalizeUV + polyOptions + polyPlanarProjection + polyPlane + polyPoke + polyProjection + polyQuad + polyQueryBlindData + polyReduce + polySelectConstraint + polySelectConstraintMonitor + polySeparate + polySetToFaceNormal + polySewEdge + polySmooth + polySoftEdge + polySphere + polySphericalProjection + polySplit + polySplitCtx + polySplitEdge + polySplitVertex + polyStraightenUVBorder + polySubdivideEdge + polySubdivideFacet + polySuperCtx + polyToSubdiv + polyTorus + polyTransfer + polyTriangulate + polyUVSet + polyUnite + polyWedgeFace + popen + popupMenu + pose + pow + print + progressBar + progressWindow + projFileViewer + projectCurve + projectTangent + projectionContext + projectionManip + promptDialog + propModCtx + propMove + psdExport + psdTextureFile + putenv + pwd + querySubdiv + quit + rad_to_deg + radial + radioButton + radioButtonGrp + radioCollection + radioMenuItemCollection + rampColorPort + rand + randstate + rangeControl + readTake + rebuildCurve + rebuildSurface + recordAttr + recordDevice + redo + reference + refineSubdivSelectionList + refresh + refreshAE  + rehash + reloadImage + removeJoint + removeMultiInstance + rename + renameAttr + renameSelectionList  + renameUI + render + renderGlobalsNode + renderInfo + renderLayerButton + renderManip + renderPartition + renderQualityNode + renderThumbnailUpdate + renderWindowEditor + renderWindowSelectContext + renderer + reorder + reorderDeformers + requires + reroot + resampleFluid + resetAE  + resetTool + resolutionNode + retarget + reverseCurve + reverseSurface + revolve + rgb_to_hsv + rigidBody + rigidSolver + roll + rollCtx + rootOf  + rot + rotate + rotationInterpolation + roundConstantRadius + rowColumnLayout + rowLayout + runTimeCommand + runup + sampleImage + saveAllShelves + saveAttrPreset  + saveFluid + saveImage + saveInitialState + saveMenu + savePrefObjects + savePrefs + saveShelf + saveToolSettings + scale + scaleConstraint + scaleKey + scaleKeyCtx + sceneUIReplacement + scmh + scriptCtx + scriptEditorInfo + scriptJob + scriptNode + scriptTable + scriptedPanel + scriptedPanelType + scrollField + scrollLayout + sculpt + searchPathArray  + seed + selLoadSettings + select + selectContext + selectKey + selectKeyCtx + selectMode + selectPref + selectPriority + selectType + selectedNodes + selectionConnection + separator + setAttr + setAttrMapping + setConstraintRestPosition  + setDefaultShadingGroup + setDrivenKeyframe + setDynamic + setEditCtx + setEditor + setEscapeCtx + setFluidAttr + setFocus + setInfinity + setInputDeviceMapping + setKeyCtx + setKeyPath + setKeyframe + setMenuMode + setNodeTypeFlag + setParent + setParticleAttr + setProject  + setStartupMessage + setState  + setToolTo + setUITemplate + sets + shadingConnection + shadingGeometryRelCtx + shadingGroupDialogDaemon + shadingLightRelCtx + shadingNode + shelfButton + shelfLayout + shelfTabLayout + shellField + showHelp + showHidden + showManipCtx + showSelectionInTitle + showShadingGroupAttrEditor + showWindow + sign + simplify + sin + singleProfileBirailSurface + size + skinCluster + skinPercent + smoothCurve + smoothTangentSurface + smoothstep + snap2to2  + snapKey + snapMode + snapTogetherCtx + snapshot + soft + softMod + softModCtx + sort + sound + soundControl + source + spaceLocator + sphere + sphrand + spotLight + spotLightPreviewPort + spreadSheetEditor + spring + sqrt + squareSurface + srtContext + stackTrace + startString  + startsWith  + stitchAndExplodeShell  + stitchSurface + stitchSurfacePoints + strcmp + stringArrayCatenate  + stringArrayCount  + stringArrayIntersector + stringArrayRemove  + stringArrayRemoveDuplicates  + stringArrayToString  + stringToStringArray  + strip  + stroke + subdAutoProjection + subdCleanTopology + subdCollapse + subdDuplicateAndConnect + subdEditUV + subdListComponentConversion + subdMapCut + subdMapSewMove + subdMatchTopology + subdMirror + subdToBlind + subdToPoly + subdTransferUVsToCache + subdiv + subdivCrease + subdivDisplaySmoothness + substitute + substituteAllString  + substring + superCtx + surface + surfaceShaderList + swatchDisplayPort + switchTable + symbolButton + symbolCheckBox + sysFile + system + tabLayout + tan + tangentConstraint + texManipContext + texMoveContext + texRotateContext + texScaleContext + texSelectContext + texWinToolCtx + text + textCurves + textField + textFieldButtonGrp + textFieldGrp + textScrollList + textToShelf  + textureDisplacePlane  + texturePlacementContext + textureWindow + threePointArcCtx + timeControl + timePort + timerX + toNativePath  + toggle + toggleAxis + toggleWindowVisibility + tokenize + tokenizeList  + tolerance + tolower + toolButton + toolCollection + toolDropped + toolHasOptions + toolPropertyWindow + torus + toupper + trace + track + trackCtx + transformLimits + translator + trim + trunc + truncateFluidCache + truncateHairCache + tumble + tumbleCtx + turbulence + twoPointArcCtx + uiTemplate + unassignInputDevice + undo + undoInfo + ungroup + uniform + unit + unloadPlugin + untangleUV + untrim + upAxis + updateAE  + userCtx + uvLink + uvSnapshot + validateShelfName  + vectorize + verifyCmd  + view2dToolCtx + viewCamera + viewClipPlane + viewFit + viewHeadOn + viewLookAt + viewPlace + viewSet + visor + volumeAxis + vortex + waitCursor + warning + webBrowser + whatIs + window + windowPref + wire + wireContext + workspace + wrinkle + wrinkleContext + writeTake + xbmLangPathList  + xform + xpmPicker + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metapost.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metapost.plist new file mode 100644 index 00000000..f781b00e --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metapost.plist @@ -0,0 +1,550 @@ + + + + + beginCommand + { + endCommand + } + beginInstruction + + endInstruction + + beginVariable + \ + endVariable + {}()[],?.;/:+=><~ + firstString + " + secondString + $ + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(def|vardef|primarydef|secondarydef|tertiarydef|beginfig)\s*.*[;=] + removeFromFunction + = + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + @# + abs + addto + ahangle + ahlength + also + and + angle + arclength + arctime + arrowhead + ASCII + atleast + background + bbox + bboxmargin + beginfig + begingroup + beveled + black + blackpart + blankpicture + blue + bluepart + boolean + bot + bounded + boxit + boxjoin + bp + bpath + btex + buildcycle + butt + bye + byte + cc + ceiling + center + char + charcode + circleit + circmargin + clearit + clearpen + clearxy + clip + clipped + cm + cmykcolor + color + colormodel + contour + controls + cosd + counterclockwise + curl + currentpen + currentpicture + cutafter + cutbefore + cutdraw + cuttings + cyanpart + cycle + dashed + dashpart + dashpattern + day + dd + decimal + decr + def + defaultcolormodel + defaultdx + defaultdy + defaultfont + defaultpen + defaultscale + delimiters + dir + direction + directionpoint + directiontime + ditto + div + dotlabel + dotlabeldiam + dotlabels + dotprod + doublepath + down + downto + draw + drawarrow + drawboxed + drawboxes + drawdblarrow + drawdot + drawoptions + drawunboxed + else + elseif + end + enddef + endfig + endfor + endgroup + EOF + eps + epsilon + erase + errmessage + etex + evenly + exitif + exitunless + exp + expandafter + expr + extra_beginfig + extra_endfig + false + fi + filenametemplate + fill + filldraw + filled + fixpos + fixsize + flex + floor + fontmapfile + fontmapline + fontpart + fontsize + for + forever + forsuffixes + fullcircle + gobble + gobbled + granularity + green + greenpart + greypart + halfcircle + hex + hide + hround + identity + if + image + in + incr + infinity + infont + input + interact + interim + interpath + intersectionpoint + intersectiontimes + inverse + killtext + known + label + labeloffset + labels + laboff + labxf + labyf + left + length + let + lft + linecap + linejoin + llcorner + llft + loggingall + lrcorner + lrt + magentapart + magstep + makegrid + makelabel + makepath + makepen + max + message + mexp + min + mitered + miterlimit + mlog + mm + mod + month + mpprocset + mpxbreak + mpversion + newinternal + normaldeviate + not + nullpen + nullpicture + numeric + numtok + oct + odd + of + off + on + or + origin + outer + pair + path + pathpart + pausing + pc + pen + pencircle + penlabels + penoffset + penoffset + penpart + penpos + penrazor + penspeck + pensquare + penstroke + pic + pickup + picture + point + postcontrol + precontrol + primary + primarydef + prologues + pt + quartercircle + randomseed + range + readstring + red + redpart + reflectedabout + relax + restoreclipcolor + reverse + rgbcolor + right + rotated + rotatedabout + rotatedaround + round + rounded + rt + save + savepen + scaled + scantokens + secondary + secondarydef + setbounds + shifted + shipit + shipout + show + showdependencies + showstopping + showtoken + showvariable + sind + slanted + softjoin + solve + special + sqrt + squared + step + stop + str + string + subpath + stroked + substring + suffix + superellipse + takepower + tension + tensepath + tertiary + tertiarydef + text + textpart + textual + thelabel + thru + time + tolerance + to + top + tracingall + tracingcapsules + tracingchoices + tracingcommands + tracingequations + tracinglostchars + tracingmacros + tracingnone + tracingonline + tracingoutput + tracingrestores + tracingspecs + tracingstats + tracingtitles + transform + transformed + troffmode + true + truecorners + turningcheck + turningnumber + ulcorner + ulft + undraw + undrawdot + unfill + unfilldraw + uniformdeviate + unitsquare + unitvector + unknown + until + up + upto + urcorner + urt + vardef + verbatimtex + vround + warningcheck + whatever + white + withcmykcolor + withcolor + withdots + withgreyscale + within + withoutcolor + withpen + withgreyscale + withoutcolor + withpostscript + withprescript + withrgbcolor + xpart + xscaled + xxpart + xypart + year + yellowpart + ypart + yscaled + yxpart + yypart + z + zscaled + + acos + acosh + along + asin + asinh + atan + bbheight + bbwidth + bcircle + blownup + bottomboundary + bottomenlarged + boundingbox + circular_shade + cmyk + cos + cosh + cot + cotd + curved + cutends + define_circular_shade + define_linear_shade + drawfill + drawpath + drawpoints + enlarged + externalfigure + fulldiamond + fullsquare + function + graphictext + graphictextdirective + graphictextformat + grayed + hlingrid + hlinlabel + hlintext + hloggrid + hlogtext + innerboundingbox + inv + invcos + inverted + invsin + lcircle + leftboundary + leftenlarged + linear_shade + linlin + linlinpath + linlog + linlogpath + llcircle + llenlarged + llmoved + lltriangle + loadfigure + log + loglin + loglinpath + loglog + loglogpath + ln + lrcircle + lrenlarged + lrmoved + lrtriangle + number + outerboundingbox + outlinefill + pow + predefined_circular_shade + predefined_linear_shade + processpath + punked + randomized + randomshifted + recolor + redraw + refill + regraphictext + remapcolor + resetcolormap + resetgraphictextdirective + reversefill + rcircle + rightboundary + rightenlarged + simplified + softened + sin + sinh + sqr + squeezed + stretched + superellipsed + tan + tand + tcircle + topboundary + topenlarged + transparent + undrawfill + unitcircle + unitdiamond + ulcircle + ulenlarged + ulmoved + ultriangle + uncolored + unspiked + urcircle + urenlarged + urmoved + urtriangle + vlingrid + vlinlabel + vlintext + vloggrid + vlogtext + withdrawcolor + withfillcolor + withshade + xsized + xyscaled + xysized + yellow + ysized + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metaslang.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metaslang.plist new file mode 100644 index 00000000..d4daf388 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/metaslang.plist @@ -0,0 +1,187 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + (* + endFirstMultiLineComment + *) + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + as + axiom + by + case + choose + conjecture + def + else + embed + embed? + endspec + ex + ex1 + fa + false + fn + from + generate + if + import + in + infixl + infixr + is + let + morphism + obligations + of + op + project + prove + qualifying + quotient + sort + spec + the + then + theorem + true + type + where + Bijective + Boolean + Char + Comparison + Cons + Equal + Greater + Injective + Integer + Less + List + Nat + Nil + None + NonZeroInteger + Option + PosNat + Some + String + Surjective + abs + all + bijective? + chr + compare + concat + concatList + cons + diff + div + exists + explode + filter + find + firstUpTo + flatten + foldl + foldr + hd + id + implode + injective? + insert + intConvertible + intToString + inverse + isAlpha + isAlphaNum + isAscii + isLowerCase + isNum + isUpperCase + length + leq + locationOf + lt + map + mapOption + mapPartial + max + member + min + natConvertible + natToString + newline + nil + none + none? + nth + nthTail + null + one + ord + posNat? + pred + rem + rev + show + some + some + splitList + stringToInt + stringToNat + sub + sublist + substring + succ + surjective? + tabulate + tl + toLowerCase + toScreen + toString + toUpperCase + translate + two + writeLine + zero + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mysql.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mysql.plist new file mode 100644 index 00000000..2fb0b628 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/mysql.plist @@ -0,0 +1,532 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + -- + firstString + " + functionDefinition + + keywords + + ACCESSIBLE + ABS + ADD + ALL + ALTER + ANALYZE + AND + AS + ASC + ASENSITIVE + BEFORE + BETWEEN + BIGINT + BINARY + BLOB + BOTH + BY + CALL + CASCADE + CASE + CHANGE + CHAR + CHARACTER + CHECK + COLLATE + COLUMN + CONDITION + CONNECTION + CONSTRAINT + CONTINUE + CONVERT + CREATE + CROSS + CURRENT_DATE + CURRENT_TIME + CURRENT_TIMESTAMP + CURRENT_USER + CURSOR + DATABASE + DATABASES + DATETIME + DAY_HOUR + DAY_MICROSECOND + DAY_MINUTE + DAY_SECOND + DEC + DECIMAL + DECLARE + DEFAULT + DELAYED + DELETE + DESC + DESCRIBE + DETERMINISTIC + DISTINCT + DISTINCTROW + DIV + DOUBLE + DROP + DUAL + EACH + ELSE + ELSEIF + ENCLOSED + ENGINE + ESCAPED + EXISTS + EXIT + EXPLAIN + FALSE + FETCH + FLOAT + FLOAT4 + FLOAT8 + FOR + FORCE + FOREIGN + FROM + FULLTEXT + GOTO + GRANT + GROUP + HAVING + HIGH_PRIORITY + HOUR_MICROSECOND + HOUR_MINUTE + HOUR_SECOND + IF + IGNORE + IN + INDEX + INFILE + INNER + INOUT + INSENSITIVE + INSERT + INT + INT1 + INT2 + INT3 + INT4 + INT8 + INTEGER + INTERVAL + INTO + IS + ITERATE + JOIN + KEY + KEYS + KILL + LABEL + LEADING + LEAVE + LEFT + LIKE + LIMIT + LINEAR + LINES + LOAD + LOCALTIME + LOCALTIMESTAMP + LOCK + LONG + LONGBLOB + LONGTEXT + LOOP + LOW_PRIORITY + MASTER_SSL_VERIFY_SERVER_CERT + MATCH + MEDIUMBLOB + MEDIUMINT + MEDIUMTEXT + MIDDLEINT + MINUTE_MICROSECOND + MINUTE_SECOND + MOD + MODIFIES + NATURAL + NOT + NO_WRITE_TO_BINLOG + NULL + NUMERIC + ON + OPTIMIZE + OPTION + OPTIONALLY + OR + ORDER + OUT + OUTER + OUTFILE + PRECISION + PRIMARY + PROCEDURE + PURGE + RANGE + READ + READS + READ_ONLY + READ_WRITE + REAL + REFERENCES + REGEXP + RELEASE + RENAME + REPEAT + REPLACE + REQUIRE + RESTRICT + RETURN + REVOKE + RIGHT + RLIKE + SCHEMA + SCHEMAS + SECOND_MICROSECOND + SELECT + SENSITIVE + SEPARATOR + SET + SHOW + SMALLINT + SPATIAL + SPECIFIC + SQL + SQLEXCEPTION + SQLSTATE + SQLWARNING + SQL_BIG_RESULT + SQL_CALC_FOUND_ROWS + SQL_SMALL_RESULT + SSL + STARTING + STRAIGHT_JOIN + TABLE + TABLES + TERMINATED + TEXT + THEN + TINYBLOB + TINYINT + TINYTEXT + TO + TRAILING + TRIGGER + TRUE + UNDO + UNION + UNIQUE + UNLOCK + UNSIGNED + UPDATE + UPGRADE + USAGE + USE + USING + UTC_DATE + UTC_TIME + UTC_TIMESTAMP + VALUES + VARBINARY + VARCHAR + VARCHARACTER + VARYING + WHEN + WHERE + WHILE + WITH + WRITE + XOR + YEAR_MONTH + ZEROFILLABS + ACOS + ADDDATE + ADDTIME + AES_DECRYPT + AES_ENCRYPT + AND + ASCII + ASIN + ATAN2 + ATAN + ATAN + AVG + BENCHMARK + BETWEEN + BIN + BINARY + BIT_AND + BIT_COUNT + BIT_LENGTH + BIT_OR + BIT_XOR + CASE + CAST + CEIL + CEILING + CHAR_LENGTH + CHAR + CHARACTER_LENGTH + CHARSET + COALESCE + COERCIBILITY + COLLATION + COMPRESS + CONCAT_WS + CONCAT + CONNECTION_ID + CONV + CONVERT_TZ + Convert + COS + COT + COUNT(DISTINCT) + COUNT + CRC32 + CURDATE + CURRENT_DATE + CURRENT_DATE + CURRENT_TIME + CURRENT_TIME + CURRENT_TIMESTAMP + CURRENT_TIMESTAMP + CURRENT_USER + CURRENT_USER + CURTIME + DATABASE + DATE_ADD + DATE_FORMAT + DATE_SUB + DATE + DATETIME + DATEDIFF + DAY + DAYNAME + DAYOFMONTH + DAYOFWEEK + DAYOFYEAR + DECODE + DEFAULT + DEGREES + DES_DECRYPT + DES_ENCRYPT + DIV + ELT + ENCODE + ENCRYPT + EXP + EXPORT_SET + EXTRACT + ExtractValue + FIELD + FIND_IN_SET + FLOOR + FORMAT + FOUND_ROWS + FROM_DAYS + FROM_UNIXTIME + GET_FORMAT + GET_LOCK + GREATEST + GROUP_CONCAT + HEX + HOUR + IF + IFNULL + IN + INET_ATON + INET_NTOA + INSERT + INSTR + INTERVAL + IS_FREE_LOCK + IS + NOT + NULL + IS + NOT + IS + NULL + IS_USED_LOCK + IS + ISNULL + LAST_DAY + LAST_INSERT_ID + LCASE + LEAST + LEFT + LENGTH + LIKE + LN + LOAD_FILE + LOCALTIME + LOCALTIME + LOCALTIMESTAMP + LOCALTIMESTAMP + LOCATE + LOG10 + LOG2 + LOG + LOWER + LPAD + LTRIM + MAKE_SET + MAKEDATE + MAKETIME + MASTER_POS_WAIT + MATCH + MAX + MD5 + MICROSECOND + MID + MIN + MINUTE + MOD + MONTH + MONTHNAME + NAME_CONST + NOT + BETWEEN + AND + NOT + IN + NOT + LIKE + NOT + REGEXP + NOT + NOW + NULLIF + OCT + OCTET_LENGTH + OLD_PASSWORD + OR + ORD + PASSWORD + PERIOD_ADD + PERIOD_DIFF + PI + POSITION + POW + POWER + PROCEDURE + ANALYSE + QUARTER + QUOTE + RADIANS + RAND + REGEXP + RELEASE_LOCK + REPEAT + REPLACE + REVERSE + RIGHT + RLIKE + ROUND + ROW_COUNT + RPAD + RTRIM + SCHEMA + SEC_TO_TIME + SECOND + SESSION_USER + SHA1 + SHA + SHA2 + SIGN + SIN + SLEEP + SOUNDEX + SOUNDS + LIKE + SPACE + SQRT + STD + STDDEV_POP + STDDEV_SAMP + STDDEV + STR_TO_DATE + STRCMP + SUBDATE + SUBSTR + SUBSTRING_INDEX + SUBSTRING + SUBTIME + SUM + SYSDATE + SYSTEM_USER + TAN + TIME_FORMAT + TIME_TO_SEC + TIME + TIMEDIFF + TIMESTAMP + TIMESTAMPADD + TIMESTAMPDIFF + TO_DAYS + TRIM + TRUNCATE + UCASE + UNCOMPRESS + UNCOMPRESSED_LENGTH + UNHEX + UNIX_TIMESTAMP + UpdateXML + UPPER + USER + UTC_DATE + UTC_TIME + UTC_TIMESTAMP + UUID + VALUES + VAR_POP + VAR_SAMP + VARIANCE + VERSION + WEEK + WEEKDAY + WEEKOFYEAR + WEIGHT_STRING + XOR + YEAR + YEARWEEK + ZEROFILL + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + # + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nemerle.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nemerle.plist new file mode 100644 index 00000000..9495cd88 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nemerle.plist @@ -0,0 +1,127 @@ + + + + + beginCommand + + endCommand + + beginInstruction + # + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abstract + def + extern + internal + mutable + new + override + partial + public + private + protected + sealed + static + virtual + volatile + macro + namespace + using + array + byte + decimal + double + float + int + list + long + null + sbyte + short + string + uint + ulong + ushort + void + _ + as + assert + base + catch + checked + do + else + false + finally + for + foreach + fun + get + if + ignore + implements + in + is + lock + match + null + out + params + ref + set + syntax + this + throw + true + try + typeof + unchecked + unless + when + where + while + with + class + enum + delegate + event + interface + module + struct + type + variant + + autocompleteWords + + + functionDefinition + class + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/none.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/none.plist new file mode 100644 index 00000000..29f17cd4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/none.plist @@ -0,0 +1,48 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + + secondString + + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + allowSyntaxColouring + + keywords + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nrnhoc.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nrnhoc.plist new file mode 100644 index 00000000..94d9f89f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/nrnhoc.plist @@ -0,0 +1,51 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + // + firstString + " + functionDefinition + ^\s*(proc|func).*\(.*\)\n?\s*\{ + keywords + + abs access allobjects allobjectvars allobjexts AlphaSynapse APCount arc3d area atan attr_praxis axis batch_run batch_save begintemplate boolean_dialog break celsius chdir checkpoint clamp_resist connect continue continue_dialog coredump_on_error cos create CVode debug Deck define_shape DEG delete delete_section depvar dialogs diam diam_changed diam3d disconnect distance doEvents doNotify double dt E else em endtemplate eqinit eqn erf erfc execute execute1 exp external fadvance FARADAY fclamp fclampi fclampv fcurrent File finitialize FInitializeHandler fit_praxis float_epsilon fmatrix fmenu for forall forsec fprint fscan fstim fstimi func GAMMA + g_pas getcwd getSpineArea getstr ghk Glyph graph Graph graphmode GUIMath HBox help hh hoc_ac_ hoc_cross_x_ hoc_cross_y_ hoc_obj_ hoc_pointer_ hoc_stdio hocmech IClamp if ifsec Impedance init initnrn insert int ion_style ismembrane issection iterator iterator_statement ivoc_style KSChan KSGate KSState KSTrans L LinearMechanism List load_file load_func load_proc load_template local localobj log log10 lw machine_name math Matrix MechanismStandard MechanismType myproc n3d name_declared nernst NetCon neuronhome new node_data nrnglobalmechmenu nrnmechmenu nrnpointmenu nrnsecmenu nseg numarg numprocs obfunc object_id object_pop object_push objectvar objectvar objref (synonyms) objref obsolete p3dconst parallel ParallelContext ParallelNetManager parent_connection parent_node parent_section pas PHI PI plot PlotShape plotx ploty plt Pointer pop_section print print_session printf prmat proc prstim psection psync pt3dadd pt3dchange pt3dclear pt3dconst pt3dinsert pt3dremove public push_section pval_praxis pwman_place PWManager quit R Ra Random RangeVarPlot read regraph retrieveaudit return ri ropen + run save_session saveaudit SaveState secname secondorder section_orientation SectionBrowser SectionList sectionname SectionRef setcolor setpointer setSpineArea settext Shape show_errmess_always sin solve spine3d sprint sqrt sred sscanf startsw stop stop_praxis stopsw stopwatch strcmp strdef string_dialog StringFunctions SVClamp symbols SymChooser system t tanh TextEditor this_node this_section Timer topology + tstop uninsert units unref ValueFieldEditor variable_domain VBox VClamp Vector while wopen wqinit x3d xbutton xcheckbox xfixedvalue xlabel xmenu xopen xpanel xpvalue xradiobutton xred xslider xstatebutton xvalue xvarlabel y3d z3d + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivec.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivec.plist new file mode 100644 index 00000000..051cdbef --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivec.plist @@ -0,0 +1,811 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^(-|\+).*\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + #import + char + const + double + enum + float + int + long + short + signed + struct + typedef + union + unsigned + void + id + Class + SEL + IMP + BOOL + auto + break + case + continue + default + do + else + extern + for + goto + if + register + return + sizeof + static + switch + volatile + while + self + super + @interface + @implementation + @property + @synthesize + @dynamic + @protocol + @required + @optional + @end + @private + @package + @protected + @public + @class + @selector + @encode + @defs + @try + @catch + @finally + @throw + @autoreleasepool + @synchronized + @compatibility_alias + IBOutlet + IBAction + true + false + TRUE + FALSE + YES + NO + NULL + nil + Nil + #define + #endif + #if + #ifdef + #ifndef + unichar + FoundationErrors + Foundation + NSAppleEventManagerSuspensionID + NSComparator + NSDecimal + NSHashEnumerator + NSHashTable + NSHashTableCallBacks + NSHashTableOptions + NSInteger + NSMapEnumerator + NSMapTable + NSMapTableKeyCallBacks + NSMapTableOptions + NSMapTableValueCallBacks + NSPoint + NSPointArray + NSPointPointer + NSRange + NSRangePointer + NSRect + NSRectArray + NSRectPointer + NSSize + NSSizeArray + NSSizePointer + NSSocketNativeHandle + NSStringEncoding + NSSwappedDouble + NSSwappedFloat + NSTimeInterval + NSUncaughtExceptionHandler + NSUInteger + NSZone + NSAffineTransform + NSAppleEventDescriptor + NSAppleEventManager + NSAppleScript + NSArchiver + NSArray + NSAssertionHandler + NSAttributedString + NSAutoreleasePool + NSBlockOperation + NSBundle + NSCache + NSCachedURLResponse + NSCalendar + NSCharacterSet + NSClassDescription + NSCloneCommand + NSCloseCommand + NSCoder + NSComparisonPredicate + NSCompoundPredicate + NSCondition + NSConditionLock + NSConnection + NSCountCommand + NSCountedSet + NSCreateCommand + NSData + NSDataDetector + NSDate + NSDateComponents + NSDateFormatter + NSDecimalNumber + NSDecimalNumberHandler + NSDeleteCommand + NSDictionary + NSDirectoryEnumerator + NSDistantObject + NSDistantObjectRequest + NSDistributedLock + NSDistributedNotificationCenter + NSEnumerator + NSError + NSException + NSExistsCommand + NSExpression + NSFileCoordinator + NSFileHandle + NSFileManager + NSFileVersion + NSFileWrapper + NSFormatter + NSGarbageCollector + NSGetCommand + NSHashTable + NSHost + NSHTTPCookie + NSHTTPCookieStorage + NSHTTPURLResponse + NSIndexPath + NSIndexSet + NSIndexSpecifier + NSInputStream + NSInvocation + NSInvocationOperation + NSKeyedArchiver + NSKeyedUnarchiver + NSLinguisticTagger + NSLocale + NSLock + NSLogicalTest + NSMachBootstrapServer + NSMachPort + NSMapTable + NSMessagePort + NSMessagePortNameServer + NSMetadataItem + NSMetadataQuery + NSMetadataQueryAttributeValueTuple + NSMetadataQueryResultGroup + NSMethodSignature + NSMiddleSpecifier + NSMoveCommand + NSMutableArray + NSMutableAttributedString + NSMutableCharacterSet + NSMutableData + NSMutableDictionary + NSMutableIndexSet + NSMutableOrderedSet + NSMutableSet + NSMutableString + NSMutableURLRequest + NSNameSpecifier + NSNetService + NSNetServiceBrowser + NSNotification + NSNotificationCenter + NSNotificationQueue + NSNull + NSNumber + NSNumberFormatter + NSObject + NSOperation + NSOperationQueue + NSOrderedSet + NSOrthography + NSOutputStream + NSPipe + NSPointerArray + NSPointerFunctions + NSPort + NSPortCoder + NSPortMessage + NSPortNameServer + NSPositionalSpecifier + NSPredicate + NSProcessInfo + NSPropertyListSerialization + NSPropertySpecifier + NSProtocolChecker + NSProxy + NSQuitCommand + NSRandomSpecifier + NSRangeSpecifier + NSRecursiveLock + NSRegularExpression + NSRelativeSpecifier + NSRunLoop + NSScanner + NSScriptClassDescription + NSScriptCoercionHandler + NSScriptCommand + NSScriptCommandDescription + NSScriptExecutionContext + NSScriptObjectSpecifier + NSScriptSuiteRegistry + NSScriptWhoseTest + NSSet + NSSetCommand + NSSocketPort + NSSocketPortNameServer + NSSortDescriptor + NSSpecifierTest + NSSpellServer + NSStream + NSString + NSTask + NSTextCheckingResult + NSThread + NSTimer + NSTimeZone + NSUbiquitousKeyValueStore + NSUnarchiver + NSUndoManager + NSUniqueIDSpecifier + NSURL + NSURLAuthenticationChallenge + NSURLCache + NSURLConnection + NSURLCredential + NSURLCredentialStorage + NSURLDownload + NSURLHandle + NSURLProtectionSpace + NSURLProtocol + NSURLRequest + NSURLResponse + NSUserAppleScriptTask + NSUserAutomatorTask + NSUserDefaults + NSUserNotification + NSUserNotificationCenter + NSUserScriptTask + NSUserUnixTask + NSUUID + NSValue + NSValueTransformer + NSWhoseSpecifier + NSXMLDocument + NSXMLDTD + NSXMLDTDNode + NSXMLElement + NSXMLNode + NSXMLParser + NSXPCConnection + NSXPCInterface + NSXPCListener + NSXPCListenerEndpoint + NSCoding + NSComparisonMethods + NSConnectionDelegate + NSCopying + NSDecimalNumberBehaviors + NSErrorRecoveryAttempting + NSFastEnumeration + NSFileManagerDelegate + NSFilePresenter + NSKeyedArchiverDelegate + NSKeyedUnarchiverDelegate + NSKeyValueCoding + NSKeyValueObserving + NSLocking + NSMachPortDelegate + NSMetadataQueryDelegate + NSMutableCopying + NSNetServiceBrowserDelegate + NSNetServiceDelegate + NSObject + NSPortDelegate + NSScriptingComparisonMethods + NSScriptKeyValueCoding + NSScriptObjectSpecifiers + NSSecureCoding + NSSpellServerDelegate + NSStreamDelegate + NSURLAuthenticationChallengeSender + NSURLConnectionDataDelegate + NSURLConnectionDelegate + NSURLConnectionDelegate + NSURLHandleClient + NSURLProtocolClient + NSUserNotificationCenterDelegate + NSXMLParserDelegate + NSXPCListenerDelegate + CIColor Additions + CIImage Additions + NSActionCell + NSAlert + NSAnimation + NSAnimationContext + NSApplication + NSArrayController + NSATSTypesetter + NSBezierPath + NSBitmapImageRep + NSBox + NSBrowser + NSBrowserCell + NSButton + NSButtonCell + NSCachedImageRep + NSCell + NSCIImageRep + NSClipView + NSCollectionView + NSCollectionViewItem + NSColor + NSColorList + NSColorPanel + NSColorPicker + NSColorSpace + NSColorWell + NSComboBox + NSComboBoxCell + NSControl + NSController + NSCursor + NSCustomImageRep + NSDatePicker + NSDatePickerCell + NSDictionaryController + NSDockTile + NSDocument + NSDocumentController + NSDraggingImageComponent + NSDraggingItem + NSDraggingSession + NSDrawer + NSEPSImageRep + NSEvent + NSFont + NSFontCollection + NSFontDescriptor + NSFontManager + NSFontPanel + NSForm + NSFormCell + NSGlyphGenerator + NSGlyphInfo + NSGradient + NSGraphicsContext + NSHelpManager + NSImage + NSImageCell + NSImageRep + NSImageView + NSLayoutManager + NSLevelIndicator + NSLevelIndicatorCell + NSMatrix + NSMenu + NSMenuItem + NSMenuItemCell + NSMenuView + NSMutableFontCollection + NSMutableParagraphStyle + NSNib + NSNibConnector + NSNibControlConnector + NSNibOutletConnector + NSObjectController + NSOpenGLContext + NSOpenGLLayer + NSOpenGLPixelBuffer + NSOpenGLPixelFormat + NSOpenGLView + NSOpenPanel + NSOutlineView + NSPageController + NSPageLayout + NSPanel + NSParagraphStyle + NSPasteboard + NSPasteboardItem + NSPathCell + NSPathComponentCell + NSPathControl + NSPDFImageRep + NSPersistentDocument + NSPICTImageRep + NSPopover + NSPopUpButton + NSPopUpButtonCell + NSPredicateEditor + NSPredicateEditorRowTemplate + NSPrinter + NSPrintInfo + NSPrintOperation + NSPrintPanel + NSProgressIndicator + NSResponder + NSRuleEditor + NSRulerMarker + NSRulerView + NSRunningApplication + NSSavePanel + NSScreen + NSScroller + NSScrollView + NSSearchField + NSSearchFieldCell + NSSecureTextField + NSSecureTextFieldCell + NSSegmentedCell + NSSegmentedControl + NSShadow + NSSharingService + NSSharingServicePicker + NSSlider + NSSliderCell + NSSound + NSSpeechRecognizer + NSSpeechSynthesizer + NSSpellChecker + NSSplitView + NSStatusBar + NSStatusItem + NSStepper + NSStepperCell + NSTableCellView + NSTableColumn + NSTableHeaderCell + NSTableHeaderView + NSTableRowView + NSTableView + NSTabView + NSTabViewItem + NSText + NSTextAttachment + NSTextAttachmentCell + NSTextBlock + NSTextContainer + NSTextField + NSTextFieldCell + NSTextFinder + NSTextInputContext + NSTextList + NSTextStorage + NSTextTab + NSTextTable + NSTextTableBlock + NSTextView + NSTokenField + NSTokenFieldCell + NSToolbar + NSToolbarItem + NSToolbarItemGroup + NSTouch + NSTrackingArea + NSTreeController + NSTreeNode + NSTypesetter + NSUserDefaultsController + NSView + NSViewAnimation + NSViewController + NSWindow + NSWindowController + NSWorkspace + NSAccessibility + NSAlertDelegate + NSAnimatablePropertyContainer + NSAnimationDelegate + NSApplicationDelegate + NSBrowserDelegate + NSChangeSpelling + NSCollectionViewDelegate + NSColorPickingCustom + NSColorPickingDefault + NSComboBoxCellDataSource + NSComboBoxDataSource + NSComboBoxDelegate + NSControlTextEditingDelegate + NSDatePickerCellDelegate + NSDictionaryControllerKeyValuePair + NSDockTilePlugIn + NSDraggingDestination + NSDraggingInfo + NSDraggingSource + NSDrawerDelegate + NSEditor + NSEditorRegistration + NSFontPanelValidation + NSGlyphStorage + NSIgnoreMisspelledWords + NSImageDelegate + NSKeyValueBindingCreation + NSLayoutManagerDelegate + NSMatrixDelegate + NSMenuDelegate + NSMenuValidation + NSNibAwaking + NSOpenSavePanelDelegate + NSOutlineViewDataSource + NSOutlineViewDelegate + NSPageControllerDelegate + NSPasteboardItemDataProvider + NSPasteboardReading + NSPasteboardWriting + NSPathCellDelegate + NSPathControlDelegate + NSPlaceholders + NSPopoverDelegate + NSPrintPanelAccessorizing + NSRuleEditorDelegate + NSServicesRequests + NSSharingServiceDelegate + NSSharingServicePickerDelegate + NSSoundDelegate + NSSpeechRecognizerDelegate + NSSpeechSynthesizerDelegate + NSSplitViewDelegate + NSTableViewDataSource + NSTableViewDelegate + NSTabViewDelegate + NSTextAttachmentCell + NSTextDelegate + NSTextFieldDelegate + NSTextFinderBarContainer + NSTextFinderClient + NSTextInput + NSTextInputClient + NSTextLayoutOrientationProvider + NSTextViewDelegate + NSTokenFieldCellDelegate + NSTokenFieldDelegate + NSToolbarDelegate + NSToolbarItemValidation + NSToolTipOwner + NSUserInterfaceItemIdentification + NSUserInterfaceItemSearching + NSUserInterfaceValidations + NSValidatedUserInterfaceItem + NSWindowDelegate + NSWindowRestoration + NSWindowScripting + NSAnimationEffect + NSBrowserAuxiliaryOpaque + NSColorListAuxiliaryOpaque + NSFocusRingPlacement + NSFocusRingType + NSInterfaceStyle + NSModalSession + NSOpenGLContextAuxiliary + NSOpenGLGlobalOption + NSOpenGLPixelFormatAuxiliary + NSSavePanelAuxiliaryOpaque + NSScreenAuxiliaryOpaque + NSTabViewItemAuxiliaryOpaque + NSTypesetterGlyphInfo + NSLayoutConstraint + NSMutableParagraphStyle + NSParagraphStyle + NSShadow + NSStringDrawingContext + UIAcceleration + UIAccelerometer + UIAccessibilityElement + UIActionSheet + UIActivity + UIActivityIndicatorView + UIActivityItemProvider + UIActivityViewController + UIAlertView + UIApplication + UIBarButtonItem + UIBarItem + UIBezierPath + UIButton + UICollectionReusableView + UICollectionView + UICollectionViewCell + UICollectionViewController + UICollectionViewFlowLayout + UICollectionViewLayout + UICollectionViewLayoutAttributes + UICollectionViewUpdateItem + UIColor + UIControl + UIDatePicker + UIDevice + UIDictationPhrase + UIDocument + UIDocumentInteractionController + UIEvent + UIFont + UIGestureRecognizer + UIImage + UIImagePickerController + UIImageView + UILabel + UILocalizedIndexedCollation + UILocalNotification + UILongPressGestureRecognizer + UIManagedDocument + UIMarkupTextPrintFormatter + UIMenuController + UIMenuItem + UINavigationBar + UINavigationController + UINavigationItem + UINib + UIPageControl + UIPageViewController + UIPanGestureRecognizer + UIPasteboard + UIPickerView + UIPinchGestureRecognizer + UIPopoverBackgroundView + UIPopoverController + UIPrintFormatter + UIPrintInfo + UIPrintInteractionController + UIPrintPageRenderer + UIPrintPaper + UIProgressView + UIReferenceLibraryViewController + UIRefreshControl + UIResponder + UIRotationGestureRecognizer + UIScreen + UIScreenMode + UIScrollView + UISearchBar + UISearchDisplayController + UISegmentedControl + UISimpleTextPrintFormatter + UISlider + UISplitViewController + UIStepper + UIStoryboard + UIStoryboardPopoverSegue + UIStoryboardSegue + UISwipeGestureRecognizer + UISwitch + UITabBar + UITabBarController + UITabBarItem + UITableView + UITableViewCell + UITableViewController + UITableViewHeaderFooterView + UITapGestureRecognizer + UITextField + UITextInputMode + UITextInputStringTokenizer + UITextPosition + UITextRange + UITextSelectionRect + UITextView + UIToolbar + UITouch + UIVideoEditorController + UIView + UIViewController + UIViewPrintFormatter + UIWebView + UIWindow + UIAccelerometerDelegate + UIAccessibility + UIAccessibilityAction + UIAccessibilityContainer + UIAccessibilityFocus + UIActionSheetDelegate + UIActivityItemSource + UIAlertViewDelegate + UIAppearance + UIAppearanceContainer + UIApplicationDelegate + UICollectionViewDataSource + UICollectionViewDelegate + UICollectionViewDelegateFlowLayout + UIDataSourceModelAssociation + UIDocumentInteractionControllerDelegate + UIGestureRecognizerDelegate + UIImagePickerControllerDelegate + UIKeyInput + UINavigationBarDelegate + UINavigationControllerDelegate + UIPageViewControllerDataSource + UIPageViewControllerDelegate + UIPickerViewAccessibilityDelegate + UIPickerViewDataSource + UIPickerViewDelegate + UIPopoverControllerDelegate + UIPrintInteractionControllerDelegate + UIResponderStandardEditActions + UIScrollViewDelegate + UISearchBarDelegate + UISearchDisplayDelegate + UISplitViewControllerDelegate + UITabBarControllerDelegate + UITabBarDelegate + UITableViewDataSource + UITableViewDelegate + UITextFieldDelegate + UITextInput + UITextInputDelegate + UITextInputTokenizer + UITextInputTraits + UITextViewDelegate + UIVideoEditorControllerDelegate + UIViewControllerRestoration + UIWebViewDelegate + URBarStyle + UIDataDetectorTypes + UIEdgeInsets + UIOffset + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivecaml.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivecaml.plist new file mode 100644 index 00000000..b5b666b3 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/objectivecaml.plist @@ -0,0 +1,103 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + (* + endFirstMultiLineComment + *) + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + as + assert + asr + begin + class + constraint + do + done + downto + else + end + exception + external + false + for + fun + function + functor + if + in + include + inherit + initializer + land + lazy + let + lor + lsl + lsr + lxor + match + method + mod + module + mutable + new + object + of + open + or + private + rec + sig + struct + then + to + true + try + type + val + virtual + when + while + with + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ox.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ox.plist new file mode 100644 index 00000000..eed93249 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ox.plist @@ -0,0 +1,52 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + acf acos aggregatec aggregater any arglist arma0 armaforc armagen armavar array asin atan bessel betafunc binand bincomp binor cabs cdiv ceil cerf cexp chdir choleski clog CloseDrawWindow cmul columns constant correlation cos cosh countc countr csqrt cumprod cumsum cumulate date dawson dayofcalender dayofweek decldl decldlband declu decqr decqrmul decsvd deletec deleteifc deleteifr deleter densbeta denschi densf densgamma densgh densgig denskernel densmises densn denspoisson denst determinant dfft diag diagcat diagonal diagonalize diff0 diffpow discretize double Draw DrawAcf DrawAdjust DrawAxis DrawAxisAuto DrawBoxPlot DrawCorrelogram DrawDensity DrawHistogram DrawLegend DrawLine DrawMatrix DrawPLine DrawPSymbol DrawPText DrawQQ DrawSpectrum DrawSymbol DrawT DrawText DrawTitle DrawTMatrix DrawX DrawXMatrix DrawXYZ DrawZ dropc dropr eigen eigensym eigensymgen eprint erf exclusion exit exp expint fabs fclose feof fflush fft floor fmod fopen format fprint fprintln fread fremove fscan fseek fsize fuzziness fwrite gammafact gammafunc getcwd getenv GetMaxControl GetMaxControlEps idiv imod int intersection insertc insertr invert inverteps invertgen invertsym isarray isclass isdotfeq isdotinf isdotnan isdouble iseq isfeq isfile isfunction isint ismatrix isnan isstring lag0 limits loadmat log log10 logdet loggamma lower matrix max maxc maxcindex MaxBFGS MaxControl MaxControlEps MaxConvergenceMsg MaxFSQP MaxNewton MaxSimplex meanc meanr min minc mincindex modelforc norm nullspace Num1Derivative Num2Derivative NumJacobian ols2c ols2r olsc olsr ones outer oxfilename oxrunerror oxversion oxwarning pacf periodogram polydiv polygamma polymake polymul polyroots print println probbeta probbvn probchi probf probgamma probn probmises probmvn probpoisson probt prodc prodr quanbeta quanchi quanf quangamma quanmises quann quant quantilec quantiler ranbeta ranbinomial ranbrownianmotion ranchi randirichlet ranexp ranf rangamma range rangh rangig raninvgaussian rank ranlogarithmic ranlogistic ranlogn ranmises ranmultinomial rann rannegbin ranpoisson ranpoissonprocess ranseed ranshuffle ranstable ransubsample rant ranu ranuorder ranwishart reflect reshape reversec reverser round rows SaveDrawWindow savemat scan selectc selectifc selectifr selectr selectrc setbounds setdiagonal SetDraw SetDrawWindow setlower SetTextWindow setupper shape ShowDrawWindow sin sinh sizec sizeof sizer sizerc solveldl solveldlband solvelu SolveQP solvetoeplitz sortbyc sortbyr sortc sortcindex sortr spline sprint sprintbuffer sqr sqrt sscan standardize strfind strfindr strifind strifindr string string strlwr strupr submat sumc sumsqrc sumsqrr sumr systemcall tailchi tailf tailn tailt tan tanh thinc thinr time timer timespan timestr timing today toeplitz trace trunc truncf unique unit unvech upper va_arglist varc variance varr vec vech vecindex vecr vecrindex zeros TRUE FALSE + array break case char class const continue decl default delete do double else enum extern for goto if inline int main matrix new operator private protected public return short static string switch this virtual while + CellTable MyCellTable Read Info GetData ReturnData AddData Write Error Rows Columns GetMatrix GetArrays GetRowVector GetRowVectors GetColumnVector GetColumnVectors GetRowArray GetRowArrays GetColumnArray GetColumnArrays GetCell SaveFixedDrawWindow FixGWG printsize printstats mkdir cddir rmdir cleandir shell fileexists beep + #include + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pascal.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pascal.plist new file mode 100644 index 00000000..9ec3fe70 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pascal.plist @@ -0,0 +1,164 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + { + endFirstMultiLineComment + } + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*\w*(function|procedure)\s+\w\(.*\).*;$ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + array + asm + case + const + div + do + downto + else + file + for + function + goto + if + in + label + mod + nil + not + of + operator + or + packed + procedure + program + record + repeat + set + then + to + type + unit + until + uses + var + while + with + xor + at + automated + break + continue + dispinterface + dispose + exit + false + finalization + initialization + library + new + published + resourcestring + self + true + as + bindable + constructor + destructor + except + export + finally + import + implementation + inherited + inline + interface + is + module + on + only + otherwise + private + property + protected + public + qualified + raise + restricted + shl + shr + threadvar + try + Integer + Cardinal + ShortInt + SmallInt + LongInt + Int64 + Byte + Word + LongWord + Char + AnsiChar + WideChar + Boolean + ByteBool + WordBool + LongBool + Single + Double + Extended + Comp + Currency + Real + Real48 + String + ShortString + AnsiString + WideString + Pointer + Variant + File + Text + FIXME + TODO + ### + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pdf.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pdf.plist new file mode 100644 index 00000000..6616fe58 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/pdf.plist @@ -0,0 +1,61 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + / + endVariable + ()><[]{}/% + firstString + + secondString + + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + endobj + endstream + f + false + n + null + obj + R + startxref + stream + trailer + true + xref + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/perl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/perl.plist new file mode 100644 index 00000000..2e3a9a15 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/perl.plist @@ -0,0 +1,292 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + $@% + endVariable + :;(){}=[]+-/.,*!?&><\ + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*sub\s+.*\n?\s*\{ + removeFromFunction + sub + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + use + package + require + print + close + my + open + new + if + until + while + elsif + else + unless + for + foreach + BEGIN + END + cmp + eq + ne + le + ge + not + and + or + xor + chomp + chop + chr + crypt + hex + index + lc + lcfirst + length + oct + ord + pack + reverse + rindex + sprintf + substr + uc + ucfirst + pos + quotemeta + split + study + abs + atan2 + cos + exp + int + log + rand + sin + sqrt + srand + pop + push + shift + splice + unshift + grep + join + map + sort + unpack + delete + each + exists + keys + values + caller + continue + die + do + dump + eval + exit + goto + last + next + redo + return + sub + wantarray + printf + local + scalar + + autocompleteWords + + binmode + close + closedir + dbmclose + dbmopen + eof + fileno + flock + format + getc + print + printf + read + readdir + rewinddir + seek + seekdir + select + syscall + sysread + sysseek + syswrite + tell + telldir + truncate + warn + write + vec + chdir + chmod + chown + chroot + fcntl + glob + ioctl + link + lstat + mkdir + open + opendir + readlink + rename + rmdir + stat + symlink + umask + unlink + utime + caller + continue + die + do + dump + eval + exit + goto + last + next + redo + return + sub + wantarray + local + my + our + package + use + defined + formline + reset + scalar + undef + alarm + exec + fork + getpgrp + getppid + getpriority + kill + pipe + setpgrp + setpriority + sleep + system + times + wait + waitpid + import + no + require + bless + ref + tie + tied + untie + accept + bind + connect + getpeername + getsockname + getsockopt + listen + recv + send + setsockopt + shutdown + socket + socketpair + msgctl + msgget + msgrcv + msgsnd + semctl + semget + semop + shmctl + shmget + shmread + shmwrite + endgrent + endhostent + endnetent + endpwent + getgrent + getgrgid + getgrnam + getlogin + getpwent + getpwnam + getpwuid + setgrent + setpwent + endprotoent + endservent + gethostbyaddr + gethostbyname + gethostent + getnetbyaddr + getnetbyname + getnetent + getprotobyname + getprotobynumber + getprotoent + getservbyname + getservbyport + getservent + sethostent + setnetent + setprotoent + setservent + gmtime + localtime + time + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/php.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/php.plist new file mode 100644 index 00000000..ab59f5d4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/php.plist @@ -0,0 +1,4232 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <? + endInstruction + ?> + beginVariable + $ + endVariable + :;(){}=[]+-/.,*!?%&><\ + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + # + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*(static)?\s*(private|protected|public)?\s*(static)?\s*function\s+.*\n?\s*\{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + or + xor + __FILE__ + exception + php_user_filter + __LINE__ + array + as + break + case + cfunction + class + const + continue + declare + default + die + do + echo + else + elseif + empty + enddeclare + endfor + endforeach + endif + endswitch + endwhile + eval + exit + extends + for + foreach + function + global + if + include + include_once + isset + list + new + old_function + print + require + require_once + return + static + switch + unset + use + var + while + __FUNCTION__ + __CLASS__ + __METHOD__ + + autocompleteWords + + !doctype + a + abbr + acronym + address + applet + area + audioscope + b + base + basefont + bdo + bgsound + big + blackface + blink + blockquote + body + bq + br + button + caption + center + cite + code + col + colgroup + comment + dd + del + dfn + dir + div + dl + dt + em + embed + fieldset + fn + font + form + frame + frameset + h1 + h2 + h3 + h4 + h5 + h6 + head + hr + html + i + iframe + ilayer + img + input + ins + isindex + kbd + keygen + label + layer + legend + li + limittext + link + listing + map + marquee + menu + meta + multicol + nobr + noembed + noframes + noscript + nosmartquotes + object + ol + optgroup + option + p + param + plaintext + pre + q + s + samp + script + select + server + shadow + sidebar + small + spacer + span + strike + strong + style + sub + sup + table + tbody + td + textarea + tfoot + th + thead + title + tr + tt + u + ul + var + wbr + xmp + abbr + accept-charset + accept + accesskey + action + align + alink + alt + archive + axis + background + bgcolor + border + cellpadding + cellspacing + char + charoff + charset + checked + cite + class + classid + clear + code + codebase + codetype + color + cols + colspan + compact + content + coords + data + datetime + declare + defer + dir + disabled + enctype + face + for + frame + frameborder + headers + height + href + hreflang + hspace + http-equiv + id + ismap + label + lang + language + link + longdesc + marginheight + marginwidth + maxlength + media + method + multiple + name + nohref + noresize + noshade + nowrap + object + onblur + onchange + onclick + ondblclick + onfocus + onkeydown + onkeypress + onkeyup + onload + onmousedown + onmousemove + onmouseout + onmouseover + onmouseup + onreset + onselect + onsubmit + onunload + profile + prompt + readonly + rel + rev + rows + rowspan + rules + scheme + scope + scrolling + selected + shape + size + span + src + standby + start + style + summary + tabindex + target + text + title + type + usemap + valign + value + valuetype + version + vlink + vspace + width + abs + acos + acosh + addcslashes + addslashes + aggregate + aggregate_info + aggregate_methods + aggregate_methods_by_list + aggregate_methods_by_regexp + aggregate_properties + aggregate_properties_by_list + aggregate_properties_by_regexp + aggregation_info + apache_child_terminate + apache_get_modules + apache_get_version + apache_getenv + apache_lookup_uri + apache_note + apache_request_headers + apache_reset_timeout + apache_response_headers + apache_setenv + apd_breakpoint + apd_callstack + apd_clunk + apd_continue + apd_croak + apd_dump_function_table + apd_dump_persistent_resources + apd_dump_regular_resources + apd_echo + apd_get_active_symbols + apd_set_pprof_trace + apd_set_session + apd_set_session_trace + apd_set_socket_session_trace + array + array_change_key_case + array_chunk + array_combine + array_count_values + array_diff + array_diff_assoc + array_diff_key + array_diff_uassoc + array_diff_ukey + array_fill + array_filter + array_flip + array_intersect + array_intersect_assoc + array_intersect_key + array_intersect_uassoc + array_intersect_ukey + array_key_exists + array_keys + array_map + array_merge + array_merge_recursive + array_multisort + array_pad + array_pop + array_push + array_rand + array_reduce + array_reverse + array_search + array_shift + array_slice + array_splice + array_sum + array_udiff + array_udiff_assoc + array_udiff_uassoc + array_uintersect + array_uintersect_assoc + array_uintersect_uassoc + array_unique + array_unshift + array_values + array_walk + array_walk_recursive + arrayiterator_current + arrayiterator_key + arrayiterator_next + arrayiterator_rewind + arrayiterator_seek + arrayiterator_valid + arrayobject_append + arrayobject_construct + arrayobject_count + arrayobject_getiterator + arrayobject_offsetexists + arrayobject_offsetget + arrayobject_offsetset + arrayobject_offsetunset + arsort + ascii2ebcdic + asin + asinh + asort + aspell_check + aspell_check_raw + aspell_new + aspell_suggest + assert + assert_options + atan + atan2 + atanh + base64_decode + base64_encode + base_convert + basename + bcadd + bccomp + bcdiv + bcmod + bcmul + bcompiler_load + bcompiler_load_exe + bcompiler_parse_class + bcompiler_read + bcompiler_write_class + bcompiler_write_constant + bcompiler_write_exe_footer + bcompiler_write_file + bcompiler_write_footer + bcompiler_write_function + bcompiler_write_functions_from_file + bcompiler_write_header + bcpow + bcpowmod + bcscale + bcsqrt + bcsub + bin2hex + bind_textdomain_codeset + bindec + bindtextdomain + bzclose + bzcompress + bzdecompress + bzerrno + bzerror + bzerrstr + bzflush + bzopen + bzread + bzwrite + cachingiterator_hasnext + cachingiterator_next + cachingiterator_rewind + cachingiterator_tostring + cachingiterator_valid + cachingrecursiveiterator_getchildren + cachingrecursiveiterator_haschildren + cal_days_in_month + cal_from_jd + cal_info + cal_to_jd + call_user_func + call_user_func_array + call_user_method + call_user_method_array + ccvs_add + ccvs_auth + ccvs_command + ccvs_count + ccvs_delete + ccvs_done + ccvs_init + ccvs_lookup + ccvs_new + ccvs_report + ccvs_return + ccvs_reverse + ccvs_sale + ccvs_status + ccvs_textvalue + ccvs_void + ceil + chdir + checkdate + checkdnsrr + chgrp + chmod + chop + chown + chr + chroot + chunk_split + class_exists + class_implements + class_parents + classkit_import + classkit_method_add + classkit_method_copy + classkit_method_redefine + classkit_method_remove + classkit_method_rename + clearstatcache + closedir + closelog + com + com_addref + com_create_guid + com_event_sink + com_get + com_get_active_object + com_invoke + com_isenum + com_load + com_load_typelib + com_message_pump + com_print_typeinfo + com_propget + com_propput + com_propset + com_release + com_set + compact + connection_aborted + connection_status + connection_timeout + constant + convert_cyr_string + convert_uudecode + convert_uuencode + copy + cos + cosh + count + count_chars + cpdf_add_annotation + cpdf_add_outline + cpdf_arc + cpdf_begin_text + cpdf_circle + cpdf_clip + cpdf_close + cpdf_closepath + cpdf_closepath_fill_stroke + cpdf_closepath_stroke + cpdf_continue_text + cpdf_curveto + cpdf_end_text + cpdf_fill + cpdf_fill_stroke + cpdf_finalize + cpdf_finalize_page + cpdf_global_set_document_limits + cpdf_import_jpeg + cpdf_lineto + cpdf_moveto + cpdf_newpath + cpdf_open + cpdf_output_buffer + cpdf_page_init + cpdf_place_inline_image + cpdf_rect + cpdf_restore + cpdf_rlineto + cpdf_rmoveto + cpdf_rotate + cpdf_rotate_text + cpdf_save + cpdf_save_to_file + cpdf_scale + cpdf_set_action_url + cpdf_set_char_spacing + cpdf_set_creator + cpdf_set_current_page + cpdf_set_font + cpdf_set_font_directories + cpdf_set_font_map_file + cpdf_set_horiz_scaling + cpdf_set_keywords + cpdf_set_leading + cpdf_set_page_animation + cpdf_set_subject + cpdf_set_text_matrix + cpdf_set_text_pos + cpdf_set_text_rendering + cpdf_set_text_rise + cpdf_set_title + cpdf_set_viewer_preferences + cpdf_set_word_spacing + cpdf_setdash + cpdf_setflat + cpdf_setgray + cpdf_setgray_fill + cpdf_setgray_stroke + cpdf_setlinecap + cpdf_setlinejoin + cpdf_setlinewidth + cpdf_setmiterlimit + cpdf_setrgbcolor + cpdf_setrgbcolor_fill + cpdf_setrgbcolor_stroke + cpdf_show + cpdf_show_xy + cpdf_stringwidth + cpdf_stroke + cpdf_text + cpdf_translate + crack_check + crack_closedict + crack_getlastmessage + crack_opendict + crc32 + create_function + crypt + ctype_alnum + ctype_alpha + ctype_cntrl + ctype_digit + ctype_graph + ctype_lower + ctype_print + ctype_punct + ctype_space + ctype_upper + ctype_xdigit + curl_close + curl_copy_handle + curl_errno + curl_error + curl_exec + curl_getinfo + curl_init + curl_multi_add_handle + curl_multi_close + curl_multi_exec + curl_multi_getcontent + curl_multi_info_read + curl_multi_init + curl_multi_remove_handle + curl_multi_select + curl_setopt + curl_version + current + cybercash_base64_decode + cybercash_base64_encode + cybercash_decr + cybercash_encr + cyrus_authenticate + cyrus_bind + cyrus_close + cyrus_connect + cyrus_query + cyrus_unbind + date + date_sunrise + date_sunset + dba_close + dba_delete + dba_exists + dba_fetch + dba_firstkey + dba_handlers + dba_insert + dba_key_split + dba_list + dba_nextkey + dba_open + dba_optimize + dba_popen + dba_replace + dba_sync + dbase_add_record + dbase_close + dbase_create + dbase_delete_record + dbase_get_header_info + dbase_get_record + dbase_get_record_with_names + dbase_numfields + dbase_numrecords + dbase_open + dbase_pack + dbase_replace_record + dblist + dbmclose + dbmdelete + dbmexists + dbmfetch + dbmfirstkey + dbminsert + dbmnextkey + dbmopen + dbmreplace + dbplus_add + dbplus_aql + dbplus_chdir + dbplus_close + dbplus_curr + dbplus_errcode + dbplus_errno + dbplus_find + dbplus_first + dbplus_flush + dbplus_freealllocks + dbplus_freelock + dbplus_freerlocks + dbplus_getlock + dbplus_getunique + dbplus_info + dbplus_last + dbplus_lockrel + dbplus_next + dbplus_open + dbplus_prev + dbplus_rchperm + dbplus_rcreate + dbplus_rcrtexact + dbplus_rcrtlike + dbplus_resolve + dbplus_restorepos + dbplus_rkeys + dbplus_ropen + dbplus_rquery + dbplus_rrename + dbplus_rsecindex + dbplus_runlink + dbplus_rzap + dbplus_savepos + dbplus_setindex + dbplus_setindexbynumber + dbplus_sql + dbplus_tcl + dbplus_tremove + dbplus_undo + dbplus_undoprepare + dbplus_unlockrel + dbplus_unselect + dbplus_update + dbplus_xlockrel + dbplus_xunlockrel + dbx_close + dbx_compare + dbx_connect + dbx_error + dbx_escape_string + dbx_fetch_row + dbx_query + dbx_sort + dcgettext + dcngettext + deaggregate + debug_backtrace + debug_print_backtrace + debug_zval_dump + debugger_off + debugger_on + decbin + dechex + decoct + define + define_syslog_variables + defined + deg2rad + delete + dgettext + die + dio_close + dio_fcntl + dio_open + dio_read + dio_seek + dio_stat + dio_tcsetattr + dio_truncate + dio_write + dir + directoryiterator_construct + directoryiterator_current + directoryiterator_getatime + directoryiterator_getchildren + directoryiterator_getctime + directoryiterator_getfilename + directoryiterator_getgroup + directoryiterator_getinode + directoryiterator_getmtime + directoryiterator_getowner + directoryiterator_getpath + directoryiterator_getpathname + directoryiterator_getperms + directoryiterator_getsize + directoryiterator_gettype + directoryiterator_isdir + directoryiterator_isdot + directoryiterator_isexecutable + directoryiterator_isfile + directoryiterator_islink + directoryiterator_isreadable + directoryiterator_iswritable + directoryiterator_key + directoryiterator_next + directoryiterator_rewind + directoryiterator_valid + dirname + disk_free_space + disk_total_space + diskfreespace + dl + dngettext + dns_check_record + dns_get_mx + dns_get_record + dom_domattr_isid + dom_domcharacterdata_appenddata + dom_domcharacterdata_deletedata + dom_domcharacterdata_insertdata + dom_domcharacterdata_replacedata + dom_domcharacterdata_substringdata + dom_domdocument_construct + dom_domdocument_createattribute + dom_domdocument_createattributens + dom_domdocument_createcdatasection + dom_domdocument_createcomment + dom_domdocument_createdocumentfragment + dom_domdocument_createelement + dom_domdocument_createelementns + dom_domdocument_createentityreference + dom_domdocument_createprocessinginstruction + dom_domdocument_createtextnode + dom_domdocument_getelementbyid + dom_domdocument_getelementsbytagname + dom_domdocument_getelementsbytagnamens + dom_domdocument_importnode + dom_domdocument_load + dom_domdocument_loadhtml + dom_domdocument_loadhtmlfile + dom_domdocument_loadxml + dom_domdocument_normalize + dom_domdocument_relaxngvalidate + dom_domdocument_relaxngvalidatesource + dom_domdocument_save + dom_domdocument_savehtml + dom_domdocument_savehtmlfile + dom_domdocument_savexml + dom_domdocument_schemavalidate + dom_domdocument_schemavalidatesource + dom_domdocument_validate + dom_domdocument_xinclude + dom_domelement_getattribute + dom_domelement_getattributenode + dom_domelement_getattributenodens + dom_domelement_getattributens + dom_domelement_getelementsbytagname + dom_domelement_getelementsbytagnamens + dom_domelement_hasattribute + dom_domelement_hasattributens + dom_domelement_removeattribute + dom_domelement_removeattributenode + dom_domelement_removeattributens + dom_domelement_setattribute + dom_domelement_setattributenode + dom_domelement_setattributenodens + dom_domelement_setattributens + dom_domimplementation_createdocument + dom_domimplementation_createdocumenttype + dom_domimplementation_hasfeature + dom_domnamednodemap_getnameditem + dom_domnamednodemap_getnameditemns + dom_domnamednodemap_item + dom_domnode_appendchild + dom_domnode_clonenode + dom_domnode_hasattributes + dom_domnode_haschildnodes + dom_domnode_insertbefore + dom_domnode_issamenode + dom_domnode_issupported + dom_domnode_lookupnamespaceuri + dom_domnode_lookupprefix + dom_domnode_normalize + dom_domnode_removechild + dom_domnode_replacechild + dom_domnodelist_item + dom_domtext_iswhitespaceinelementcontent + dom_domtext_splittext + dom_domxpath_construct + dom_domxpath_evaluate + dom_domxpath_query + dom_domxpath_registernamespace + dom_import_simplexml + domattribute_name + domattribute_specified + domattribute_value + domdocument_add_root + domdocument_create_attribute + domdocument_create_cdata_section + domdocument_create_comment + domdocument_create_element + domdocument_create_element_ns + domdocument_create_entity_reference + domdocument_create_processing_instruction + domdocument_create_text_node + domdocument_doctype + domdocument_document_element + domdocument_dump_file + domdocument_dump_mem + domdocument_get_element_by_id + domdocument_get_elements_by_tagname + domdocument_html_dump_mem + domdocument_xinclude + domdocumenttype_entities + domdocumenttype_internal_subset + domdocumenttype_name + domdocumenttype_notations + domdocumenttype_public_id + domdocumenttype_system_id + domelement_get_attribute + domelement_get_attribute_node + domelement_get_elements_by_tagname + domelement_has_attribute + domelement_remove_attribute + domelement_set_attribute + domelement_tagname + domnode_add_namespace + domnode_append_child + domnode_append_sibling + domnode_attributes + domnode_child_nodes + domnode_clone_node + domnode_dump_node + domnode_first_child + domnode_get_content + domnode_has_attributes + domnode_has_child_nodes + domnode_insert_before + domnode_is_blank_node + domnode_last_child + domnode_next_sibling + domnode_node_name + domnode_node_type + domnode_node_value + domnode_owner_document + domnode_parent_node + domnode_prefix + domnode_previous_sibling + domnode_remove_child + domnode_replace_child + domnode_replace_node + domnode_set_content + domnode_set_name + domnode_set_namespace + domnode_unlink_node + domprocessinginstruction_data + domprocessinginstruction_target + domxml_new_doc + domxml_open_file + domxml_open_mem + domxml_version + domxml_xmltree + domxml_xslt_stylesheet + domxml_xslt_stylesheet_doc + domxml_xslt_stylesheet_file + domxsltstylesheet_process + domxsltstylesheet_result_dump_file + domxsltstylesheet_result_dump_mem + dotnet + dotnet_load + doubleval + each + easter_date + easter_days + ebcdic2ascii + echo + empty + end + ereg + ereg_replace + eregi + eregi_replace + error_log + error_reporting + escapeshellarg + escapeshellcmd + eval + exec + exif_imagetype + exif_read_data + exif_tagname + exif_thumbnail + exit + exp + explode + expm1 + extension_loaded + extract + ezmlm_hash + fam_cancel_monitor + fam_close + fam_monitor_collection + fam_monitor_directory + fam_monitor_file + fam_next_event + fam_open + fam_pending + fam_resume_monitor + fam_suspend_monitor + fbsql_affected_rows + fbsql_autocommit + fbsql_blob_size + fbsql_change_user + fbsql_clob_size + fbsql_close + fbsql_commit + fbsql_connect + fbsql_create_blob + fbsql_create_clob + fbsql_create_db + fbsql_data_seek + fbsql_database + fbsql_database_password + fbsql_db_query + fbsql_db_status + fbsql_drop_db + fbsql_errno + fbsql_error + fbsql_fetch_array + fbsql_fetch_assoc + fbsql_fetch_field + fbsql_fetch_lengths + fbsql_fetch_object + fbsql_fetch_row + fbsql_field_flags + fbsql_field_len + fbsql_field_name + fbsql_field_seek + fbsql_field_table + fbsql_field_type + fbsql_free_result + fbsql_get_autostart_info + fbsql_hostname + fbsql_insert_id + fbsql_list_dbs + fbsql_list_fields + fbsql_list_tables + fbsql_next_result + fbsql_num_fields + fbsql_num_rows + fbsql_password + fbsql_pconnect + fbsql_query + fbsql_read_blob + fbsql_read_clob + fbsql_result + fbsql_rollback + fbsql_select_db + fbsql_set_lob_mode + fbsql_set_password + fbsql_set_transaction + fbsql_start_db + fbsql_stop_db + fbsql_tablename + fbsql_username + fbsql_warnings + fclose + fdf_add_doc_javascript + fdf_add_template + fdf_close + fdf_create + fdf_enum_values + fdf_errno + fdf_error + fdf_get_ap + fdf_get_attachment + fdf_get_encoding + fdf_get_file + fdf_get_flags + fdf_get_opt + fdf_get_status + fdf_get_value + fdf_get_version + fdf_header + fdf_next_field_name + fdf_open + fdf_open_string + fdf_remove_item + fdf_save + fdf_save_string + fdf_set_ap + fdf_set_encoding + fdf_set_file + fdf_set_flags + fdf_set_javascript_action + fdf_set_on_import_javascript + fdf_set_opt + fdf_set_status + fdf_set_submit_form_action + fdf_set_target_frame + fdf_set_value + fdf_set_version + feof + fflush + fgetc + fgetcsv + fgets + fgetss + file + file_exists + file_get_contents + file_put_contents + fileatime + filectime + filegroup + fileinode + filemtime + fileowner + fileperms + filepro + filepro_fieldcount + filepro_fieldname + filepro_fieldtype + filepro_fieldwidth + filepro_retrieve + filepro_rowcount + filesize + filetype + filteriterator_current + filteriterator_getinneriterator + filteriterator_key + filteriterator_next + filteriterator_rewind + filteriterator_valid + floatval + flock + floor + flush + fmod + fnmatch + fopen + fpassthru + fprintf + fputcsv + fputs + fread + frenchtojd + fribidi_log2vis + fscanf + fseek + fsockopen + fstat + ftell + ftok + ftp_alloc + ftp_cdup + ftp_chdir + ftp_chmod + ftp_close + ftp_connect + ftp_delete + ftp_exec + ftp_fget + ftp_fput + ftp_get + ftp_get_option + ftp_login + ftp_mdtm + ftp_mkdir + ftp_nb_continue + ftp_nb_fget + ftp_nb_fput + ftp_nb_get + ftp_nb_put + ftp_nlist + ftp_pasv + ftp_put + ftp_pwd + ftp_quit + ftp_raw + ftp_rawlist + ftp_rename + ftp_rmdir + ftp_set_option + ftp_site + ftp_size + ftp_ssl_connect + ftp_systype + ftruncate + func_get_arg + func_get_args + func_num_args + function_exists + fwrite + gd_info + get_browser + get_cfg_var + get_class + get_class_methods + get_class_vars + get_current_user + get_declared_classes + get_declared_interfaces + get_defined_constants + get_defined_functions + get_defined_vars + get_extension_funcs + get_headers + get_html_translation_table + get_include_path + get_included_files + get_loaded_extensions + get_magic_quotes_gpc + get_magic_quotes_runtime + get_meta_tags + get_object_vars + get_parent_class + get_required_files + get_resource_type + getallheaders + getcwd + getdate + getenv + gethostbyaddr + gethostbyname + gethostbynamel + getimagesize + getlastmod + getmxrr + getmygid + getmyinode + getmypid + getmyuid + getopt + getprotobyname + getprotobynumber + getrandmax + getrusage + getservbyname + getservbyport + gettext + gettimeofday + gettype + glob + gmdate + gmmktime + gmp_abs + gmp_add + gmp_and + gmp_clrbit + gmp_cmp + gmp_com + gmp_div + gmp_div_q + gmp_div_qr + gmp_div_r + gmp_divexact + gmp_fact + gmp_gcd + gmp_gcdext + gmp_hamdist + gmp_init + gmp_intval + gmp_invert + gmp_jacobi + gmp_legendre + gmp_mod + gmp_mul + gmp_neg + gmp_or + gmp_perfect_square + gmp_popcount + gmp_pow + gmp_powm + gmp_prob_prime + gmp_random + gmp_scan0 + gmp_scan1 + gmp_setbit + gmp_sign + gmp_sqrt + gmp_sqrtrem + gmp_strval + gmp_sub + gmp_xor + gmstrftime + gregoriantojd + gzclose + gzcompress + gzdeflate + gzencode + gzeof + gzfile + gzgetc + gzgets + gzgetss + gzinflate + gzopen + gzpassthru + gzputs + gzread + gzrewind + gzseek + gztell + gzuncompress + gzwrite + header + headers_list + headers_sent + hebrev + hebrevc + hexdec + highlight_file + highlight_string + html_entity_decode + htmlentities + htmlspecialchars + http_build_query + hw_array2objrec + hw_changeobject + hw_children + hw_childrenobj + hw_close + hw_connect + hw_connection_info + hw_cp + hw_deleteobject + hw_docbyanchor + hw_docbyanchorobj + hw_document_attributes + hw_document_bodytag + hw_document_content + hw_document_setcontent + hw_document_size + hw_dummy + hw_edittext + hw_error + hw_errormsg + hw_free_document + hw_getanchors + hw_getanchorsobj + hw_getandlock + hw_getchildcoll + hw_getchildcollobj + hw_getchilddoccoll + hw_getchilddoccollobj + hw_getobject + hw_getobjectbyquery + hw_getobjectbyquerycoll + hw_getobjectbyquerycollobj + hw_getobjectbyqueryobj + hw_getparents + hw_getparentsobj + hw_getrellink + hw_getremote + hw_getremotechildren + hw_getsrcbydestobj + hw_gettext + hw_getusername + hw_identify + hw_incollections + hw_info + hw_inscoll + hw_insdoc + hw_insertanchors + hw_insertdocument + hw_insertobject + hw_mapid + hw_modifyobject + hw_mv + hw_new_document + hw_objrec2array + hw_output_document + hw_pconnect + hw_pipedocument + hw_root + hw_setlinkroot + hw_stat + hw_unlock + hw_who + hwapi_attribute + hwapi_attribute_key + hwapi_attribute_langdepvalue + hwapi_attribute_value + hwapi_attribute_values + hwapi_checkin + hwapi_checkout + hwapi_children + hwapi_content + hwapi_content_mimetype + hwapi_content_read + hwapi_copy + hwapi_dbstat + hwapi_dcstat + hwapi_dstanchors + hwapi_dstofsrcanchor + hwapi_error_count + hwapi_error_reason + hwapi_find + hwapi_ftstat + hwapi_hgcsp + hwapi_hwstat + hwapi_identify + hwapi_info + hwapi_insert + hwapi_insertanchor + hwapi_insertcollection + hwapi_insertdocument + hwapi_link + hwapi_lock + hwapi_move + hwapi_new_content + hwapi_object + hwapi_object_assign + hwapi_object_attreditable + hwapi_object_count + hwapi_object_insert + hwapi_object_new + hwapi_object_remove + hwapi_object_title + hwapi_object_value + hwapi_objectbyanchor + hwapi_parents + hwapi_reason_description + hwapi_reason_type + hwapi_remove + hwapi_replace + hwapi_setcommittedversion + hwapi_srcanchors + hwapi_srcsofdst + hwapi_unlock + hwapi_user + hwapi_userlist + hypot + ibase_add_user + ibase_affected_rows + ibase_backup + ibase_blob_add + ibase_blob_cancel + ibase_blob_close + ibase_blob_create + ibase_blob_echo + ibase_blob_get + ibase_blob_import + ibase_blob_info + ibase_blob_open + ibase_close + ibase_commit + ibase_commit_ret + ibase_connect + ibase_db_info + ibase_delete_user + ibase_drop_db + ibase_errcode + ibase_errmsg + ibase_execute + ibase_fetch_assoc + ibase_fetch_object + ibase_fetch_row + ibase_field_info + ibase_free_event_handler + ibase_free_query + ibase_free_result + ibase_gen_id + ibase_maintain_db + ibase_modify_user + ibase_name_result + ibase_num_fields + ibase_num_params + ibase_param_info + ibase_pconnect + ibase_prepare + ibase_query + ibase_restore + ibase_rollback + ibase_rollback_ret + ibase_server_info + ibase_service_attach + ibase_service_detach + ibase_set_event_handler + ibase_timefmt + ibase_trans + ibase_wait_event + icap_close + icap_create_calendar + icap_delete_calendar + icap_delete_event + icap_fetch_event + icap_list_alarms + icap_list_events + icap_open + icap_rename_calendar + icap_reopen + icap_snooze + icap_store_event + iconv + iconv_get_encoding + iconv_mime_decode + iconv_mime_decode_headers + iconv_mime_encode + iconv_set_encoding + iconv_strlen + iconv_strpos + iconv_strrpos + iconv_substr + id3_get_frame_long_name + id3_get_frame_short_name + id3_get_genre_id + id3_get_genre_list + id3_get_genre_name + id3_get_tag + id3_get_version + id3_remove_tag + id3_set_tag + idate + ifx_affected_rows + ifx_blobinfile_mode + ifx_byteasvarchar + ifx_close + ifx_connect + ifx_copy_blob + ifx_create_blob + ifx_create_char + ifx_do + ifx_error + ifx_errormsg + ifx_fetch_row + ifx_fieldproperties + ifx_fieldtypes + ifx_free_blob + ifx_free_char + ifx_free_result + ifx_get_blob + ifx_get_char + ifx_getsqlca + ifx_htmltbl_result + ifx_nullformat + ifx_num_fields + ifx_num_rows + ifx_pconnect + ifx_prepare + ifx_query + ifx_textasvarchar + ifx_update_blob + ifx_update_char + ifxus_close_slob + ifxus_create_slob + ifxus_free_slob + ifxus_open_slob + ifxus_read_slob + ifxus_seek_slob + ifxus_tell_slob + ifxus_write_slob + ignore_user_abort + iis_add_server + iis_get_dir_security + iis_get_script_map + iis_get_server_by_comment + iis_get_server_by_path + iis_get_server_rights + iis_get_service_state + iis_remove_server + iis_set_app_settings + iis_set_dir_security + iis_set_script_map + iis_set_server_rights + iis_start_server + iis_start_service + iis_stop_server + iis_stop_service + image2wbmp + image_type_to_extension + image_type_to_mime_type + imagealphablending + imageantialias + imagearc + imagechar + imagecharup + imagecolorallocate + imagecolorallocatealpha + imagecolorat + imagecolorclosest + imagecolorclosestalpha + imagecolorclosesthwb + imagecolordeallocate + imagecolorexact + imagecolorexactalpha + imagecolormatch + imagecolorresolve + imagecolorresolvealpha + imagecolorset + imagecolorsforindex + imagecolorstotal + imagecolortransparent + imagecopy + imagecopymerge + imagecopymergegray + imagecopyresampled + imagecopyresized + imagecreate + imagecreatefromgd + imagecreatefromgd2 + imagecreatefromgd2part + imagecreatefromgif + imagecreatefromjpeg + imagecreatefrompng + imagecreatefromstring + imagecreatefromwbmp + imagecreatefromxbm + imagecreatefromxpm + imagecreatetruecolor + imagedashedline + imagedestroy + imageellipse + imagefill + imagefilledarc + imagefilledellipse + imagefilledpolygon + imagefilledrectangle + imagefilltoborder + imagefilter + imagefontheight + imagefontwidth + imageftbbox + imagefttext + imagegammacorrect + imagegd + imagegd2 + imagegif + imageinterlace + imageistruecolor + imagejpeg + imagelayereffect + imageline + imageloadfont + imagepalettecopy + imagepng + imagepolygon + imagepsbbox + imagepscopyfont + imagepsencodefont + imagepsextendfont + imagepsfreefont + imagepsloadfont + imagepsslantfont + imagepstext + imagerectangle + imagerotate + imagesavealpha + imagesetbrush + imagesetpixel + imagesetstyle + imagesetthickness + imagesettile + imagestring + imagestringup + imagesx + imagesy + imagetruecolortopalette + imagettfbbox + imagettftext + imagetypes + imagewbmp + imagexbm + imap_8bit + imap_alerts + imap_append + imap_base64 + imap_binary + imap_body + imap_bodystruct + imap_check + imap_clearflag_full + imap_close + imap_createmailbox + imap_delete + imap_deletemailbox + imap_errors + imap_expunge + imap_fetch_overview + imap_fetchbody + imap_fetchheader + imap_fetchstructure + imap_get_quota + imap_get_quotaroot + imap_getacl + imap_getmailboxes + imap_getsubscribed + imap_header + imap_headerinfo + imap_headers + imap_last_error + imap_list + imap_listmailbox + imap_listscan + imap_listsubscribed + imap_lsub + imap_mail + imap_mail_compose + imap_mail_copy + imap_mail_move + imap_mailboxmsginfo + imap_mime_header_decode + imap_msgno + imap_num_msg + imap_num_recent + imap_open + imap_ping + imap_qprint + imap_renamemailbox + imap_reopen + imap_rfc822_parse_adrlist + imap_rfc822_parse_headers + imap_rfc822_write_address + imap_scanmailbox + imap_search + imap_set_quota + imap_setacl + imap_setflag_full + imap_sort + imap_status + imap_subscribe + imap_thread + imap_timeout + imap_uid + imap_undelete + imap_unsubscribe + imap_utf7_decode + imap_utf7_encode + imap_utf8 + implode + import_request_variables + in_array + include + include_once + inet_ntop + inet_pton + ingres_autocommit + ingres_close + ingres_commit + ingres_connect + ingres_fetch_array + ingres_fetch_object + ingres_fetch_row + ingres_field_length + ingres_field_name + ingres_field_nullable + ingres_field_precision + ingres_field_scale + ingres_field_type + ingres_num_fields + ingres_num_rows + ingres_pconnect + ingres_query + ingres_rollback + ini_alter + ini_get + ini_get_all + ini_restore + ini_set + interface_exists + intval + ip2long + iptcembed + iptcparse + ircg_channel_mode + ircg_disconnect + ircg_eval_ecmascript_params + ircg_fetch_error_msg + ircg_get_username + ircg_html_encode + ircg_ignore_add + ircg_ignore_del + ircg_invite + ircg_is_conn_alive + ircg_join + ircg_kick + ircg_list + ircg_lookup_format_messages + ircg_lusers + ircg_msg + ircg_names + ircg_nick + ircg_nickname_escape + ircg_nickname_unescape + ircg_notice + ircg_oper + ircg_part + ircg_pconnect + ircg_register_format_messages + ircg_set_current + ircg_set_file + ircg_set_on_die + ircg_topic + ircg_who + ircg_whois + is_a + is_array + is_bool + is_callable + is_dir + is_double + is_executable + is_file + is_finite + is_float + is_infinite + is_int + is_integer + is_link + is_long + is_nan + is_null + is_numeric + is_object + is_readable + is_real + is_resource + is_scalar + is_soap_fault + is_string + is_subclass_of + is_uploaded_file + is_writable + is_writeable + isset + iterator_count + iterator_to_array + java_last_exception_clear + java_last_exception_get + jddayofweek + jdmonthname + jdtofrench + jdtogregorian + jdtojewish + jdtojulian + jdtounix + jewishtojd + join + jpeg2wbmp + juliantojd + key + krsort + ksort + lcg_value + ldap_8859_to_t61 + ldap_add + ldap_bind + ldap_close + ldap_compare + ldap_connect + ldap_count_entries + ldap_delete + ldap_dn2ufn + ldap_err2str + ldap_errno + ldap_error + ldap_explode_dn + ldap_first_attribute + ldap_first_entry + ldap_first_reference + ldap_free_result + ldap_get_attributes + ldap_get_dn + ldap_get_entries + ldap_get_option + ldap_get_values + ldap_get_values_len + ldap_list + ldap_mod_add + ldap_mod_del + ldap_mod_replace + ldap_modify + ldap_next_attribute + ldap_next_entry + ldap_next_reference + ldap_parse_reference + ldap_parse_result + ldap_read + ldap_rename + ldap_sasl_bind + ldap_search + ldap_set_option + ldap_set_rebind_proc + ldap_sort + ldap_start_tls + ldap_t61_to_8859 + ldap_unbind + levenshtein + limititerator_getposition + limititerator_next + limititerator_rewind + limititerator_seek + limititerator_valid + link + linkinfo + list + localeconv + localtime + log + log10 + log1p + long2ip + lstat + ltrim + lzf_compress + lzf_decompress + lzf_optimized_for + mail + mailparse_determine_best_xfer_encoding + mailparse_msg_create + mailparse_msg_extract_part + mailparse_msg_extract_part_file + mailparse_msg_free + mailparse_msg_get_part + mailparse_msg_get_part_data + mailparse_msg_get_structure + mailparse_msg_parse + mailparse_msg_parse_file + mailparse_rfc822_parse_addresses + mailparse_stream_encode + mailparse_uudecode_all + main + max + maxdb_affected_rows + maxdb_autocommit + maxdb_bind_param + maxdb_bind_result + maxdb_change_user + maxdb_character_set_name + maxdb_client_encoding + maxdb_close + maxdb_close_long_data + maxdb_commit + maxdb_connect + maxdb_connect_errno + maxdb_connect_error + maxdb_data_seek + maxdb_debug + maxdb_disable_reads_from_master + maxdb_disable_rpl_parse + maxdb_dump_debug_info + maxdb_embedded_connect + maxdb_enable_reads_from_master + maxdb_enable_rpl_parse + maxdb_errno + maxdb_error + maxdb_escape_string + maxdb_execute + maxdb_fetch + maxdb_fetch_array + maxdb_fetch_assoc + maxdb_fetch_field + maxdb_fetch_field_direct + maxdb_fetch_fields + maxdb_fetch_lengths + maxdb_fetch_resource + maxdb_fetch_row + maxdb_field_count + maxdb_field_seek + maxdb_field_tell + maxdb_free_result + maxdb_get_client_info + maxdb_get_client_version + maxdb_get_host_info + maxdb_get_metadata + maxdb_get_proto_info + maxdb_get_server_info + maxdb_get_server_version + maxdb_info + maxdb_init + maxdb_insert_id + maxdb_kill + maxdb_master_query + maxdb_more_results + maxdb_multi_query + maxdb_next_result + maxdb_num_fields + maxdb_num_rows + maxdb_options + maxdb_param_count + maxdb_ping + maxdb_prepare + maxdb_query + maxdb_real_connect + maxdb_real_escape_string + maxdb_real_query + maxdb_report + maxdb_rollback + maxdb_rpl_parse_enabled + maxdb_rpl_probe + maxdb_rpl_query_type + maxdb_select_db + maxdb_send_long_data + maxdb_send_query + maxdb_server_end + maxdb_server_init + maxdb_set_opt + maxdb_sqlstate + maxdb_ssl_set + maxdb_stat + maxdb_stmt_affected_rows + maxdb_stmt_bind_param + maxdb_stmt_bind_result + maxdb_stmt_close + maxdb_stmt_close_long_data + maxdb_stmt_data_seek + maxdb_stmt_errno + maxdb_stmt_error + maxdb_stmt_execute + maxdb_stmt_fetch + maxdb_stmt_free_result + maxdb_stmt_init + maxdb_stmt_num_rows + maxdb_stmt_param_count + maxdb_stmt_prepare + maxdb_stmt_reset + maxdb_stmt_result_metadata + maxdb_stmt_send_long_data + maxdb_stmt_sqlstate + maxdb_stmt_store_result + maxdb_store_result + maxdb_thread_id + maxdb_thread_safe + maxdb_use_result + maxdb_warning_count + mb_convert_case + mb_convert_encoding + mb_convert_kana + mb_convert_variables + mb_decode_mimeheader + mb_decode_numericentity + mb_detect_encoding + mb_detect_order + mb_encode_mimeheader + mb_encode_numericentity + mb_ereg + mb_ereg_match + mb_ereg_replace + mb_ereg_search + mb_ereg_search_getpos + mb_ereg_search_getregs + mb_ereg_search_init + mb_ereg_search_pos + mb_ereg_search_regs + mb_ereg_search_setpos + mb_eregi + mb_eregi_replace + mb_get_info + mb_http_input + mb_http_output + mb_internal_encoding + mb_language + mb_list_encodings + mb_output_handler + mb_parse_str + mb_preferred_mime_name + mb_regex_encoding + mb_regex_set_options + mb_send_mail + mb_split + mb_strcut + mb_strimwidth + mb_strlen + mb_strpos + mb_strrpos + mb_strtolower + mb_strtoupper + mb_strwidth + mb_substitute_character + mb_substr + mb_substr_count + mcal_append_event + mcal_close + mcal_create_calendar + mcal_date_compare + mcal_date_valid + mcal_day_of_week + mcal_day_of_year + mcal_days_in_month + mcal_delete_calendar + mcal_delete_event + mcal_event_add_attribute + mcal_event_init + mcal_event_set_alarm + mcal_event_set_category + mcal_event_set_class + mcal_event_set_description + mcal_event_set_end + mcal_event_set_recur_daily + mcal_event_set_recur_monthly_mday + mcal_event_set_recur_monthly_wday + mcal_event_set_recur_none + mcal_event_set_recur_weekly + mcal_event_set_recur_yearly + mcal_event_set_start + mcal_event_set_title + mcal_expunge + mcal_fetch_current_stream_event + mcal_fetch_event + mcal_is_leap_year + mcal_list_alarms + mcal_list_events + mcal_next_recurrence + mcal_open + mcal_popen + mcal_rename_calendar + mcal_reopen + mcal_snooze + mcal_store_event + mcal_time_valid + mcal_week_of_year + mcrypt_cbc + mcrypt_cfb + mcrypt_create_iv + mcrypt_decrypt + mcrypt_ecb + mcrypt_enc_get_algorithms_name + mcrypt_enc_get_block_size + mcrypt_enc_get_iv_size + mcrypt_enc_get_key_size + mcrypt_enc_get_modes_name + mcrypt_enc_get_supported_key_sizes + mcrypt_enc_is_block_algorithm + mcrypt_enc_is_block_algorithm_mode + mcrypt_enc_is_block_mode + mcrypt_enc_self_test + mcrypt_encrypt + mcrypt_generic + mcrypt_generic_deinit + mcrypt_generic_end + mcrypt_generic_init + mcrypt_get_block_size + mcrypt_get_cipher_name + mcrypt_get_iv_size + mcrypt_get_key_size + mcrypt_list_algorithms + mcrypt_list_modes + mcrypt_module_close + mcrypt_module_get_algo_block_size + mcrypt_module_get_algo_key_size + mcrypt_module_get_supported_key_sizes + mcrypt_module_is_block_algorithm + mcrypt_module_is_block_algorithm_mode + mcrypt_module_is_block_mode + mcrypt_module_open + mcrypt_module_self_test + mcrypt_ofb + mcve_adduser + mcve_adduserarg + mcve_bt + mcve_checkstatus + mcve_chkpwd + mcve_chngpwd + mcve_completeauthorizations + mcve_connect + mcve_connectionerror + mcve_deleteresponse + mcve_deletetrans + mcve_deleteusersetup + mcve_deluser + mcve_destroyconn + mcve_destroyengine + mcve_disableuser + mcve_edituser + mcve_enableuser + mcve_force + mcve_getcell + mcve_getcellbynum + mcve_getcommadelimited + mcve_getheader + mcve_getuserarg + mcve_getuserparam + mcve_gft + mcve_gl + mcve_gut + mcve_initconn + mcve_initengine + mcve_initusersetup + mcve_iscommadelimited + mcve_liststats + mcve_listusers + mcve_maxconntimeout + mcve_monitor + mcve_numcolumns + mcve_numrows + mcve_override + mcve_parsecommadelimited + mcve_ping + mcve_preauth + mcve_preauthcompletion + mcve_qc + mcve_responseparam + mcve_return + mcve_returncode + mcve_returnstatus + mcve_sale + mcve_setblocking + mcve_setdropfile + mcve_setip + mcve_setssl + mcve_setssl_files + mcve_settimeout + mcve_settle + mcve_text_avs + mcve_text_code + mcve_text_cv + mcve_transactionauth + mcve_transactionavs + mcve_transactionbatch + mcve_transactioncv + mcve_transactionid + mcve_transactionitem + mcve_transactionssent + mcve_transactiontext + mcve_transinqueue + mcve_transnew + mcve_transparam + mcve_transsend + mcve_ub + mcve_uwait + mcve_verifyconnection + mcve_verifysslcert + mcve_void + md5 + md5_file + mdecrypt_generic + memcache_add + memcache_close + memcache_connect + memcache_debug + memcache_decrement + memcache_delete + memcache_flush + memcache_get + memcache_getstats + memcache_getversion + memcache_increment + memcache_pconnect + memcache_replace + memcache_set + memory_get_usage + metaphone + method_exists + mhash + mhash_count + mhash_get_block_size + mhash_get_hash_name + mhash_keygen_s2k + microtime + mime_content_type + min + ming_setcubicthreshold + ming_setscale + ming_useswfversion + mkdir + mktime + money_format + move_uploaded_file + msession_connect + msession_count + msession_create + msession_destroy + msession_disconnect + msession_find + msession_get + msession_get_array + msession_get_data + msession_inc + msession_list + msession_listvar + msession_lock + msession_plugin + msession_randstr + msession_set + msession_set_array + msession_set_data + msession_timeout + msession_uniq + msession_unlock + msg_get_queue + msg_receive + msg_remove_queue + msg_send + msg_set_queue + msg_stat_queue + msql + msql_affected_rows + msql_close + msql_connect + msql_create_db + msql_createdb + msql_data_seek + msql_db_query + msql_dbname + msql_drop_db + msql_error + msql_fetch_array + msql_fetch_field + msql_fetch_object + msql_fetch_row + msql_field_flags + msql_field_len + msql_field_name + msql_field_seek + msql_field_table + msql_field_type + msql_fieldflags + msql_fieldlen + msql_fieldname + msql_fieldtable + msql_fieldtype + msql_free_result + msql_list_dbs + msql_list_fields + msql_list_tables + msql_num_fields + msql_num_rows + msql_numfields + msql_numrows + msql_pconnect + msql_query + msql_regcase + msql_result + msql_select_db + msql_tablename + mssql_bind + mssql_close + mssql_connect + mssql_data_seek + mssql_execute + mssql_fetch_array + mssql_fetch_assoc + mssql_fetch_batch + mssql_fetch_field + mssql_fetch_object + mssql_fetch_row + mssql_field_length + mssql_field_name + mssql_field_seek + mssql_field_type + mssql_free_result + mssql_free_statement + mssql_get_last_message + mssql_guid_string + mssql_init + mssql_min_error_severity + mssql_min_message_severity + mssql_next_result + mssql_num_fields + mssql_num_rows + mssql_pconnect + mssql_query + mssql_result + mssql_rows_affected + mssql_select_db + mt_getrandmax + mt_rand + mt_srand + muscat_close + muscat_get + muscat_give + muscat_setup + muscat_setup_net + mysql_affected_rows + mysql_change_user + mysql_client_encoding + mysql_close + mysql_connect + mysql_create_db + mysql_data_seek + mysql_db_name + mysql_db_query + mysql_drop_db + mysql_errno + mysql_error + mysql_escape_string + mysql_fetch_array + mysql_fetch_assoc + mysql_fetch_field + mysql_fetch_lengths + mysql_fetch_object + mysql_fetch_row + mysql_field_flags + mysql_field_len + mysql_field_name + mysql_field_seek + mysql_field_table + mysql_field_type + mysql_free_result + mysql_get_client_info + mysql_get_host_info + mysql_get_proto_info + mysql_get_server_info + mysql_info + mysql_insert_id + mysql_list_dbs + mysql_list_fields + mysql_list_processes + mysql_list_tables + mysql_num_fields + mysql_num_rows + mysql_pconnect + mysql_ping + mysql_query + mysql_real_escape_string + mysql_result + mysql_select_db + mysql_stat + mysql_tablename + mysql_thread_id + mysql_unbuffered_query + mysqli_affected_rows + mysqli_autocommit + mysqli_bind_param + mysqli_bind_result + mysqli_change_user + mysqli_character_set_name + mysqli_client_encoding + mysqli_close + mysqli_commit + mysqli_connect + mysqli_connect_errno + mysqli_connect_error + mysqli_data_seek + mysqli_debug + mysqli_disable_reads_from_master + mysqli_disable_rpl_parse + mysqli_dump_debug_info + mysqli_embedded_connect + mysqli_enable_reads_from_master + mysqli_enable_rpl_parse + mysqli_errno + mysqli_error + mysqli_escape_string + mysqli_execute + mysqli_fetch + mysqli_fetch_array + mysqli_fetch_assoc + mysqli_fetch_field + mysqli_fetch_field_direct + mysqli_fetch_fields + mysqli_fetch_lengths + mysqli_fetch_object + mysqli_fetch_row + mysqli_field_count + mysqli_field_seek + mysqli_field_tell + mysqli_free_result + mysqli_get_client_info + mysqli_get_client_version + mysqli_get_host_info + mysqli_get_metadata + mysqli_get_proto_info + mysqli_get_server_info + mysqli_get_server_version + mysqli_info + mysqli_init + mysqli_insert_id + mysqli_kill + mysqli_master_query + mysqli_more_results + mysqli_multi_query + mysqli_next_result + mysqli_num_fields + mysqli_num_rows + mysqli_options + mysqli_param_count + mysqli_ping + mysqli_prepare + mysqli_query + mysqli_real_connect + mysqli_real_escape_string + mysqli_real_query + mysqli_report + mysqli_rollback + mysqli_rpl_parse_enabled + mysqli_rpl_probe + mysqli_rpl_query_type + mysqli_select_db + mysqli_send_long_data + mysqli_send_query + mysqli_server_end + mysqli_server_init + mysqli_set_opt + mysqli_sqlstate + mysqli_ssl_set + mysqli_stat + mysqli_stmt_affected_rows + mysqli_stmt_bind_param + mysqli_stmt_bind_result + mysqli_stmt_close + mysqli_stmt_data_seek + mysqli_stmt_errno + mysqli_stmt_error + mysqli_stmt_execute + mysqli_stmt_fetch + mysqli_stmt_free_result + mysqli_stmt_init + mysqli_stmt_num_rows + mysqli_stmt_param_count + mysqli_stmt_prepare + mysqli_stmt_reset + mysqli_stmt_result_metadata + mysqli_stmt_send_long_data + mysqli_stmt_sqlstate + mysqli_stmt_store_result + mysqli_store_result + mysqli_thread_id + mysqli_thread_safe + mysqli_use_result + mysqli_warning_count + natcasesort + natsort + ncurses_addch + ncurses_addchnstr + ncurses_addchstr + ncurses_addnstr + ncurses_addstr + ncurses_assume_default_colors + ncurses_attroff + ncurses_attron + ncurses_attrset + ncurses_baudrate + ncurses_beep + ncurses_bkgd + ncurses_bkgdset + ncurses_border + ncurses_bottom_panel + ncurses_can_change_color + ncurses_cbreak + ncurses_clear + ncurses_clrtobot + ncurses_clrtoeol + ncurses_color_content + ncurses_color_set + ncurses_curs_set + ncurses_def_prog_mode + ncurses_def_shell_mode + ncurses_define_key + ncurses_del_panel + ncurses_delay_output + ncurses_delch + ncurses_deleteln + ncurses_delwin + ncurses_doupdate + ncurses_echo + ncurses_echochar + ncurses_end + ncurses_erase + ncurses_erasechar + ncurses_filter + ncurses_flash + ncurses_flushinp + ncurses_getch + ncurses_getmaxyx + ncurses_getmouse + ncurses_getyx + ncurses_halfdelay + ncurses_has_colors + ncurses_has_ic + ncurses_has_il + ncurses_has_key + ncurses_hide_panel + ncurses_hline + ncurses_inch + ncurses_init + ncurses_init_color + ncurses_init_pair + ncurses_insch + ncurses_insdelln + ncurses_insertln + ncurses_insstr + ncurses_instr + ncurses_isendwin + ncurses_keyok + ncurses_keypad + ncurses_killchar + ncurses_longname + ncurses_meta + ncurses_mouse_trafo + ncurses_mouseinterval + ncurses_mousemask + ncurses_move + ncurses_move_panel + ncurses_mvaddch + ncurses_mvaddchnstr + ncurses_mvaddchstr + ncurses_mvaddnstr + ncurses_mvaddstr + ncurses_mvcur + ncurses_mvdelch + ncurses_mvgetch + ncurses_mvhline + ncurses_mvinch + ncurses_mvvline + ncurses_mvwaddstr + ncurses_napms + ncurses_new_panel + ncurses_newpad + ncurses_newwin + ncurses_nl + ncurses_nocbreak + ncurses_noecho + ncurses_nonl + ncurses_noqiflush + ncurses_noraw + ncurses_pair_content + ncurses_panel_above + ncurses_panel_below + ncurses_panel_window + ncurses_pnoutrefresh + ncurses_prefresh + ncurses_putp + ncurses_qiflush + ncurses_raw + ncurses_refresh + ncurses_replace_panel + ncurses_reset_prog_mode + ncurses_reset_shell_mode + ncurses_resetty + ncurses_savetty + ncurses_scr_dump + ncurses_scr_init + ncurses_scr_restore + ncurses_scr_set + ncurses_scrl + ncurses_show_panel + ncurses_slk_attr + ncurses_slk_attroff + ncurses_slk_attron + ncurses_slk_attrset + ncurses_slk_clear + ncurses_slk_color + ncurses_slk_init + ncurses_slk_noutrefresh + ncurses_slk_refresh + ncurses_slk_restore + ncurses_slk_set + ncurses_slk_touch + ncurses_standend + ncurses_standout + ncurses_start_color + ncurses_termattrs + ncurses_termname + ncurses_timeout + ncurses_top_panel + ncurses_typeahead + ncurses_ungetch + ncurses_ungetmouse + ncurses_update_panels + ncurses_use_default_colors + ncurses_use_env + ncurses_use_extended_names + ncurses_vidattr + ncurses_vline + ncurses_waddch + ncurses_waddstr + ncurses_wattroff + ncurses_wattron + ncurses_wattrset + ncurses_wborder + ncurses_wclear + ncurses_wcolor_set + ncurses_werase + ncurses_wgetch + ncurses_whline + ncurses_wmouse_trafo + ncurses_wmove + ncurses_wnoutrefresh + ncurses_wrefresh + ncurses_wstandend + ncurses_wstandout + ncurses_wvline + next + ngettext + nl2br + nl_langinfo + notes_body + notes_copy_db + notes_create_db + notes_create_note + notes_drop_db + notes_find_note + notes_header_info + notes_list_msgs + notes_mark_read + notes_mark_unread + notes_nav_create + notes_search + notes_unread + notes_version + nsapi_request_headers + nsapi_response_headers + nsapi_virtual + number_format + ob_clean + ob_end_clean + ob_end_flush + ob_flush + ob_get_clean + ob_get_contents + ob_get_flush + ob_get_length + ob_get_level + ob_get_status + ob_gzhandler + ob_iconv_handler + ob_implicit_flush + ob_list_handlers + ob_start + ob_tidyhandler + oci_bind_by_name + oci_cancel + oci_close + oci_collection_append + oci_collection_assign + oci_collection_assignelem + oci_collection_free + oci_collection_getelem + oci_collection_max + oci_collection_size + oci_collection_trim + oci_commit + oci_connect + oci_define_by_name + oci_error + oci_execute + oci_fetch + oci_fetch_all + oci_fetch_array + oci_fetch_assoc + oci_fetch_object + oci_fetch_row + oci_field_is_null + oci_field_name + oci_field_precision + oci_field_scale + oci_field_size + oci_field_type + oci_field_type_raw + oci_free_descriptor + oci_free_statement + oci_internal_debug + oci_lob_append + oci_lob_close + oci_lob_copy + oci_lob_eof + oci_lob_erase + oci_lob_export + oci_lob_flush + oci_lob_import + oci_lob_is_equal + oci_lob_load + oci_lob_read + oci_lob_rewind + oci_lob_save + oci_lob_seek + oci_lob_size + oci_lob_tell + oci_lob_truncate + oci_lob_write + oci_lob_write_temporary + oci_new_collection + oci_new_connect + oci_new_cursor + oci_new_descriptor + oci_num_fields + oci_num_rows + oci_parse + oci_password_change + oci_pconnect + oci_result + oci_rollback + oci_server_version + oci_set_prefetch + oci_statement_type + ocibindbyname + ocicancel + ocicloselob + ocicollappend + ocicollassign + ocicollassignelem + ocicollgetelem + ocicollmax + ocicollsize + ocicolltrim + ocicolumnisnull + ocicolumnname + ocicolumnprecision + ocicolumnscale + ocicolumnsize + ocicolumntype + ocicolumntyperaw + ocicommit + ocidefinebyname + ocierror + ociexecute + ocifetch + ocifetchinto + ocifetchstatement + ocifreecollection + ocifreecursor + ocifreedesc + ocifreestatement + ocigetbufferinglob + ociinternaldebug + ociloadlob + ocilogoff + ocilogon + ocinewcollection + ocinewcursor + ocinewdescriptor + ocinlogon + ocinumcols + ociparse + ociplogon + ociresult + ocirollback + ocirowcount + ocisavelob + ocisavelobfile + ociserverversion + ocisetbufferinglob + ocisetprefetch + ocistatementtype + ociwritelobtofile + ociwritetemporarylob + octdec + odbc_autocommit + odbc_binmode + odbc_close + odbc_close_all + odbc_columnprivileges + odbc_columns + odbc_commit + odbc_connect + odbc_cursor + odbc_data_source + odbc_do + odbc_error + odbc_errormsg + odbc_exec + odbc_execute + odbc_fetch_array + odbc_fetch_into + odbc_fetch_object + odbc_fetch_row + odbc_field_len + odbc_field_name + odbc_field_num + odbc_field_precision + odbc_field_scale + odbc_field_type + odbc_foreignkeys + odbc_free_result + odbc_gettypeinfo + odbc_longreadlen + odbc_next_result + odbc_num_fields + odbc_num_rows + odbc_pconnect + odbc_prepare + odbc_primarykeys + odbc_procedurecolumns + odbc_procedures + odbc_result + odbc_result_all + odbc_rollback + odbc_setoption + odbc_specialcolumns + odbc_statistics + odbc_tableprivileges + odbc_tables + openal_buffer_create + openal_buffer_data + openal_buffer_destroy + openal_buffer_get + openal_buffer_loadwav + openal_context_create + openal_context_current + openal_context_destroy + openal_context_process + openal_context_suspend + openal_device_close + openal_device_open + openal_listener_get + openal_listener_set + openal_source_create + openal_source_destroy + openal_source_get + openal_source_pause + openal_source_play + openal_source_rewind + openal_source_set + openal_source_stop + openal_stream + opendir + openlog + openssl_csr_export + openssl_csr_export_to_file + openssl_csr_new + openssl_csr_sign + openssl_error_string + openssl_free_key + openssl_get_privatekey + openssl_get_publickey + openssl_open + openssl_pkcs7_decrypt + openssl_pkcs7_encrypt + openssl_pkcs7_sign + openssl_pkcs7_verify + openssl_pkey_export + openssl_pkey_export_to_file + openssl_pkey_get_private + openssl_pkey_get_public + openssl_pkey_new + openssl_private_decrypt + openssl_private_encrypt + openssl_public_decrypt + openssl_public_encrypt + openssl_seal + openssl_sign + openssl_verify + openssl_x509_check_private_key + openssl_x509_checkpurpose + openssl_x509_export + openssl_x509_export_to_file + openssl_x509_free + openssl_x509_parse + openssl_x509_read + ora_bind + ora_close + ora_columnname + ora_columnsize + ora_columntype + ora_commit + ora_commitoff + ora_commiton + ora_do + ora_error + ora_errorcode + ora_exec + ora_fetch + ora_fetch_into + ora_getcolumn + ora_logoff + ora_logon + ora_numcols + ora_numrows + ora_open + ora_parse + ora_plogon + ora_rollback + ord + output_add_rewrite_var + output_reset_rewrite_vars + overload + override_function + ovrimos_close + ovrimos_commit + ovrimos_connect + ovrimos_cursor + ovrimos_exec + ovrimos_execute + ovrimos_fetch_into + ovrimos_fetch_row + ovrimos_field_len + ovrimos_field_name + ovrimos_field_num + ovrimos_field_type + ovrimos_free_result + ovrimos_longreadlen + ovrimos_num_fields + ovrimos_num_rows + ovrimos_prepare + ovrimos_result + ovrimos_result_all + ovrimos_rollback + pack + parentiterator_getchildren + parentiterator_haschildren + parentiterator_next + parentiterator_rewind + parse_ini_file + parse_str + parse_url + parsekit_compile_file + parsekit_compile_string + parsekit_func_arginfo + passthru + pathinfo + pclose + pcntl_alarm + pcntl_exec + pcntl_fork + pcntl_getpriority + pcntl_setpriority + pcntl_signal + pcntl_wait + pcntl_waitpid + pcntl_wexitstatus + pcntl_wifexited + pcntl_wifsignaled + pcntl_wifstopped + pcntl_wstopsig + pcntl_wtermsig + pdf_add_annotation + pdf_add_bookmark + pdf_add_launchlink + pdf_add_locallink + pdf_add_note + pdf_add_outline + pdf_add_pdflink + pdf_add_thumbnail + pdf_add_weblink + pdf_arc + pdf_arcn + pdf_attach_file + pdf_begin_page + pdf_begin_pattern + pdf_begin_template + pdf_circle + pdf_clip + pdf_close + pdf_close_image + pdf_close_pdi + pdf_close_pdi_page + pdf_closepath + pdf_closepath_fill_stroke + pdf_closepath_stroke + pdf_concat + pdf_continue_text + pdf_curveto + pdf_delete + pdf_end_page + pdf_end_pattern + pdf_end_template + pdf_endpath + pdf_fill + pdf_fill_stroke + pdf_findfont + pdf_get_buffer + pdf_get_font + pdf_get_fontname + pdf_get_fontsize + pdf_get_image_height + pdf_get_image_width + pdf_get_majorversion + pdf_get_minorversion + pdf_get_parameter + pdf_get_pdi_parameter + pdf_get_pdi_value + pdf_get_value + pdf_initgraphics + pdf_lineto + pdf_makespotcolor + pdf_moveto + pdf_new + pdf_open + pdf_open_ccitt + pdf_open_file + pdf_open_gif + pdf_open_image + pdf_open_image_file + pdf_open_jpeg + pdf_open_memory_image + pdf_open_pdi + pdf_open_pdi_page + pdf_open_png + pdf_open_tiff + pdf_place_image + pdf_place_pdi_page + pdf_rect + pdf_restore + pdf_rotate + pdf_save + pdf_scale + pdf_set_border_color + pdf_set_border_dash + pdf_set_border_style + pdf_set_char_spacing + pdf_set_duration + pdf_set_font + pdf_set_horiz_scaling + pdf_set_info + pdf_set_info_author + pdf_set_info_creator + pdf_set_info_keywords + pdf_set_info_subject + pdf_set_info_title + pdf_set_leading + pdf_set_parameter + pdf_set_text_matrix + pdf_set_text_pos + pdf_set_text_rendering + pdf_set_text_rise + pdf_set_value + pdf_set_word_spacing + pdf_setcolor + pdf_setdash + pdf_setflat + pdf_setfont + pdf_setgray + pdf_setgray_fill + pdf_setgray_stroke + pdf_setlinecap + pdf_setlinejoin + pdf_setlinewidth + pdf_setmatrix + pdf_setmiterlimit + pdf_setpolydash + pdf_setrgbcolor + pdf_setrgbcolor_fill + pdf_setrgbcolor_stroke + pdf_show + pdf_show_boxed + pdf_show_xy + pdf_skew + pdf_stringwidth + pdf_stroke + pdf_translate + pdo_begintransaction + pdo_commit + pdo_construct + pdo_errorcode + pdo_errorinfo + pdo_exec + pdo_getattribute + pdo_lastinsertid + pdo_prepare + pdo_query + pdo_quote + pdo_rollback + pdo_setattribute + pdostatement_bindcolumn + pdostatement_bindparam + pdostatement_columncount + pdostatement_errorcode + pdostatement_errorinfo + pdostatement_execute + pdostatement_fetch + pdostatement_fetchall + pdostatement_fetchsingle + pdostatement_getattribute + pdostatement_getcolumnmeta + pdostatement_rowcount + pdostatement_setattribute + pdostatement_setfetchmode + pfpro_cleanup + pfpro_init + pfpro_process + pfpro_process_raw + pfpro_version + pfsockopen + pg_affected_rows + pg_cancel_query + pg_client_encoding + pg_close + pg_connect + pg_connection_busy + pg_connection_reset + pg_connection_status + pg_convert + pg_copy_from + pg_copy_to + pg_dbname + pg_delete + pg_end_copy + pg_escape_bytea + pg_escape_string + pg_fetch_all + pg_fetch_array + pg_fetch_assoc + pg_fetch_object + pg_fetch_result + pg_fetch_row + pg_field_is_null + pg_field_name + pg_field_num + pg_field_prtlen + pg_field_size + pg_field_type + pg_free_result + pg_get_notify + pg_get_pid + pg_get_result + pg_host + pg_insert + pg_last_error + pg_last_notice + pg_last_oid + pg_lo_close + pg_lo_create + pg_lo_export + pg_lo_import + pg_lo_open + pg_lo_read + pg_lo_read_all + pg_lo_seek + pg_lo_tell + pg_lo_unlink + pg_lo_write + pg_meta_data + pg_num_fields + pg_num_rows + pg_options + pg_parameter_status + pg_pconnect + pg_ping + pg_port + pg_put_line + pg_query + pg_result_error + pg_result_seek + pg_result_status + pg_select + pg_send_query + pg_set_client_encoding + pg_trace + pg_tty + pg_unescape_bytea + pg_untrace + pg_update + pg_version + php_check_syntax + php_ini_scanned_files + php_logo_guid + php_sapi_name + php_strip_whitespace + php_uname + phpcredits + phpinfo + phpversion + pi + png2wbmp + popen + pos + posix_access + posix_ctermid + posix_get_last_error + posix_getcwd + posix_getegid + posix_geteuid + posix_getgid + posix_getgrgid + posix_getgrnam + posix_getgroups + posix_getlogin + posix_getpgid + posix_getpgrp + posix_getpid + posix_getppid + posix_getpwnam + posix_getpwuid + posix_getrlimit + posix_getsid + posix_getuid + posix_isatty + posix_kill + posix_mkfifo + posix_setegid + posix_seteuid + posix_setgid + posix_setpgid + posix_setsid + posix_setuid + posix_strerror + posix_times + posix_ttyname + posix_uname + pow + preg_grep + preg_match + preg_match_all + preg_quote + preg_replace + preg_replace_callback + preg_split + prev + print + print_r + printer_abort + printer_close + printer_create_brush + printer_create_dc + printer_create_font + printer_create_pen + printer_delete_brush + printer_delete_dc + printer_delete_font + printer_delete_pen + printer_draw_bmp + printer_draw_chord + printer_draw_elipse + printer_draw_line + printer_draw_pie + printer_draw_rectangle + printer_draw_roundrect + printer_draw_text + printer_end_doc + printer_end_page + printer_get_option + printer_list + printer_logical_fontheight + printer_open + printer_select_brush + printer_select_font + printer_select_pen + printer_set_option + printer_start_doc + printer_start_page + printer_write + printf + proc_close + proc_get_status + proc_nice + proc_open + proc_terminate + pspell_add_to_personal + pspell_add_to_session + pspell_check + pspell_clear_session + pspell_config_create + pspell_config_data_dir + pspell_config_dict_dir + pspell_config_ignore + pspell_config_mode + pspell_config_personal + pspell_config_repl + pspell_config_runtogether + pspell_config_save_repl + pspell_new + pspell_new_config + pspell_new_personal + pspell_save_wordlist + pspell_store_replacement + pspell_suggest + putenv + qdom_error + qdom_tree + quoted_printable_decode + quotemeta + rad2deg + rand + range + rar_close + rar_entry_get + rar_extract + rar_getattr + rar_getcrc + rar_getfiletime + rar_gethostos + rar_getmethod + rar_getname + rar_getpackedsize + rar_getunpackedsize + rar_getversion + rar_list + rar_open + rawurldecode + rawurlencode + read_exif_data + readdir + readfile + readgzfile + readline + readline_add_history + readline_callback_handler_install + readline_callback_handler_remove + readline_callback_read_char + readline_clear_history + readline_completion_function + readline_info + readline_list_history + readline_on_new_line + readline_read_history + readline_redisplay + readline_write_history + readlink + realpath + recode + recode_file + recode_string + recursivedirectoryiterator_getchildren + recursivedirectoryiterator_haschildren + recursivedirectoryiterator_key + recursivedirectoryiterator_next + recursivedirectoryiterator_rewind + recursiveiteratoriterator_current + recursiveiteratoriterator_getdepth + recursiveiteratoriterator_getsubiterator + recursiveiteratoriterator_key + recursiveiteratoriterator_next + recursiveiteratoriterator_rewind + recursiveiteratoriterator_valid + register_shutdown_function + register_tick_function + rename + rename_function + require + require_once + reset + restore_error_handler + restore_exception_handler + restore_include_path + return + rewind + rewinddir + rmdir + round + rsort + rtrim + scandir + sem_acquire + sem_get + sem_release + sem_remove + serialize + sesam_affected_rows + sesam_commit + sesam_connect + sesam_diagnostic + sesam_disconnect + sesam_errormsg + sesam_execimm + sesam_fetch_array + sesam_fetch_result + sesam_fetch_row + sesam_field_array + sesam_field_name + sesam_free_result + sesam_num_fields + sesam_query + sesam_rollback + sesam_seek_row + sesam_settransaction + session_cache_expire + session_cache_limiter + session_commit + session_decode + session_destroy + session_encode + session_get_cookie_params + session_id + session_is_registered + session_module_name + session_name + session_regenerate_id + session_register + session_save_path + session_set_cookie_params + session_set_save_handler + session_start + session_unregister + session_unset + session_write_close + set_error_handler + set_exception_handler + set_file_buffer + set_include_path + set_magic_quotes_runtime + set_time_limit + setcookie + setlocale + setrawcookie + settype + sha1 + sha1_file + shell_exec + shm_attach + shm_detach + shm_get_var + shm_put_var + shm_remove + shm_remove_var + shmop_close + shmop_delete + shmop_open + shmop_read + shmop_size + shmop_write + show_source + shuffle + similar_text + simplexml_element_asxml + simplexml_element_attributes + simplexml_element_children + simplexml_element_xpath + simplexml_import_dom + simplexml_load_file + simplexml_load_string + simplexmliterator_current + simplexmliterator_getchildren + simplexmliterator_haschildren + simplexmliterator_key + simplexmliterator_next + simplexmliterator_rewind + simplexmliterator_valid + sin + sinh + sizeof + sleep + snmp_get_quick_print + snmp_get_valueretrieval + snmp_read_mib + snmp_set_enum_print + snmp_set_oid_numeric_print + snmp_set_quick_print + snmp_set_valueretrieval + snmpget + snmpgetnext + snmprealwalk + snmpset + snmpwalk + snmpwalkoid + soap_soapclient_call + soap_soapclient_construct + soap_soapclient_dorequest + soap_soapclient_getfunctions + soap_soapclient_getlastrequest + soap_soapclient_getlastrequestheaders + soap_soapclient_getlastresponse + soap_soapclient_getlastresponseheaders + soap_soapclient_gettypes + soap_soapclient_setcookie + soap_soapclient_soapcall + soap_soapfault_construct + soap_soapheader_construct + soap_soapparam_construct + soap_soapserver_addfunction + soap_soapserver_construct + soap_soapserver_fault + soap_soapserver_getfunctions + soap_soapserver_handle + soap_soapserver_setclass + soap_soapserver_setpersistence + soap_soapvar_construct + socket_accept + socket_bind + socket_clear_error + socket_close + socket_connect + socket_create + socket_create_listen + socket_create_pair + socket_get_option + socket_get_status + socket_getpeername + socket_getsockname + socket_last_error + socket_listen + socket_read + socket_recv + socket_recvfrom + socket_select + socket_send + socket_sendto + socket_set_block + socket_set_blocking + socket_set_nonblock + socket_set_option + socket_set_timeout + socket_shutdown + socket_strerror + socket_write + sort + soundex + spl_classes + split + spliti + sprintf + sql_regcase + sqlite_array_query + sqlite_busy_timeout + sqlite_changes + sqlite_close + sqlite_column + sqlite_create_aggregate + sqlite_create_function + sqlite_current + sqlite_error_string + sqlite_escape_string + sqlite_exec + sqlite_factory + sqlite_fetch_all + sqlite_fetch_array + sqlite_fetch_column_types + sqlite_fetch_object + sqlite_fetch_single + sqlite_fetch_string + sqlite_field_name + sqlite_has_more + sqlite_has_prev + sqlite_key + sqlite_last_error + sqlite_last_insert_rowid + sqlite_libencoding + sqlite_libversion + sqlite_next + sqlite_num_fields + sqlite_num_rows + sqlite_open + sqlite_popen + sqlite_prev + sqlite_query + sqlite_rewind + sqlite_seek + sqlite_single_query + sqlite_udf_decode_binary + sqlite_udf_encode_binary + sqlite_unbuffered_query + sqlite_valid + sqrt + srand + sscanf + ssh2_auth_none + ssh2_auth_password + ssh2_auth_pubkey_file + ssh2_connect + ssh2_exec + ssh2_fetch_stream + ssh2_fingerprint + ssh2_methods_negotiated + ssh2_scp_recv + ssh2_scp_send + ssh2_sftp + ssh2_sftp_lstat + ssh2_sftp_mkdir + ssh2_sftp_readlink + ssh2_sftp_realpath + ssh2_sftp_rename + ssh2_sftp_rmdir + ssh2_sftp_stat + ssh2_sftp_symlink + ssh2_sftp_unlink + ssh2_shell + ssh2_tunnel + stat + str_ireplace + str_pad + str_repeat + str_replace + str_rot13 + str_shuffle + str_split + str_word_count + strcasecmp + strchr + strcmp + strcoll + strcspn + stream_context_create + stream_context_get_default + stream_context_get_options + stream_context_set_option + stream_context_set_params + stream_copy_to_stream + stream_filter_append + stream_filter_prepend + stream_filter_register + stream_filter_remove + stream_get_contents + stream_get_filters + stream_get_line + stream_get_meta_data + stream_get_transports + stream_get_wrappers + stream_register_wrapper + stream_select + stream_set_blocking + stream_set_timeout + stream_set_write_buffer + stream_socket_accept + stream_socket_client + stream_socket_enable_crypto + stream_socket_get_name + stream_socket_pair + stream_socket_recvfrom + stream_socket_sendto + stream_socket_server + stream_wrapper_register + stream_wrapper_restore + stream_wrapper_unregister + strftime + strip_tags + stripcslashes + stripos + stripslashes + stristr + strlen + strnatcasecmp + strnatcmp + strncasecmp + strncmp + strpbrk + strpos + strptime + strrchr + strrev + strripos + strrpos + strspn + strstr + strtok + strtolower + strtotime + strtoupper + strtr + strval + substr + substr_compare + substr_count + substr_replace + swf_actiongeturl + swf_actiongotoframe + swf_actiongotolabel + swf_actionnextframe + swf_actionplay + swf_actionprevframe + swf_actionsettarget + swf_actionstop + swf_actiontogglequality + swf_actionwaitforframe + swf_addbuttonrecord + swf_addcolor + swf_closefile + swf_definebitmap + swf_definefont + swf_defineline + swf_definepoly + swf_definerect + swf_definetext + swf_endbutton + swf_enddoaction + swf_endshape + swf_endsymbol + swf_fontsize + swf_fontslant + swf_fonttracking + swf_getbitmapinfo + swf_getfontinfo + swf_getframe + swf_labelframe + swf_lookat + swf_modifyobject + swf_mulcolor + swf_nextid + swf_oncondition + swf_openfile + swf_ortho + swf_ortho2 + swf_perspective + swf_placeobject + swf_polarview + swf_popmatrix + swf_posround + swf_pushmatrix + swf_removeobject + swf_rotate + swf_scale + swf_setfont + swf_setframe + swf_shapearc + swf_shapecurveto + swf_shapecurveto3 + swf_shapefillbitmapclip + swf_shapefillbitmaptile + swf_shapefilloff + swf_shapefillsolid + swf_shapelinesolid + swf_shapelineto + swf_shapemoveto + swf_showframe + swf_startbutton + swf_startdoaction + swf_startshape + swf_startsymbol + swf_textwidth + swf_translate + swf_viewport + swfaction + swfbitmap + swfbitmap.getheight + swfbitmap.getwidth + swfbutton + swfbutton.addaction + swfbutton.addshape + swfbutton.setaction + swfbutton.setdown + swfbutton.sethit + swfbutton.setover + swfbutton.setup + swfbutton_keypress + swfdisplayitem + swfdisplayitem.addcolor + swfdisplayitem.move + swfdisplayitem.moveto + swfdisplayitem.multcolor + swfdisplayitem.remove + swfdisplayitem.rotate + swfdisplayitem.rotateto + swfdisplayitem.scale + swfdisplayitem.scaleto + swfdisplayitem.setdepth + swfdisplayitem.setname + swfdisplayitem.setratio + swfdisplayitem.skewx + swfdisplayitem.skewxto + swfdisplayitem.skewy + swfdisplayitem.skewyto + swffill + swffill.moveto + swffill.rotateto + swffill.scaleto + swffill.skewxto + swffill.skewyto + swffont + swffont.getwidth + swfgradient + swfgradient.addentry + swfmorph + swfmorph.getshape1 + swfmorph.getshape2 + swfmovie + swfmovie.add + swfmovie.nextframe + swfmovie.output + swfmovie.remove + swfmovie.save + swfmovie.setbackground + swfmovie.setdimension + swfmovie.setframes + swfmovie.setrate + swfmovie.streammp3 + swfshape + swfshape.addfill + swfshape.drawcurve + swfshape.drawcurveto + swfshape.drawline + swfshape.drawlineto + swfshape.movepen + swfshape.movepento + swfshape.setleftfill + swfshape.setline + swfshape.setrightfill + swfsprite + swfsprite.add + swfsprite.nextframe + swfsprite.remove + swfsprite.setframes + swftext + swftext.addstring + swftext.getwidth + swftext.moveto + swftext.setcolor + swftext.setfont + swftext.setheight + swftext.setspacing + swftextfield + swftextfield.addstring + swftextfield.align + swftextfield.setbounds + swftextfield.setcolor + swftextfield.setfont + swftextfield.setheight + swftextfield.setindentation + swftextfield.setleftmargin + swftextfield.setlinespacing + swftextfield.setmargins + swftextfield.setname + swftextfield.setrightmargin + sybase_affected_rows + sybase_close + sybase_connect + sybase_data_seek + sybase_deadlock_retry_count + sybase_fetch_array + sybase_fetch_assoc + sybase_fetch_field + sybase_fetch_object + sybase_fetch_row + sybase_field_seek + sybase_free_result + sybase_get_last_message + sybase_min_client_severity + sybase_min_error_severity + sybase_min_message_severity + sybase_min_server_severity + sybase_num_fields + sybase_num_rows + sybase_pconnect + sybase_query + sybase_result + sybase_select_db + sybase_set_message_handler + sybase_unbuffered_query + symlink + syslog + system + tan + tanh + tcpwrap_check + tempnam + textdomain + tidy_access_count + tidy_clean_repair + tidy_config_count + tidy_construct + tidy_diagnose + tidy_error_count + tidy_get_body + tidy_get_config + tidy_get_error_buffer + tidy_get_head + tidy_get_html + tidy_get_html_ver + tidy_get_output + tidy_get_release + tidy_get_root + tidy_get_status + tidy_getopt + tidy_is_xhtml + tidy_is_xml + tidy_load_config + tidy_node_children + tidy_node_get_attr + tidy_node_get_nodes + tidy_node_haschildren + tidy_node_hassiblings + tidy_node_iscomment + tidy_node_ishtml + tidy_node_isjste + tidy_node_istext + tidy_node_isxhtml + tidy_node_isxml + tidy_node_next + tidy_node_prev + tidy_parse_file + tidy_parse_string + tidy_repair_file + tidy_repair_string + tidy_reset_config + tidy_save_config + tidy_set_encoding + tidy_setopt + tidy_warning_count + tidynode_isasp + tidynode_isphp + time + time_nanosleep + tmpfile + token_get_all + token_name + touch + trigger_error + trim + uasort + ucfirst + ucwords + udm_add_search_limit + udm_alloc_agent + udm_alloc_agent_array + udm_api_version + udm_cat_list + udm_cat_path + udm_check_charset + udm_check_stored + udm_clear_search_limits + udm_close_stored + udm_crc32 + udm_errno + udm_error + udm_find + udm_free_agent + udm_free_ispell_data + udm_free_res + udm_get_doc_count + udm_get_res_field + udm_get_res_param + udm_hash32 + udm_load_ispell_data + udm_open_stored + udm_set_agent_param + uksort + umask + uniqid + unixtojd + unlink + unpack + unregister_tick_function + unserialize + unset + urldecode + urlencode + use_soap_error_handler + user_error + usleep + usort + utf8_decode + utf8_encode + var_dump + var_export + variant + variant_abs + variant_add + variant_and + variant_cast + variant_cat + variant_cmp + variant_date_from_timestamp + variant_date_to_timestamp + variant_div + variant_eqv + variant_fix + variant_get_type + variant_idiv + variant_imp + variant_int + variant_mod + variant_mul + variant_neg + variant_not + variant_or + variant_pow + variant_round + variant_set + variant_set_type + variant_sub + variant_xor + version_compare + vfprintf + virtual + vpopmail_add_alias_domain + vpopmail_add_alias_domain_ex + vpopmail_add_domain + vpopmail_add_domain_ex + vpopmail_add_user + vpopmail_alias_add + vpopmail_alias_del + vpopmail_alias_del_domain + vpopmail_alias_get + vpopmail_alias_get_all + vpopmail_auth_user + vpopmail_del_domain + vpopmail_del_domain_ex + vpopmail_del_user + vpopmail_error + vpopmail_passwd + vpopmail_set_user_quota + vprintf + vsprintf + w32api_deftype + w32api_init_dtype + w32api_invoke_function + w32api_register_function + w32api_set_call_method + wddx_add_vars + wddx_deserialize + wddx_packet_end + wddx_packet_start + wddx_serialize_value + wddx_serialize_vars + wordwrap + xattr_get + xattr_list + xattr_remove + xattr_set + xattr_supported + xdiff_file_diff + xdiff_file_diff_binary + xdiff_file_merge3 + xdiff_file_patch + xdiff_file_patch_binary + xdiff_string_diff + xdiff_string_diff_binary + xdiff_string_merge3 + xdiff_string_patch + xdiff_string_patch_binary + xml_error_string + xml_get_current_byte_index + xml_get_current_column_number + xml_get_current_line_number + xml_get_error_code + xml_parse + xml_parse_into_struct + xml_parser_create + xml_parser_create_ns + xml_parser_free + xml_parser_get_option + xml_parser_set_option + xml_set_character_data_handler + xml_set_default_handler + xml_set_element_handler + xml_set_end_namespace_decl_handler + xml_set_external_entity_ref_handler + xml_set_notation_decl_handler + xml_set_object + xml_set_processing_instruction_handler + xml_set_start_namespace_decl_handler + xml_set_unparsed_entity_decl_handler + xmlrpc_decode + xmlrpc_decode_request + xmlrpc_encode + xmlrpc_encode_request + xmlrpc_get_type + xmlrpc_is_fault + xmlrpc_parse_method_descriptions + xmlrpc_server_add_introspection_data + xmlrpc_server_call_method + xmlrpc_server_create + xmlrpc_server_destroy + xmlrpc_server_register_introspection_callback + xmlrpc_server_register_method + xmlrpc_set_type + xpath_eval + xpath_eval_expression + xpath_new_context + xptr_eval + xptr_new_context + xsl_xsltprocessor_construct + xsl_xsltprocessor_get_parameter + xsl_xsltprocessor_has_exslt_support + xsl_xsltprocessor_import_stylesheet + xsl_xsltprocessor_register_php_functions + xsl_xsltprocessor_remove_parameter + xsl_xsltprocessor_set_parameter + xsl_xsltprocessor_transform_to_doc + xsl_xsltprocessor_transform_to_uri + xsl_xsltprocessor_transform_to_xml + xslt_backend_info + xslt_backend_name + xslt_backend_version + xslt_create + xslt_errno + xslt_error + xslt_free + xslt_getopt + xslt_process + xslt_set_base + xslt_set_encoding + xslt_set_error_handler + xslt_set_log + xslt_set_object + xslt_set_sax_handler + xslt_set_sax_handlers + xslt_set_scheme_handler + xslt_set_scheme_handlers + xslt_setopt + yaz_addinfo + yaz_ccl_conf + yaz_ccl_parse + yaz_close + yaz_connect + yaz_database + yaz_element + yaz_errno + yaz_error + yaz_es_result + yaz_get_option + yaz_hits + yaz_itemorder + yaz_present + yaz_range + yaz_record + yaz_scan + yaz_scan_result + yaz_schema + yaz_search + yaz_set_option + yaz_sort + yaz_syntax + yaz_wait + yp_all + yp_cat + yp_err_string + yp_errno + yp_first + yp_get_default_domain + yp_master + yp_match + yp_next + yp_order + zend_logo_guid + zend_version + zip_close + zip_entry_close + zip_entry_compressedsize + zip_entry_compressionmethod + zip_entry_filesize + zip_entry_name + zip_entry_open + zip_entry_read + zip_open + zip_read + zlib_get_coding_type + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/plist.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/plist.plist new file mode 100644 index 00000000..86f147c0 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/plist.plist @@ -0,0 +1,58 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <? + endInstruction + ?> + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + <!-- + endFirstMultiLineComment + --> + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + + autocompleteWords + + key + string + real + integer + date + true + false + data + array + dict + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/postscript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/postscript.plist new file mode 100644 index 00000000..b992f8a4 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/postscript.plist @@ -0,0 +1,441 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + + secondString + + firstSingleLineComment + % + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abs + add + aload + anchorsearch + and + arc + arcn + arct + arcto + array + ashow + astore + awidthshow + begin + bind + bitshift + ceiling + charpath + clear + cleartomark + clip + clippath + closepath + concat + concatmatrix + copy + count + counttomark + currentcmykcolor + currentdash + currentdict + currentfile + currentfont + currentgray + currentgstate + currenthsbcolor + currentlinecap + currentlinejoin + currentlinewidth + currentmatrix + currentpoint + currentrgbcolor + currentshared + curveto + cvi + cvlit + cvn + cvr + cvrs + cvs + cvx + def + defineusername + dict + div + dtransform + dup + end + eoclip + eofill + eoviewclip + eq + exch + exec + exit + file + fill + findfont + flattenpath + floor + flush + flushfile + for + forall + ge + get + getinterval + grestore + gsave + gstate + gt + identmatrix + idiv + idtransform + if + ifelse + image + imagemask + index + ineofill + infill + initviewclip + inueofill + inufill + invertmatrix + itransform + known + le + length + lineto + load + loop + lt + makefont + matrix + maxlength + mod + moveto + mul + ne + neg + newpath + not + null + or + pathbbox + pathforall + pop + print + printobject + put + putinterval + rcurveto + read + readhexstring + readline + readstring + rectclip + rectfill + rectstroke + rectviewclip + repeat + restore + rlineto + rmoveto + roll + rotate + round + save + scale + scalefont + search + selectfont + setbbox + setcachedevice + setcachedevice2 + setcharwidth + setcmykcolor + setdash + setfont + setgray + setgstate + sethsbcolor + setlinecap + setlinejoin + setlinewidth + setmatrix + setrgbcolor + setshared + shareddict + show + showpage + stop + stopped + store + string + stringwidth + stroke + strokepath + sub + systemdict + token + transform + translate + truncate + type + uappend + ucache + ueofill + ufill + undef + upath + userdict + ustroke + viewclip + viewclippath + where + widthshow + write + writehexstring + writeobject + writestring + wtranslation + xor + xshow + xyshow + yshow + FontDirectory + SharedFontDirectory + Courier + Courier-Bold + Courier-BoldOblique + Courier-Oblique + Helvetica + Helvetica-Bold + Helvetica-BoldOblique + Helvetica-Oblique + Symbol + Times-Bold + Times-BoldItalic + Times-Italic + Times-Roman + execuserobject + currentcolor + currentcolorspace + currentglobal + execform + filter + findresource + globaldict + makepattern + setcolor + setcolorspace + setglobal + setpagedevice + setpattern + ISOLatin1Encoding + StandardEncoding + atan + banddevice + bytesavailable + cachestatus + closefile + colorimage + condition + copypage + cos + countdictstack + countexecstack + cshow + currentblackgeneration + currentcacheparams + currentcolorscreen + currentcolortransfer + currentcontext + currentflat + currenthalftone + currenthalftonephase + currentmiterlimit + currentobjectformat + currentpacking + currentscreen + currentstrokeadjust + currenttransfer + currentundercolorremoval + defaultmatrix + definefont + deletefile + detach + deviceinfo + dictstack + echo + erasepage + errordict + execstack + executeonly + exp + false + filenameforall + fileposition + fork + framedevice + grestoreall + handleerror + initclip + initgraphics + initmatrix + instroke + inustroke + join + kshow + ln + lock + log + mark + monitor + noaccess + notify + nulldevice + packedarray + quit + rand + rcheck + readonly + realtime + renamefile + renderbands + resetfile + reversepath + rootfont + rrand + run + scheck + setblackgeneration + setcachelimit + setcacheparams + setcolorscreen + setcolortransfer + setfileposition + setflat + sethalftone + sethalftonephase + setmiterlimit + setobjectformat + setpacking + setscreen + setstrokeadjust + settransfer + setucacheparams + setundercolorremoval + sin + sqrt + srand + stack + status + statusdict + true + ucachestatus + undefinefont + usertime + ustrokepath + version + vmreclaim + vmstatus + wait + wcheck + xcheck + yield + defineuserobject + undefineuserobject + UserObjects + cleardictstack + setvmthreshold + currentcolorrendering + currentdevparams + currentoverprint + currentpagedevice + currentsystemparams + currentuserparams + defineresource + findencoding + gcheck + glyphshow + languagelevel + product + pstack + resourceforall + resourcestatus + revision + serialnumber + setcolorrendering + setdevparams + setoverprint + setsystemparams + setuserparams + startjob + undefineresource + GlobalFontDirectory + ASCII85Decode + ASCII85Encode + ASCIIHexDecode + ASCIIHexEncode + CCITTFaxDecode + CCITTFaxEncode + DCTDecode + DCTEncode + LZWDecode + LZWEncode + NullEncode + RunLengthDecode + RunLengthEncode + SubFileDecode + CIEBasedA + CIEBasedABC + DeviceCMYK + DeviceGray + DeviceRGB + Indexed + Pattern + Separation + CIEBasedDEF + CIEBasedDEFG + DeviceN + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/prolog.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/prolog.plist new file mode 100644 index 00000000..e315b7c6 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/prolog.plist @@ -0,0 +1,460 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + % + firstString + " + functionDefinition + + removeFromFunction + + keywords + + var + nonvar + atom + integer + float + number + atomic + compound + callable + unify_with_occurs_check + functor + arg + copy_term + is + asserta + assertz + retract + clause + abolish + current_predicate + findall + bagof + setof + current_input + current_output + set_input + set_output + open + read + write + append + type + text + binary + reposition + true + false + eof_action + error + eof_code + reset + alias + close + flush_output + stream_property + input + output + position + end_of_stream + file_name + mode + at_end_of_stream + set_stream_position + get_char + get_code + peek_char + peek_code + put_char + put_code + nl + get_byte + peek_byte + read_term + read + write_term + write + writeq + write_canonical + quoted + ignore_ops + numbervars + current_op + char_conversion + current_char_conversion + set_prolog_flag + current_prolog_flag + bounded + max_integer + min_integer + integer_rounding_function + toward_zero + down + max_arity + max_atom + max_unget + prolog_name + prolog_version + prolog_date + prolog_copyright + char_conversion + on + off + debug + singleton_warning + strict_iso + double_quotes + atom + chars + codes + atom_no_escape + chars_no_escape + codes_no_escape + back_quotes + unknown + error + warning + fail + syntax_error + os_error + atom_length + atom_concat + sub_atom + char_code + atom_chars + number_chars + number_codes + halt + once + repeat + -> + ; + call + catch + throw + dynamic + multifile + discontiguous + include + ensure_loaded + initialization + op + + + fd_all_different + fd_element + fd_element_var + fd_atmost + fd_atleast + fd_exactly + fd_relation + fd_relationc + fd_labeling + fd_labeling + fd_labelingff + fd_minimize + fd_minimize + fd_max_integer + fd_vector_max + fd_set_vector_max + fd_domain + fd_domain_bool + fd_var + non_fd_var + generic_var + non_generic_var + fd_min + fd_max + fd_size + fd_dom + fd_has_extra_cstr + fd_has_vector + fd_use_vector + foreign + built_in + built_in_fd + ensure_linked + public + write_term_to_chars + write_to_chars + writeq_to_chars + write_canonical_to_chars + display_to_chars + print_to_chars + write_term_to_codes + write_to_codes + writeq_to_codes + write_canonical_to_codes + display_to_codes + print_to_codes + format_to_codes + format_to_chars + write_term_to_atom + write_to_atom + writeq_to_atom + write_canonical_to_atom + display_to_atom + print_to_atom + format_to_atom + read_term_from_chars + read_from_chars + read_token_from_chars + read_term_from_codes + read_from_codes + read_token_from_codes + read_term_from_atom + read_from_atom + read_token_from_atom + for + call_with_args + abort + stop + top_level + atom_property + hash + prefix_op + infix_op + postfix_op + needs_quotes + need_scan + current_atom + new_atom + atom_hash + name + number_atom + lower_upper + append + member + memberchk + reverse + delete + select + permutation + prefix + suffix + sublist + last + length + nth + max_list + min_list + sum_list + sort + sort0 + keysort + g_assign + g_assignb + g_link + g_read + g_array_size + g_inco + g_inc + g_dec + g_deco + g_set_bit/2, + write_pl_state_file + read_pl_state_file + current_bip_name + set_bip_name + list + partial_list + list_or_partial_list + setarg + name_singleton_vars + name_query_vars + bind_variables + numbervars + term_ref + retract_all + predicate_property + static + dynamic + private + public + user + built_in + built_inf_fd + native_code + prolog_file + prolog_line + mirror + buffering + none + line + block + current_stream + stream_position + seek + character_count + line_count + line_position + set_stream_line_column + add_stream_alias + add_stream_mirror + remove_stream_mirror + current_mirror + set_stream_type + set_stream_eof_action + set_stream_buffering + open_input_atom_stream + open_input_chars_stream + open_input_codes_stream + close_input_atom_stream + close_input_chars_stream + close_input_codes_stream + open_output_atom_stream + open_output_chars_stream + open_output_codes_stream + close_output_atom_stream + close_output_chars_stream + close_output_codes_stream + get_key + get_key_no_echo + unget_char + unget_code + unget_byte + put_byte + read_atom + read_integer + read_number + read_token + syntax_error_info + last_read_start_line_column + display + print + namevars + space_args + portrayed + max_depth + priority + format + portray_clause + get_print_stream + see + tell + append + seeing + telling + seen + told + get0 + get + skip + put + tab + expand_term + term_expansion + phrase + get_linedit_prompt + set_linedit_prompt + add_linedit_completion + find_linedit_completion + sr_open + sr_change_options + sr_close + sr_read_term + sr_current_descriptor + sr_get_stream + sr_get_module + sr_get_file_name + sr_get_position + sr_get_include_list + sr_get_include_stream_list + sr_get_size_counters + sr_get_error_counters + sr_set_error_counters + sr_error_from_exception + sr_write_message + sr_write_error + socket + socket_close + socket_bind + socket_connect + socket_listen + socket_accept + hostname_address + argument_counter + argument_value + argument_list + environ + make_directory + delete_directory + change_directory + working_directory + directory_files + rename_file + delete_file + unlink + file_permission + file_exists + file_property + temporary_name + temporary_file + date_time + host_name + os_version + architecture + shell + system + spawn + popen + exec + fork_prolog + create_pipe + wait + prolog_pid + send_signal + sleep + select + absolute_file_name + decompose_file_name + prolog_file_name + set_seed + randomize + get_seed + random + statistics + user_time + system_time + cpu_time + real_time + consult + load + listing + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/python.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/python.plist new file mode 100644 index 00000000..3c67ddec --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/python.plist @@ -0,0 +1,301 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(def|class).* + removeFromFunction + def + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + import + from + as + and + assert + break + class + continue + def + del + elif + else + except + exec + finally + for + global + if + in + is + lambda + not + or + pass + print + raise + return + try + while + yield + abs + apply + buffer + callable + chr + cmp + coerce + compile + complex + copyright + credits + delattr + dir + divmod + eval + execfile + exit + filter + float + getattr + globals + hasattr + hash + hex + id + input + int + intern + isinstance + issubclass + iter + len + license + list + locals + long + map + max + min + oct + open + ord + pow + quit + range + raw_input + reduce + reload + repr + round + setattr + slice + str + tuple + type + unichr + unicode + vars + xrange + zip + None + self + + autocompleteWords + + ArithmeticError + AssertionError + AttributeError + DeprecationWarning + EOFError + EnvironmentError + Exception + FloatingPointError + IOError + ImportError + IndentationError + IndexError + KeyError + KeyboardInterrupt + LookupError + MemoryError + NameError + NotImplemented + NotImplementedError + OSError + OverflowError + OverflowWarning + ReferenceError + RuntimeError + RuntimeWarning + StandardError + StopIteration + SyntaxError + SyntaxWarning + SystemError + SystemExit + TabError + TypeError + UnboundLocalError + UnicodeError + UserWarning + ValueError + Warning + WindowsError + ZeroDivisionError + BufferType + BuiltinFunctionType + BuiltinMethodType + ClassType + CodeType + ComplexType + DictProxyType + DictType + DictionaryType + EllipsisType + FileType + FloatType + FrameType + FunctionType + GeneratorType + InstanceType + IntType + LambdaType + ListType + LongType + MethodType + ModuleType + NoneType + ObjectType + SliceType + StringType + StringTypes + TracebackType + TupleType + TypeType + UnboundMethodType + UnicodeType + XRangeType + False + None + True + __abs__ + __add__ + __all__ + __author__ + __bases__ + __builtins__ + __call__ + __class__ + __cmp__ + __coerce__ + __contains__ + __debug__ + __del__ + __delattr__ + __delitem__ + __delslice__ + __dict__ + __div__ + __divmod__ + __doc__ + __eq__ + __file__ + __float__ + __floordiv__ + __future__ + __ge__ + __getattr__ + __getattribute__ + __getitem__ + __getslice__ + __gt__ + __hash__ + __hex__ + __iadd__ + __import__ + __imul__ + __init__ + __int__ + __invert__ + __iter__ + __le__ + __len__ + __long__ + __lshift__ + __lt__ + __members__ + __metaclass__ + __mod__ + __mro__ + __mul__ + __name__ + __ne__ + __neg__ + __new__ + __nonzero__ + __oct__ + __or__ + __path__ + __pos__ + __pow__ + __radd__ + __rdiv__ + __rdivmod__ + __reduce__ + __repr__ + __rfloordiv__ + __rlshift__ + __rmod__ + __rmul__ + __ror__ + __rpow__ + __rrshift__ + __rsub__ + __rtruediv__ + __rxor__ + __setattr__ + __setitem__ + __setslice__ + __self__ + __slots__ + __str__ + __sub__ + __truediv__ + __version__ + __xor__ + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/r.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/r.plist new file mode 100644 index 00000000..a91392ef --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/r.plist @@ -0,0 +1 @@ + beginCommand endCommand beginInstruction endInstruction beginVariable endVariable firstString " secondString ' firstSingleLineComment # secondSingleLineComment beginFirstMultiLineComment endFirstMultiLineComment beginSecondMultiLineComment endSecondMultiLineComment functionDefinition ^\s*.*<\-\s*function.*\n?\s*\{ removeFromFunction keywordsCaseSensitive recolourKeywordIfAlreadyColoured keywords if else for while repeat break next in TRUE FALSE T F abbreviate abline abs acos acosh add.scope add1 addTaskCallback aggregate AIC AIC.logLik airmiles airquality alias alist all all.equal all.equal.POSIXct all.names all.vars anova anova.glm anova.glmlist anova.lm anova.lmlist anova.mlm anovalist.lm anscombe any aov aperm append apply approx approxfun apropos Arg args Arithmetic array arrows as.array as.call as.factor as.character as.character.octmode as.character.POSIXt as.complex as.data.frame as.data.frame.logLik as.data.frame.matrix as.data.frame.model.matrix as.data.frame.numeric as.data.frame.ordered as.data.frame.POSIXct as.data.frame.POSIXlt as.data.frame.table as.data.frame.ts as.data.frame.vector as.double as.environment as.expression as.factor as.formula as.function as.integer as.list as.logical as.matrix as.matrix.noquote as.matrix.POSIXlt as.name as.null as.numeric as.ordered as.pairlist as.POSIXct as.POSIXlt as.qr as.real as.single as.symbol as.table as.table.ftable as.ts as.vector asin asinh assign assocplot atan atan2 atanh attach attenu attitude attr attr.all.equal attributes autoload autoloader ave axis axis.POSIXct backsolve barplot basename BATCH Bessel bessel besselI besselJ besselK besselY Beta beta Binomial binomial bitmap bmp body box boxplot boxplot.formula boxplot.stats bringToTop browser bug.report build builtins bw.bcv bw.nrd bw.nrd0 bw.SJ bw.ucv bxp by bzfile C c c.POSIXct c.POSIXlt call capabilities cars case.names casefold cat Cauchy cbind cbind.ts ceiling char.expand character charmatch chartr check check.options chickwts Chisquare chol chol2inv choose chull class close close.screen close.socket closeAllConnections cm cm.colors co.intervals co2 codes coef coefficients coefficients.glm coefficients.lm col col2rgb colMeans colnames colors colours colSums commandArgs comment compareVersion Comparison complete.cases complex conflicts Conj connection connections contour contr.helmert contr.poly contr.sum contr.treatment contrasts contrib.url contributors Control convolve cooks.distance coplot copyright copyrights cor cos cosh count.fields cov cov.wt covratio CRAN.packages crossprod cummax cummin cumprod cumsum curve cut cut.POSIXt cycle D data data.class data.entry data.frame data.matrix dataentry date DateTimeClasses dbeta dbinom dcauchy dchisq de debug debugger delay delete.response deltat demo density deparse Deprecated deriv deriv3 det detach dev.control dev.copy dev.copy2eps dev.cur dev.interactive dev.list dev.next dev.off dev.prev dev.print dev.set dev2bitmap deviance device Devices dexp df df.residual dfbetas dffits dgamma dgeom dget dhyper diag diff diff.ts difftime digamma dim dimnames dir dir.create dirname discoveries DLL.version dlnorm dlogis dnbinom dnorm do.call dotchart double download.file download.packages dpois dput drop drop.scope drop.terms drop1 dsignrank dt dummy.coef dump dump.frames dunif duplicated dweibull dwilcox dyn.load dyn.unload edit edit.data.frame edit.default edit.matrix eff.aovlist effects eigen emacs end environment erase.screen esoph euro eurodist eval evalq example exists exp expand.grid expand.model.frame expm1 Exponential expression Extract extractAIC factor factor.scope faithful family family.glm family.lm FDist fft fifo file file.access file.append file.choose file.copy file.create file.exists file.info file.path file.remove file.rename file.show files filled.contour find findInterval fitted fitted.values.glm fitted.values.lm fivenum fix floor flush.console Foreign Formaldehyde formals format format.char format.data.frame format.default format.factor format.info format.octmode format.POSIXct format.POSIXlt format.pval formatC formatDL formula formula.lm formula.terms forwardsolve fourfoldplot frame freeny frequency ftable ftable.formula function Gamma gamma gammaCody GammaDist gaussian gc gc.time gcinfo gctorture Geometric get getAllConnections getCConverterDescriptions getCConverterStatus getConnection geterrmessage getNativeSymbolInfo getNumCConverters getOption getTaskCallbackNames getwd gl glm glm.control glm.fit globalenv graphics.off gray grep grey grid gsub gzfile HairEyeColor hasTsp hat heat.colors help help.search help.start Hershey hist hist.POSIXt history hsv Hypergeometric I identical identify ifelse Im image index.search Inf infert influence.measures inherits InsectSprays INSTALL install.packages installed.packages integer integrate interaction interaction.plot interactive intersect inverse.gaussian inverse.rle invisible IQR iris iris3 is.array is.atomic is.call is.character is.complex is.data.frame is.double is.element is.empty.model is.environment is.expression is.factor is.finite is.function is.infinite is.integer is.language is.list is.loaded is.logical is.matrix is.mts is.na is.na.POSIXlt is.name is.nan is.null is.numeric is.object is.ordered is.pairlist is.qr is.R is.real is.recursive is.single is.symbol is.table is.ts is.unsorted is.vector isIncomplete islands ISOdate ISOdatetime ISOLatin1 isOpen isSeekable Japanese jitter jpeg julian kappa kronecker La.eigen La.svd labels lapply layout lbeta lchoose lcm legend length LETTERS letters levels lgamma library library.dynam licence license LifeCycleSavings limitedLabels lines lines.formula lines.histogram lines.ts link.html.help list list.files lm lm.fit lm.influence lm.wfit load loadhistory local localeconv locales locator log log10 log1p log2 logb Logic logical Logistic logLik logLik.glm logLik.lm loglin Lognormal longley lower.tri lowess ls ls.diag ls.print ls.str lsf.str lsfit Machine machine MacRoman mad mahalanobis make.link make.names make.packages.html make.search.html make.socket makepredictcall makepredictcall.poly manova margin.table mat.or.vec match match.arg match.call match.fun Math Math.POSIXlt Math.POSIXt matlines matmult matplot matpoints matrix max max.col mean mean.POSIXct mean.POSIXlt median mem.limits Memory memory.limit memory.profile memory.size menu merge Methods methods min missing Mod mode model.extract model.frame model.matrix model.matrix.glm.null model.matrix.lm model.offset model.response model.tables model.weights month.abb month.name months morley mosaicplot mtcars mtext mvfft n2mfrow NA na.action na.exclude na.fail na.omit na.omit.ts na.pass name names NaN napredict naprint naresid nargs native.enc nchar nclass.FD nclass.scott nclass.Sturges ncol NegBinomial new.env newestVersion NextMethod nextn nhtemp nlevels nlm noquote Normal NotYetImplemented NotYetUsed nrow NULL numeric object.size objects offset old-piechart old.packages on.exit open Ops Ops.POSIXct Ops.POSIXlt Ops.POSIXt Ops.ts optim optimise optimize options OrchardSprays order ordered outer p.adjust package.contents package.dependencies package.description package.skeleton packageStatus page pairlist pairs pairs.formula palette panel.smooth par Paren parent.env parent.frame parse paste path.expand pbeta pbinom pbirthday pcauchy pchisq pdf pentagamma persp pexp pf pgamma pgeom phones phyper pi pico pictex pie piechart pipe PlantGrowth Platform plnorm plogis plot plot.data.frame plot.default plot.density plot.factor plot.formula plot.function plot.gam plot.histogram plot.lm plot.mlm plot.mts plot.new plot.POSIXct plot.POSIXlt plot.table plot.ts plot.TukeyHSD plot.window plot.xy plotmath pmatch pmax pmin pnbinom png pnorm points points.formula Poisson poisson poly polygon polym polyroot pos.to.env POSIXct POSIXlt postscript power ppoints ppois precip predict predict.glm predict.lm predict.mlm predict.poly preplot presidents pressure pretty prettyNum print print.anova print.aov print.aovlist print.AsIs print.atomic print.by print.coefmat print.connection print.data.frame print.default print.density print.difftime print.dummy.coef print.factor print.family print.formula print.ftable print.glm print.hsearch print.htest print.infl print.integrate print.libraryIQR print.listof print.lm print.logLik print.matrix print.mtable print.noquote print.octmode print.ordered print.packageInfo print.packageIQR print.packageStatus print.POSIXct print.POSIXlt print.recordedplot print.rle print.SavedPlots print.simple.list print.socket print.summary.aov print.summary.aovlist print.summary.glm print.summary.lm print.summary.manova print.summary.table print.table print.tables.aov print.terms print.ts print.TukeyHSD print.xtabs prmatrix proc.time prod profile proj prompt prop.table ps.options psignrank pt ptukey punif pushBack pushBackLength pweibull pwilcox q qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqplot qr qr.Q qr.qty qr.qy qr.R qr.resid qr.solve qr.X qsignrank qt qtukey quakes quantile quarters quasi quasibinomial quasipoisson quit qunif quote qweibull qwilcox R.home R.Version R.version rainbow Random.user randu range rank rbeta rbind rbinom rcauchy rchisq Rconsole Rd2dvi Rd2txt Rdconv Rdevga Rdindex Re read.00Index read.csv read.csv2 read.dcf read.delim read.delim2 read.ftable read.fwf read.socket read.table readBin readChar readline readLines real Recall recordPlot recover rect reformulate reg.finalizer regexpr relevel REMOVE remove remove.packages removeCConverter removeTaskCallback Renviron.site rep replace replayPlot replications require reshape resid residuals residuals.glm residuals.lm restart return rev rexp rf rgamma rgb rgeom rhyper rivers rle rlnorm rlogis rm rnbinom RNG RNGkind rnorm round round.difftime round.POSIXt row row.names rowMeans rownames rowsum rowSums rpois Rprof Rprofile rsignrank rstandard rstudent rt rug runif rweibull rwilcox R_LIBS SafePrediction sample sapply save savehistory savePlot scale scan screen sd Sd2Rd se.contrast search searchpaths seek segments select.list seq seq.POSIXt sequence set.seed setCConverterStatus setdiff setequal setwd shell shell.exec SHLIB showConnections sign signif SignRank sin single sinh sink sleep socketConnection solve sort sort.list source Special spline splinefun split split.screen sprintf sqrt stack stack.loss stack.x stackloss stars start Startup stat.anova state stderr stdin stdout stem step stop stopifnot storage.mode str str.logLik str.POSIXt strftime strheight stripchart strptime strsplit structure strwidth strwrap sub Subscript subset substitute substr substring sum Summary summary summary.aov summary.aovlist summary.connection Summary.data.frame summary.data.frame summary.default Summary.factor summary.factor summary.glm summary.infl summary.lm summary.manova summary.matrix summary.mlm summary.packageStatus Summary.POSIXct summary.POSIXct Summary.POSIXlt summary.POSIXlt summary.table sunflowerplot sunspots svd sweep swiss switch symbol.C symbol.For symbols symnum Syntax sys.call sys.calls sys.frame sys.frames sys.function Sys.getenv Sys.getlocale Sys.info sys.load.image Sys.localeconv sys.nframe sys.on.exit sys.parent sys.parents Sys.putenv sys.save.image Sys.setlocale Sys.sleep sys.source sys.status Sys.time Sys.timezone system system.file system.time t table tabulate tan tanh tapply taskCallbackManager TDist tempfile termplot terms terms.formula terms.object terms.terms terrain.colors tetragamma text textConnection time Titanic title tolower ToothGrowth topo.colors toString toupper trace traceback transform trees Trig trigamma trunc trunc.POSIXt truncate try ts tsp Tukey TukeyHSD type.convert typeof UCBAdmissions unclass undebug Uniform union unique uniroot unix unix.time unlink unlist unname unsplit unstack untrace unz update update.formula update.packages update.packageStatus upgrade upper.tri url url.show USArrests UseMethod USJudgeRatings USPersonalExpenditure uspop VADeaths var variable.names vector version vi volcano warning warnings warpbreaks weekdays Weibull weighted.mean weighted.residuals weights weights.glm weights.lm which which.max which.min Wilcoxon win.graph win.metafile win.print win.version WinAnsi winDialog winDialogString window windows winMenuAdd winMenuAddItem winMenuDel winMenuDelItem with women write write.dcf write.ftable write.socket write.table writeBin writeChar writeLines X11 x11 xedit xemacs xfig xinch xor xpdrows.data.frame xtabs xy.coords xyinch xyz.coords yinch zapsmall zip.file.extract zip.unpack .Autoloaded .AutoloadEnv .BaseNamespaceEnv .C .Call .Class .Deprecated .Device .Devices .Dyn.libs .External .find.package .First .First.lib .Fortran .Generic .GlobalEnv .Group .Internal .Last .Last.lib .Last.value .leap.seconds .lib.loc .libPaths .Library .Machine .Method .NotYetImplemented .NotYetUsed .Options .packages .Pars .path.package .Platform .PostScript.Options .Primitive .primTrace .primUntrace .ps.prolog .Random.seed .Renviron .Rprofile .Script .Traceback \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/rhtml.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/rhtml.plist new file mode 100644 index 00000000..c7b932f8 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/rhtml.plist @@ -0,0 +1,1075 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <% + endInstruction + %> + beginVariable + @ + endVariable + . + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + <!-- + endSecondMultiLineComment + --> + functionDefinition + ^\s*<\/{0}div.*> + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + BEGIN + END + and + begin + break + case + catch + defined? + do + else + elsif + end + ensure + for + if + in + include + next + not + or + private + protected + public + redo + require + rescue + retry + return + then + throw + unless + until + when + while + yield + attr + attr_reader + attr_writer + attr_accessor + alias + module + class + def + undef + self + super + nil + false + true + __FILE__ + __LINE__ + + autocompleteWords + + accepts + activate_drb + active? + acts_as_list + acts_as_nested_set + acts_as_tree + adapter_name + add + add_child + add_column + add_index + add_limit! + add_limit_offset! + add_on_blank + add_on_boundary_breaking + add_on_boundry_breaking + add_on_empty + add_to_base + adjust + advance + after_create + after_destroy + after_filter + after_invocation + after_save + after_update + after_validation + after_validation_on_create + after_validation_on_update + ago + alert + aliased_prefix + aliased_primary_key + aliased_table_name + aliased_table_names_for + all + all_children + allow_identity_inserts + ancestors + announce + append_after_filter + append_after_invocation + append_around_filter + append_before_filter + append_before_invocation + append_features + around_filter + array_or_string_for_javascript + assert + assert + assert_dom_equal + assert_dom_not_equal + assert_generates + assert_no_tag + assert_recognizes + assert_redirected_to + assert_response + assert_routing + assert_tag + assert_template + assert_valid + assert_valid_keys + assign + assigns + association_join + at + at_beginning_of_day + at_beginning_of_month + at_beginning_of_quarter + at_beginning_of_week + at_beginning_of_year + at_end_of_month + at_midnight + attr_accessible + attr_protected + attribute_names + attribute_present? + attributes + attributes= + attributes_before_type_cast + attributes_with_quotes_pre_oracle + auto_complete_field + auto_complete_for + auto_complete_result + auto_discovery_link_tag + auto_link + average + base_class + before_create + before_destroy + before_destroy + before_filter + before_invocation + before_save + before_update + before_validation + before_validation_on_create + before_validation_on_update + begin_db_transaction + beginning_of_day + beginning_of_month + beginning_of_quarter + beginning_of_week + beginning_of_year + belongs_to + benchmark + binary_to_string + breakpoint + build + build_callbacks + build_observer + build_request_uri + button_to + button_to_function + byte + bytes + cache + cache_erb_fragment + cache_page + caches_page + calculate + call + camelcase + camelize + capture + cast_expects + cast_returns + catch_schema_changes + cdata! + cdata_section + change + change_column + change_column_default + check_box + check_box_tag + child? + children_count + class_name + class_of_active_record_descendant + classify + classify + clean_backtrace + clean_within + clear + clear_active_connections! + clone + cltmsgCB + collection_select + column + column_for_attribute + column_names + column_names_with_alias + columns + columns_hash + comment! + commit_db_transaction + composed_of + compute_type + concat + condition_block? + connected? + connection + connection= + constantize + construct + construct_association + content_columns + content_for + content_tag + content_type + controller_class_name + controller_name + controller_path + convert_key + convert_value + cookie + cookies + cookies + count + count_by_sql + count_collection_for_pagination + country_options_for_select + country_select + create + create! + create_database + create_fixtures + create_reflection + create_table + current + current_database + current_page + current_page= + current_page? + cycle + dasherize + dasherize + date_select + datetime_select + day + days + days_in_month + deactivate_drb + deadlocked? + debug + declare! + decrement + decrement! + decrement_counter + decrement_position + default + default_sequence_name + default_url_options + define + define_javascript_functions + delay + delete + delete? + delete_all + delete_existing_fixtures + deliver + deliver! + demodulize + destroy + destroy + destroy_all + diff + direct_children + discard + disconnect! + distance_of_time_in_words + distance_of_time_in_words_to_now + domain + draggable + draggable_element + drop_database + drop_receiving + drop_receiving_element + drop_table + dup + each + each_char + each_full + each_pair + empty? + end_form_tag + end_of_month + ends_with? + eql? + error_message_on + error_messages_for + errors + escape_javascript + establish_connection + evaluate_condition + evaluate_remote_response + even? + exabyte + exabytes + excerpt + exec + execute + exists? + expects_index_of + expects_to_hash + expire_action + expire_fragment + expire_page + expires_in + expires_now + extract_record + failed? + fetch + fields_for + file_field + file_field_tag + find + find_all_tag + find_by_sql + find_collection_for_pagination + find_tag + first + first? + first_item + first_page + fixture_file_upload + flash + follow_redirect + follow_redirect! + foreign_key + form + form_for + form_remote_for + form_remote_tag + form_tag + format_log_entry + formatted_offset + formatted_post? + fortnight + fortnights + fragment_cache_key + fragment_cache_store= + freeze + from + from_now + frozen? + full_messages + full_set + get + get? + get_via_redirect + gigabyte + gigabytes + has_and_belongs_to_many + has_attribute? + has_many + has_one + has_page_number? + has_web_service? + hash + hash_cache + head? + helper + helper_attr + helper_method + hidden_actions + hidden_field + hidden_field_tag + hide + hide_action + higher_item + highlight + host + host! + host_with_port + hour + hours + html_document + https! + https? + human_name + human_size + humanize + id + id= + image_path + image_submit_tag + image_tag + in + in_list? + in_place_edit_for + in_place_editor + in_place_editor_field + included + increment + increment! + increment_counter + increment_position + indexes + indexes + inflections + inheritance_column + init + initialize_schema_information + input + insert + insert_at + insert_fixtures + insert_html + instantiate + instantiate_all_loaded_fixtures + instantiate_fixtures + instruct! + interpolate_sql + invalid? + irregular + javascript_include_tag + javascript_path + javascript_tag + join_associations + join_base + keep + key? + kilobyte + klass + last + last? + last_item + last_month + last_page + last_year + layout + length + length + link_image_to + link_to + link_to_function + link_to_if + link_to_image + link_to_remote + link_to_unless + link_to_unless_current + local_request? + log + log_error + log_info + lower_item + macro + mail_to + markdown + maximum + megabyte + megabytes + member + merge + message + method + method_missing + method_option_to_s + midnight + migrate + minimum + minute + minutes + monday + month + months + months_ago + months_since + move_higher + move_lower + move_to_bottom + move_to_top + multiple_of? + name + native_database_types + new + new_record? + next + next_month + next_sequence_value + next_sequence_value + next_week + next_year + now + now + number? + number_to_currency + number_to_human_size + number_to_percentage + number_to_phone + number_with_delimiter + number_with_precision + observe + observe_field + observe_form + observers= + odd? + of_caller + offset + on + on_base + open_session + option_groups_from_collection_for_select + options + options_for_ajax + options_for_javascript + options_for_select + options_from_collection_for_select + ordinalize + ordinalize + original_insert_fixtures + padding= + page_count + pages + paginate + paginate + pagination_links + pagination_links_each + param_names + parameters + password_field + password_field_tag + path + path_parameters + path_parameters= + perform_invocation + perform_invocation + periodically_call_remote + petabyte + petabytes + ping + pk_and_sequence_for + plural + pluralize + pluralize + pluralize + pluralize + port + port_string + post + post? + post_format + post_via_redirect + prefetch_primary_key? + prepend_after_filter + prepend_after_invocation + prepend_around_filter + prepend_before_filter + prepend_before_invocation + previous + primary_key + primary_key + process + process + process_cgi + process_test + process_with_test + protocol + public_name + put? + quote + quote_column_name + quote_string + quoted_date + quoted_false + quoted_true + radio_button + radio_button_tag + raw_connection + raw_post + read_fragment + readonly? + receive + reconnect! + record_id + recreate_database + redirect? + redirect_to + redirect_to_url + reflect_on_aggregation + reflect_on_all_aggregations + reflect_on_association + reflections + register_javascript_include_default + register_template_handler + relative_url_root + reload + reloadable_classes + remote_form_for + remote_function + remote_ip + remove + remove_column + remove_connection + remove_default_constraint + remove_from_list + remove_index + rename_column + rename_table + render + render_component + render_component_as_string + render_to_string + replace + replace_html + request_uri + rescue_action + rescue_action_in_public + rescue_action_locally + reset + reset! + reset_column_information + reset_cycle + reset_pk_sequence! + reset_sequence! + reset_session + respond_to + respond_to? + reverse_merge + reverse_merge! + reverse_update + rollback_db_transaction + root + root + root? + sanitize + sanitize_sql + save + save! + save_with_validation + save_with_validation! + say + say_with_time + scaffold + second + seconds + seconds_since_midnight + select + select_all + select_date + select_datetime + select_day + select_hour + select_minute + select_month + select_one + select_one + select_one + select_second + select_tag + select_time + select_value + select_values + select_year + self_and_siblings + send_data + send_file + serialize + serialized_attributes + server_software + session + session_enabled? + session_options + session_store + session_store= + set_inheritance_column + set_locking_column + set_primary_key + set_sequence_name + set_table_name + show + siblings + silence + silence + simple_format + simplified_type + since + since + singular + singularize + size + skip_after_filter + skip_before_filter + soap_action + sortable + sortable_element + srvmsgCB + ssl? + standard_port + start_form_tag + starts_with? + string_to_binary + string_to_date + string_to_dummy_time + string_to_time + stringify_keys + stringify_keys! + strip_links + strip_tags + structure_dump + stylesheet_link_tag + stylesheet_path + subdomains + submit_tag + submit_to_remote + sum + supports_count_distinct? + supports_migrations? + suppress_messages + symbolize_keys + symbolize_keys! + symbolized_path_parameters + table_alias_for + table_alias_length + table_exists? + table_name + table_name_and_alias + table_structure + tableize + tables + tag + target! + terabyte + terabytes + text? + text_area + text_area_tag + text_field + text_field_tag + text_field_with_auto_complete + textilize + textilize_without_paragraph + time_ago_in_words + time_zone_options_for_select + time_zone_select + titlecase + titleize + to + to_a + to_date + to_formatted_s + to_options + to_options! + to_param + to_proc + to_s + to_s + to_sentence + to_sql + to_sql + to_time + to_xml + today + toggle + toggle! + tomorrow + transaction + truncate + type_cast + type_cast_code + unadjust + uncountable + underscore + unknown? + until + update + update_all + update_attribute + update_attribute_with_validation_skipping + update_attributes + update_element_function + update_page + update_page_tag + url_for + url_for + url_for + us_zones + use_drb? + uses_component_template_root + valid? + validate + validate_on_create + validate_on_update + validates_acceptance_of + validates_associated + validates_confirmation_of + validates_each + validates_exclusion_of + validates_format_of + validates_inclusion_of + validates_length_of + validates_numericality_of + validates_presence_of + validates_size_of + validates_uniqueness_of + value_to_boolean + values_at + verify + verify! + visual_effect + web_client_api + web_service + web_service_api + web_service_scaffold + week + weeks + window + with_exclusive_scope + with_routing + with_scope + word_wrap + write + write_fragment + xhr + xhr? + xml_http_request + xml_http_request? + xml_post? + yaml_post? + year + years + years_ago + years_since + yesterday + breakpoint_server + cache_classes + connection_adapters + controller_paths + database_configuration_file + frameworks + load_paths + log_level + log_path + logger + view_path + whiny_nils + plugin_paths + primary_key_prefix_type + table_name_prefix + table_name_suffix + colorize_logging + default_timezone + allow_concurrency + generate_read_methods + schema_format + view_controller_internals + assert_host + debug_routes + allow_concurrency + param_parsers + template_root + logger + ignore_missing_templates + cache_template_loading + cache_template_extensions + local_assigns_support_string_keys + debug_rjs + logger + server_settings + raise_delivery_errors + delivery_method + perform_deliveries + default_charset + default_content_type + default_mime_version + default_implicit_parts_order + ActionController::AbstractRequest + ActionController::Base + ActionController::Benchmarking::ClassMethods + ActionController::Caching + ActionController::Caching::Actions + ActionController::Caching::Fragments + ActionController::Caching::Pages + ActionController::Caching::Pages::ClassMethods + ActionController::Caching::Sweeping + ActionController::Components + ActionController::Components::ClassMethods + ActionController::Components::InstanceMethods + ActionController::Cookies + ActionController::Filters::ClassMethods + ActionController::Flash + ActionController::Flash::FlashHash + ActionController::Helpers::ClassMethods + ActionController::Integration::Session + ActionController::IntegrationTest + ActionController::Layout::ClassMethods + ActionController::Macros + ActionController::Macros::AutoComplete::ClassMethods + ActionController::Macros::InPlaceEditing::ClassMethods + ActionController::MimeResponds::InstanceMethods + ActionController::Pagination + ActionController::Pagination::ClassMethods + ActionController::Pagination::Paginator + ActionController::Pagination::Paginator::Page + ActionController::Pagination::Paginator::Window + ActionController::Rescue + ActionController::Scaffolding::ClassMethods + ActionController::SessionManagement::ClassMethods + ActionController::Streaming + ActionController::TestProcess + ActionController::TestUploadedFile + ActionController::Verification::ClassMethods + ActionMailer::Base + ActionView::Base + ActionView::Helpers::ActiveRecordHelper + ActionView::Helpers::AssetTagHelper + ActionView::Helpers::BenchmarkHelper + ActionView::Helpers::CacheHelper + ActionView::Helpers::CaptureHelper + ActionView::Helpers::DateHelper + ActionView::Helpers::DebugHelper + ActionView::Helpers::FormHelper + ActionView::Helpers::FormOptionsHelper + ActionView::Helpers::FormTagHelper + ActionView::Helpers::JavaScriptHelper + ActionView::Helpers::JavaScriptMacrosHelper + ActionView::Helpers::NumberHelper + ActionView::Helpers::PaginationHelper + ActionView::Helpers::PrototypeHelper + ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods + ActionView::Helpers::ScriptaculousHelper + ActionView::Helpers::TagHelper + ActionView::Helpers::TextHelper + ActionView::Helpers::UrlHelper + ActionView::Partials + ActionWebService::API::Method + ActionWebService::Base + ActionWebService::Client::Soap + ActionWebService::Client::XmlRpc + ActionWebService::Container::ActionController::ClassMethods + ActionWebService::Container::Delegated::ClassMethods + ActionWebService::Container::Direct::ClassMethods + ActionWebService::Invocation::ClassMethods + ActionWebService::Scaffolding::ClassMethods + ActionWebService::SignatureTypes + ActionWebService::Struct + ActiveRecord::Acts::List::ClassMethods + ActiveRecord::Acts::List::InstanceMethods + ActiveRecord::Acts::NestedSet::ClassMethods + ActiveRecord::Acts::NestedSet::InstanceMethods + ActiveRecord::Acts::Tree::ClassMethods + ActiveRecord::Acts::Tree::InstanceMethods + ActiveRecord::Aggregations::ClassMethods + ActiveRecord::Associations::ClassMethods + ActiveRecord::Associations::ClassMethods::JoinDependency + ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation + ActiveRecord::Associations::ClassMethods::JoinDependency::JoinBase + ActiveRecord::Base + ActiveRecord::Calculations::ClassMethods + ActiveRecord::Callbacks + ActiveRecord::ConnectionAdapters::AbstractAdapter + ActiveRecord::ConnectionAdapters::Column + ActiveRecord::ConnectionAdapters::DB2Adapter + ActiveRecord::ConnectionAdapters::DatabaseStatements + ActiveRecord::ConnectionAdapters::FirebirdAdapter + ActiveRecord::ConnectionAdapters::MysqlAdapter + ActiveRecord::ConnectionAdapters::OpenBaseAdapter + ActiveRecord::ConnectionAdapters::OracleAdapter + ActiveRecord::ConnectionAdapters::PostgreSQLAdapter + ActiveRecord::ConnectionAdapters::Quoting + ActiveRecord::ConnectionAdapters::SQLServerAdapter + ActiveRecord::ConnectionAdapters::SQLiteAdapter + ActiveRecord::ConnectionAdapters::SchemaStatements + ActiveRecord::ConnectionAdapters::SybaseAdapter::ColumnWithIdentity + ActiveRecord::ConnectionAdapters::SybaseAdapterContext + ActiveRecord::ConnectionAdapters::TableDefinition + ActiveRecord::Errors + ActiveRecord::HasManyThroughSourceAssociationMacroError + ActiveRecord::Locking + ActiveRecord::Migration + ActiveRecord::Observer + ActiveRecord::Observing::ClassMethods + ActiveRecord::Reflection::ClassMethods + ActiveRecord::Reflection::MacroReflection + ActiveRecord::Schema + ActiveRecord::Timestamp + ActiveRecord::Transactions::ClassMethods + ActiveRecord::Validations + ActiveRecord::Validations::ClassMethods + ActiveSupport::CachingTools::HashCaching + ActiveSupport::CoreExtensions::Array::Conversions + ActiveSupport::CoreExtensions::Date::Conversions + ActiveSupport::CoreExtensions::Hash::Conversions + ActiveSupport::CoreExtensions::Hash::Diff + ActiveSupport::CoreExtensions::Hash::Keys + ActiveSupport::CoreExtensions::Hash::ReverseMerge + ActiveSupport::CoreExtensions::Integer::EvenOdd + ActiveSupport::CoreExtensions::Integer::Inflections + ActiveSupport::CoreExtensions::Numeric::Bytes + ActiveSupport::CoreExtensions::Numeric::Time + ActiveSupport::CoreExtensions::Pathname::CleanWithin + ActiveSupport::CoreExtensions::Range::Conversions + ActiveSupport::CoreExtensions::String::Access + ActiveSupport::CoreExtensions::String::Conversions + ActiveSupport::CoreExtensions::String::Inflections + ActiveSupport::CoreExtensions::String::Iterators + ActiveSupport::CoreExtensions::String::StartsEndsWith + ActiveSupport::CoreExtensions::Time::Calculations + ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods + ActiveSupport::CoreExtensions::Time::Conversions + Binding + Breakpoint + Builder::XmlMarkup + Dependencies::LoadingModule + Fixtures + HashWithIndifferentAccess + Inflector + Inflector::Inflections + Mime + OCI8AutoRecover + Reloadable + Reloadable::Subclasses + Symbol + Test::Unit::Assertions + TimeZone + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ruby.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ruby.plist new file mode 100644 index 00000000..12fd437f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/ruby.plist @@ -0,0 +1,1075 @@ + + + + + beginCommand + + endCommand + + beginInstruction + { + endInstruction + } + beginVariable + $@ + endVariable + . + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*def.* + removeFromFunction + def + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + BEGIN + END + and + begin + break + case + catch + defined? + do + else + elsif + end + ensure + for + if + in + include + next + not + or + private + protected + public + redo + require + rescue + retry + return + then + throw + unless + until + when + while + yield + attr + attr_reader + attr_writer + attr_accessor + alias + module + class + def + undef + self + super + nil + false + true + __FILE__ + __LINE__ + + autocompleteWords + + accepts + activate_drb + active? + acts_as_list + acts_as_nested_set + acts_as_tree + adapter_name + add + add_child + add_column + add_index + add_limit! + add_limit_offset! + add_on_blank + add_on_boundary_breaking + add_on_boundry_breaking + add_on_empty + add_to_base + adjust + advance + after_create + after_destroy + after_filter + after_invocation + after_save + after_update + after_validation + after_validation_on_create + after_validation_on_update + ago + alert + aliased_prefix + aliased_primary_key + aliased_table_name + aliased_table_names_for + all + all_children + allow_identity_inserts + ancestors + announce + append_after_filter + append_after_invocation + append_around_filter + append_before_filter + append_before_invocation + append_features + around_filter + array_or_string_for_javascript + assert + assert + assert_dom_equal + assert_dom_not_equal + assert_generates + assert_no_tag + assert_recognizes + assert_redirected_to + assert_response + assert_routing + assert_tag + assert_template + assert_valid + assert_valid_keys + assign + assigns + association_join + at + at_beginning_of_day + at_beginning_of_month + at_beginning_of_quarter + at_beginning_of_week + at_beginning_of_year + at_end_of_month + at_midnight + attr_accessible + attr_protected + attribute_names + attribute_present? + attributes + attributes= + attributes_before_type_cast + attributes_with_quotes_pre_oracle + auto_complete_field + auto_complete_for + auto_complete_result + auto_discovery_link_tag + auto_link + average + base_class + before_create + before_destroy + before_destroy + before_filter + before_invocation + before_save + before_update + before_validation + before_validation_on_create + before_validation_on_update + begin_db_transaction + beginning_of_day + beginning_of_month + beginning_of_quarter + beginning_of_week + beginning_of_year + belongs_to + benchmark + binary_to_string + breakpoint + build + build_callbacks + build_observer + build_request_uri + button_to + button_to_function + byte + bytes + cache + cache_erb_fragment + cache_page + caches_page + calculate + call + camelcase + camelize + capture + cast_expects + cast_returns + catch_schema_changes + cdata! + cdata_section + change + change_column + change_column_default + check_box + check_box_tag + child? + children_count + class_name + class_of_active_record_descendant + classify + classify + clean_backtrace + clean_within + clear + clear_active_connections! + clone + cltmsgCB + collection_select + column + column_for_attribute + column_names + column_names_with_alias + columns + columns_hash + comment! + commit_db_transaction + composed_of + compute_type + concat + condition_block? + connected? + connection + connection= + constantize + construct + construct_association + content_columns + content_for + content_tag + content_type + controller_class_name + controller_name + controller_path + convert_key + convert_value + cookie + cookies + cookies + count + count_by_sql + count_collection_for_pagination + country_options_for_select + country_select + create + create! + create_database + create_fixtures + create_reflection + create_table + current + current_database + current_page + current_page= + current_page? + cycle + dasherize + dasherize + date_select + datetime_select + day + days + days_in_month + deactivate_drb + deadlocked? + debug + declare! + decrement + decrement! + decrement_counter + decrement_position + default + default_sequence_name + default_url_options + define + define_javascript_functions + delay + delete + delete? + delete_all + delete_existing_fixtures + deliver + deliver! + demodulize + destroy + destroy + destroy_all + diff + direct_children + discard + disconnect! + distance_of_time_in_words + distance_of_time_in_words_to_now + domain + draggable + draggable_element + drop_database + drop_receiving + drop_receiving_element + drop_table + dup + each + each_char + each_full + each_pair + empty? + end_form_tag + end_of_month + ends_with? + eql? + error_message_on + error_messages_for + errors + escape_javascript + establish_connection + evaluate_condition + evaluate_remote_response + even? + exabyte + exabytes + excerpt + exec + execute + exists? + expects_index_of + expects_to_hash + expire_action + expire_fragment + expire_page + expires_in + expires_now + extract_record + failed? + fetch + fields_for + file_field + file_field_tag + find + find_all_tag + find_by_sql + find_collection_for_pagination + find_tag + first + first? + first_item + first_page + fixture_file_upload + flash + follow_redirect + follow_redirect! + foreign_key + form + form_for + form_remote_for + form_remote_tag + form_tag + format_log_entry + formatted_offset + formatted_post? + fortnight + fortnights + fragment_cache_key + fragment_cache_store= + freeze + from + from_now + frozen? + full_messages + full_set + get + get? + get_via_redirect + gigabyte + gigabytes + has_and_belongs_to_many + has_attribute? + has_many + has_one + has_page_number? + has_web_service? + hash + hash_cache + head? + helper + helper_attr + helper_method + hidden_actions + hidden_field + hidden_field_tag + hide + hide_action + higher_item + highlight + host + host! + host_with_port + hour + hours + html_document + https! + https? + human_name + human_size + humanize + id + id= + image_path + image_submit_tag + image_tag + in + in_list? + in_place_edit_for + in_place_editor + in_place_editor_field + included + increment + increment! + increment_counter + increment_position + indexes + indexes + inflections + inheritance_column + init + initialize_schema_information + input + insert + insert_at + insert_fixtures + insert_html + instantiate + instantiate_all_loaded_fixtures + instantiate_fixtures + instruct! + interpolate_sql + invalid? + irregular + javascript_include_tag + javascript_path + javascript_tag + join_associations + join_base + keep + key? + kilobyte + klass + last + last? + last_item + last_month + last_page + last_year + layout + length + length + link_image_to + link_to + link_to_function + link_to_if + link_to_image + link_to_remote + link_to_unless + link_to_unless_current + local_request? + log + log_error + log_info + lower_item + macro + mail_to + markdown + maximum + megabyte + megabytes + member + merge + message + method + method_missing + method_option_to_s + midnight + migrate + minimum + minute + minutes + monday + month + months + months_ago + months_since + move_higher + move_lower + move_to_bottom + move_to_top + multiple_of? + name + native_database_types + new + new_record? + next + next_month + next_sequence_value + next_sequence_value + next_week + next_year + now + now + number? + number_to_currency + number_to_human_size + number_to_percentage + number_to_phone + number_with_delimiter + number_with_precision + observe + observe_field + observe_form + observers= + odd? + of_caller + offset + on + on_base + open_session + option_groups_from_collection_for_select + options + options_for_ajax + options_for_javascript + options_for_select + options_from_collection_for_select + ordinalize + ordinalize + original_insert_fixtures + padding= + page_count + pages + paginate + paginate + pagination_links + pagination_links_each + param_names + parameters + password_field + password_field_tag + path + path_parameters + path_parameters= + perform_invocation + perform_invocation + periodically_call_remote + petabyte + petabytes + ping + pk_and_sequence_for + plural + pluralize + pluralize + pluralize + pluralize + port + port_string + post + post? + post_format + post_via_redirect + prefetch_primary_key? + prepend_after_filter + prepend_after_invocation + prepend_around_filter + prepend_before_filter + prepend_before_invocation + previous + primary_key + primary_key + process + process + process_cgi + process_test + process_with_test + protocol + public_name + put? + quote + quote_column_name + quote_string + quoted_date + quoted_false + quoted_true + radio_button + radio_button_tag + raw_connection + raw_post + read_fragment + readonly? + receive + reconnect! + record_id + recreate_database + redirect? + redirect_to + redirect_to_url + reflect_on_aggregation + reflect_on_all_aggregations + reflect_on_association + reflections + register_javascript_include_default + register_template_handler + relative_url_root + reload + reloadable_classes + remote_form_for + remote_function + remote_ip + remove + remove_column + remove_connection + remove_default_constraint + remove_from_list + remove_index + rename_column + rename_table + render + render_component + render_component_as_string + render_to_string + replace + replace_html + request_uri + rescue_action + rescue_action_in_public + rescue_action_locally + reset + reset! + reset_column_information + reset_cycle + reset_pk_sequence! + reset_sequence! + reset_session + respond_to + respond_to? + reverse_merge + reverse_merge! + reverse_update + rollback_db_transaction + root + root + root? + sanitize + sanitize_sql + save + save! + save_with_validation + save_with_validation! + say + say_with_time + scaffold + second + seconds + seconds_since_midnight + select + select_all + select_date + select_datetime + select_day + select_hour + select_minute + select_month + select_one + select_one + select_one + select_second + select_tag + select_time + select_value + select_values + select_year + self_and_siblings + send_data + send_file + serialize + serialized_attributes + server_software + session + session_enabled? + session_options + session_store + session_store= + set_inheritance_column + set_locking_column + set_primary_key + set_sequence_name + set_table_name + show + siblings + silence + silence + simple_format + simplified_type + since + since + singular + singularize + size + skip_after_filter + skip_before_filter + soap_action + sortable + sortable_element + srvmsgCB + ssl? + standard_port + start_form_tag + starts_with? + string_to_binary + string_to_date + string_to_dummy_time + string_to_time + stringify_keys + stringify_keys! + strip_links + strip_tags + structure_dump + stylesheet_link_tag + stylesheet_path + subdomains + submit_tag + submit_to_remote + sum + supports_count_distinct? + supports_migrations? + suppress_messages + symbolize_keys + symbolize_keys! + symbolized_path_parameters + table_alias_for + table_alias_length + table_exists? + table_name + table_name_and_alias + table_structure + tableize + tables + tag + target! + terabyte + terabytes + text? + text_area + text_area_tag + text_field + text_field_tag + text_field_with_auto_complete + textilize + textilize_without_paragraph + time_ago_in_words + time_zone_options_for_select + time_zone_select + titlecase + titleize + to + to_a + to_date + to_formatted_s + to_options + to_options! + to_param + to_proc + to_s + to_s + to_sentence + to_sql + to_sql + to_time + to_xml + today + toggle + toggle! + tomorrow + transaction + truncate + type_cast + type_cast_code + unadjust + uncountable + underscore + unknown? + until + update + update_all + update_attribute + update_attribute_with_validation_skipping + update_attributes + update_element_function + update_page + update_page_tag + url_for + url_for + url_for + us_zones + use_drb? + uses_component_template_root + valid? + validate + validate_on_create + validate_on_update + validates_acceptance_of + validates_associated + validates_confirmation_of + validates_each + validates_exclusion_of + validates_format_of + validates_inclusion_of + validates_length_of + validates_numericality_of + validates_presence_of + validates_size_of + validates_uniqueness_of + value_to_boolean + values_at + verify + verify! + visual_effect + web_client_api + web_service + web_service_api + web_service_scaffold + week + weeks + window + with_exclusive_scope + with_routing + with_scope + word_wrap + write + write_fragment + xhr + xhr? + xml_http_request + xml_http_request? + xml_post? + yaml_post? + year + years + years_ago + years_since + yesterday + breakpoint_server + cache_classes + connection_adapters + controller_paths + database_configuration_file + frameworks + load_paths + log_level + log_path + logger + view_path + whiny_nils + plugin_paths + primary_key_prefix_type + table_name_prefix + table_name_suffix + colorize_logging + default_timezone + allow_concurrency + generate_read_methods + schema_format + view_controller_internals + assert_host + debug_routes + allow_concurrency + param_parsers + template_root + logger + ignore_missing_templates + cache_template_loading + cache_template_extensions + local_assigns_support_string_keys + debug_rjs + logger + server_settings + raise_delivery_errors + delivery_method + perform_deliveries + default_charset + default_content_type + default_mime_version + default_implicit_parts_order + ActionController::AbstractRequest + ActionController::Base + ActionController::Benchmarking::ClassMethods + ActionController::Caching + ActionController::Caching::Actions + ActionController::Caching::Fragments + ActionController::Caching::Pages + ActionController::Caching::Pages::ClassMethods + ActionController::Caching::Sweeping + ActionController::Components + ActionController::Components::ClassMethods + ActionController::Components::InstanceMethods + ActionController::Cookies + ActionController::Filters::ClassMethods + ActionController::Flash + ActionController::Flash::FlashHash + ActionController::Helpers::ClassMethods + ActionController::Integration::Session + ActionController::IntegrationTest + ActionController::Layout::ClassMethods + ActionController::Macros + ActionController::Macros::AutoComplete::ClassMethods + ActionController::Macros::InPlaceEditing::ClassMethods + ActionController::MimeResponds::InstanceMethods + ActionController::Pagination + ActionController::Pagination::ClassMethods + ActionController::Pagination::Paginator + ActionController::Pagination::Paginator::Page + ActionController::Pagination::Paginator::Window + ActionController::Rescue + ActionController::Scaffolding::ClassMethods + ActionController::SessionManagement::ClassMethods + ActionController::Streaming + ActionController::TestProcess + ActionController::TestUploadedFile + ActionController::Verification::ClassMethods + ActionMailer::Base + ActionView::Base + ActionView::Helpers::ActiveRecordHelper + ActionView::Helpers::AssetTagHelper + ActionView::Helpers::BenchmarkHelper + ActionView::Helpers::CacheHelper + ActionView::Helpers::CaptureHelper + ActionView::Helpers::DateHelper + ActionView::Helpers::DebugHelper + ActionView::Helpers::FormHelper + ActionView::Helpers::FormOptionsHelper + ActionView::Helpers::FormTagHelper + ActionView::Helpers::JavaScriptHelper + ActionView::Helpers::JavaScriptMacrosHelper + ActionView::Helpers::NumberHelper + ActionView::Helpers::PaginationHelper + ActionView::Helpers::PrototypeHelper + ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods + ActionView::Helpers::ScriptaculousHelper + ActionView::Helpers::TagHelper + ActionView::Helpers::TextHelper + ActionView::Helpers::UrlHelper + ActionView::Partials + ActionWebService::API::Method + ActionWebService::Base + ActionWebService::Client::Soap + ActionWebService::Client::XmlRpc + ActionWebService::Container::ActionController::ClassMethods + ActionWebService::Container::Delegated::ClassMethods + ActionWebService::Container::Direct::ClassMethods + ActionWebService::Invocation::ClassMethods + ActionWebService::Scaffolding::ClassMethods + ActionWebService::SignatureTypes + ActionWebService::Struct + ActiveRecord::Acts::List::ClassMethods + ActiveRecord::Acts::List::InstanceMethods + ActiveRecord::Acts::NestedSet::ClassMethods + ActiveRecord::Acts::NestedSet::InstanceMethods + ActiveRecord::Acts::Tree::ClassMethods + ActiveRecord::Acts::Tree::InstanceMethods + ActiveRecord::Aggregations::ClassMethods + ActiveRecord::Associations::ClassMethods + ActiveRecord::Associations::ClassMethods::JoinDependency + ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation + ActiveRecord::Associations::ClassMethods::JoinDependency::JoinBase + ActiveRecord::Base + ActiveRecord::Calculations::ClassMethods + ActiveRecord::Callbacks + ActiveRecord::ConnectionAdapters::AbstractAdapter + ActiveRecord::ConnectionAdapters::Column + ActiveRecord::ConnectionAdapters::DB2Adapter + ActiveRecord::ConnectionAdapters::DatabaseStatements + ActiveRecord::ConnectionAdapters::FirebirdAdapter + ActiveRecord::ConnectionAdapters::MysqlAdapter + ActiveRecord::ConnectionAdapters::OpenBaseAdapter + ActiveRecord::ConnectionAdapters::OracleAdapter + ActiveRecord::ConnectionAdapters::PostgreSQLAdapter + ActiveRecord::ConnectionAdapters::Quoting + ActiveRecord::ConnectionAdapters::SQLServerAdapter + ActiveRecord::ConnectionAdapters::SQLiteAdapter + ActiveRecord::ConnectionAdapters::SchemaStatements + ActiveRecord::ConnectionAdapters::SybaseAdapter::ColumnWithIdentity + ActiveRecord::ConnectionAdapters::SybaseAdapterContext + ActiveRecord::ConnectionAdapters::TableDefinition + ActiveRecord::Errors + ActiveRecord::HasManyThroughSourceAssociationMacroError + ActiveRecord::Locking + ActiveRecord::Migration + ActiveRecord::Observer + ActiveRecord::Observing::ClassMethods + ActiveRecord::Reflection::ClassMethods + ActiveRecord::Reflection::MacroReflection + ActiveRecord::Schema + ActiveRecord::Timestamp + ActiveRecord::Transactions::ClassMethods + ActiveRecord::Validations + ActiveRecord::Validations::ClassMethods + ActiveSupport::CachingTools::HashCaching + ActiveSupport::CoreExtensions::Array::Conversions + ActiveSupport::CoreExtensions::Date::Conversions + ActiveSupport::CoreExtensions::Hash::Conversions + ActiveSupport::CoreExtensions::Hash::Diff + ActiveSupport::CoreExtensions::Hash::Keys + ActiveSupport::CoreExtensions::Hash::ReverseMerge + ActiveSupport::CoreExtensions::Integer::EvenOdd + ActiveSupport::CoreExtensions::Integer::Inflections + ActiveSupport::CoreExtensions::Numeric::Bytes + ActiveSupport::CoreExtensions::Numeric::Time + ActiveSupport::CoreExtensions::Pathname::CleanWithin + ActiveSupport::CoreExtensions::Range::Conversions + ActiveSupport::CoreExtensions::String::Access + ActiveSupport::CoreExtensions::String::Conversions + ActiveSupport::CoreExtensions::String::Inflections + ActiveSupport::CoreExtensions::String::Iterators + ActiveSupport::CoreExtensions::String::StartsEndsWith + ActiveSupport::CoreExtensions::Time::Calculations + ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods + ActiveSupport::CoreExtensions::Time::Conversions + Binding + Breakpoint + Builder::XmlMarkup + Dependencies::LoadingModule + Fixtures + HashWithIndifferentAccess + Inflector + Inflector::Inflections + Mime + OCI8AutoRecover + Reloadable + Reloadable::Subclasses + Symbol + Test::Unit::Assertions + TimeZone + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/scala.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/scala.plist new file mode 100644 index 00000000..105b72f2 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/scala.plist @@ -0,0 +1,86 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + def + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abstract + case + catch + class + def + do + else + extends + false + final + finally + for + if + implicit + import + match + new + null + object + override + package + private + protected + requires + return + sealed + super + this + throw + trait + try + true + type + val + var + while + with + yield + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sgml.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sgml.plist new file mode 100644 index 00000000..026ce277 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sgml.plist @@ -0,0 +1,48 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + <!-- + endFirstMultiLineComment + --> + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/shell.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/shell.plist new file mode 100644 index 00000000..18cd9556 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/shell.plist @@ -0,0 +1,64 @@ + + + + + beginCommand + ` + endCommand + ´ + beginInstruction + + endInstruction + + beginVariable + $ + endVariable + (){}=;:[] + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*(function)?\s?\w*(\(\))?\s?\n?\s*\{ + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + then + elif + else + fi + case + in + ;; + esac + while + for + do + done + continue + local + return + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sml.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sml.plist new file mode 100644 index 00000000..0cbb029f --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sml.plist @@ -0,0 +1,105 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + (* + endFirstMultiLineComment + *) + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + abstype + and + andalso + as + case + do + datatype + else + end + eqtype + exception + false + fn + fun + functor + handle + if + in + include + infix + infixr + let + local + nonfix + of + op + open + orelse + raise + rec + sharing + sig + signature + struct + structure + then + true + type + val + where + with + withtype + while + unit + int + real + char + string + substring + word + ref + array + vector + bool + list + option + order + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sql.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sql.plist new file mode 100644 index 00000000..e006056d --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/sql.plist @@ -0,0 +1,843 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + -- + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + ACCESS + ACCOUNT + ADD + ADMIN + ADMINISTER + ADVISE + AFTER + AGENT + ALL + ALL_ROWS + ALLOCATE + ALTER + ANALYZE + ANCILLARY + AND + ANY + ARCHIVE + ARCHIVELOG + AS + ASC + ASSOCIATE + AT + ATTRIBUTE + ATTRIBUTES + AUDIT + AUTHENTICATED + AUTHID + AUTHORIZATION + AUTOALLOCATE + AUTOEXTEND + AUTOMATIC + BACKUP + BECOME + BEFORE + BEGIN + BEHALF + BETWEEN + BINDING + BITMAP + BLOCK + BLOCK_RANGE + BODY + BOUND + BOTH + BREAK + BROADCAST + BTITLE + BUFFER_POOL + BUILD + BULK + BY + CACHE + CACHE_INSTANCES + CALL + CANCEL + CASCADE + CASE + CATEGORY + CHAINED + CHANGE + CHECK + CHECKPOINT + CHILD + CHOOSE + CHUNK + CLASS + CLEAR + CLONE + CLOSE + CLOSE_CACHED_OPEN_CURSORS + CLUSTER + COALESCE + COLLATE + COLUMN + COLUMNS + COLUMN_VALUE + COMMENT + COMMIT + COMMITTED + COMPATIBILITY + COMPILE + COMPLETE + COMPOSITE_LIMIT + COMPRESS + COMPUTE + CONNECT + CONNECT_TIME + CONSIDER + CONSISTENT + CONSTANT + CONSTRAINT + CONSTRAINTS + CONTAINER + CONTENTS + CONTEXT + CONTINUE + CONTROLFILE + COPY + COST + CPU_PER_CALL + CPU_PER_SESSION + CREATE + CREATE_STORED_OUTLINES + CROSS + CUBE + CURRENT + CURSOR + CYCLE + DANGLING + DATA + DATABASE + DATAFILE + DATAFILES + DAY + DBA + DDL + DEALLOCATE + DEBUG + DECLARE + DEFAULT + DEFERRABLE + DEFERRED + DEFINER + DEGREE + DELETE + DEMAND + DESC + DETERMINES + DICTIONARY + DIMENSION + DIRECTORY + DISABLE + DISASSOCIATE + DISCONNECT + DISMOUNT + DISTINCT + DISTRIBUTED + DROP + DYNAMIC + EACH + ELSE + ENABLE + END + ENFORCE + ENTRY + ESCAPE + ESTIMATE + EVENTS + EXCEPT + EXCEPTION + EXCEPTIONS + EXCHANGE + EXCLUDING + EXCLUSIVE + EXEC + EXECUTE + EXISTS + EXPIRE + EXPLAIN + EXPLOSION + EXTENDS + EXTENT + EXTENTS + EXTERNALLY + FAILED_LOGIN_ATTEMPTS + FALSE + FAST + FILE + FILTER + FIRST_ROWS + FLAGGER + FLUSH + FOLLOWING + FOR + FORCE + FOREIGN + FREELIST + FREELISTS + FRESH + FROM + FULL + FUNCTION + FUNCTIONS + GENERATED + GLOBAL + GLOBALLY + GLOBAL_NAME + GRANT + GROUP + GROUPS + HASH + HASHKEYS + HAVING + HEADER + HEAP + HIERARCHY + HOUR + ID + IDENTIFIED + IDENTIFIER + IDGENERATORS + IDLE_TIME + IF + IMMEDIATE + IN + INCLUDING + INCREMENT + INCREMENTAL + INDEX + INDEXED + INDEXES + INDEXTYPE + INDEXTYPES + INDICATOR + INITIAL + INITIALIZED + INITIALLY + INITRANS + INNER + INSERT + INSTANCE + INSTANCES + INSTEAD + INTERMEDIATE + INTERSECT + INTERVAL + INTO + INVALIDATE + IS + ISOLATION + ISOLATION_LEVEL + JAVA + JOIN + KEEP + KEY + KILL + LABEL + LAYER + LEADING + LEFT + LESS + LEVEL + LIBRARY + LIKE + LIMIT + LINK + LIST + LOCAL + LOCATOR + LOCK + LOCKED + LOGFILE + LOGGING + LOGICAL_READS_PER_CALL + LOGICAL_READS_PER_SESSION + LOGOFF + LOGON + MANAGE + MANAGED + MANAGEMENT + MASTER + MATERIALIZED + MAXARCHLOGS + MAXDATAFILES + MAXEXTENTS + MAXINSTANCES + MAXLOGFILES + MAXLOGHISTORY + MAXLOGMEMBERS + MAXSIZE + MAXTRANS + MAXVALUE + METHOD + MEMBER + MERGE + MINIMIZE + MINIMUM + MINEXTENTS + MINUS + MINUTE + MINVALUE + MODE + MODIFY + MONITORING + MONTH + MOUNT + MOVE + MOVEMENT + MTS_DISPATCHERS + MULTISET + NAMED + NATURAL + NEEDED + NESTED + NESTED_TABLE_ID + NETWORK + NEVER + NEW + NEXT + NLS_CALENDAR + NLS_CHARACTERSET + NLS_COMP + NLS_CURRENCY + NLS_DATE_FORMAT + NLS_DATE_LANGUAGE + NLS_ISO_CURRENCY + NLS_LANG + NLS_LANGUAGE + NLS_NUMERIC_CHARACTERS + NLS_SORT + NLS_SPECIAL_CHARS + NLS_TERRITORY + NO + NOARCHIVELOG + NOAUDIT + NOCACHE + NOCOMPRESS + NOCYCLE + NOFORCE + NOLOGGING + NOMAXVALUE + NOMINIMIZE + NOMINVALUE + NOMONITORING + NONE + NOORDER + NOOVERRIDE + NOPARALLEL + NORELY + NORESETLOGS + NOREVERSE + NORMAL + NOSEGMENT + NOSORT + NOT + NOTHING + NOVALIDATE + NOWAIT + NULL + NULLS + OBJNO + OBJNO_REUSE + OF + OFF + OFFLINE + OID + OIDINDEX + OLD + ON + ONLINE + ONLY + OPCODE + OPEN + OPERATOR + OPTIMAL + OPTIMIZER_GOAL + OPTION + OR + ORDER + ORGANIZATION + OUT + OUTER + OUTLINE + OVER + OVERFLOW + OVERLAPS + OWN + PACKAGE + PACKAGES + PARALLEL + PARAMETERS + PARENT + PARTITION + PARTITIONS + PARTITION_HASH + PARTITION_RANGE + PASSWORD + PASSWORD_GRACE_TIME + PASSWORD_LIFE_TIME + PASSWORD_LOCK_TIME + PASSWORD_REUSE_MAX + PASSWORD_REUSE_TIME + PASSWORD_VERIFY_FUNCTION + PCTFREE + PCTINCREASE + PCTTHRESHOLD + PCTUSED + PCTVERSION + PERCENT + PERMANENT + PLAN + PLSQL_DEBUG + POST_TRANSACTION + PREBUILT + PRECEDING + PREPARE + PRESERVE + PRIMARY + PRIOR + PRIVATE + PRIVATE_SGA + PRIVILEGE + PRIVILEGES + PROCEDURE + PROFILE + PUBLIC + PURGE + QUERY + QUEUE + QUOTA + RANDOM + RANGE + RBA + READ + READS + REBUILD + RECORDS_PER_BLOCK + RECOVER + RECOVERABLE + RECOVERY + RECYCLE + REDUCED + REFERENCES + REFERENCING + REFRESH + RELY + RENAME + RESET + RESETLOGS + RESIZE + RESOLVE + RESOLVER + RESOURCE + RESTRICT + RESTRICTED + RESUME + RETURN + RETURNING + REUSE + REVERSE + REVOKE + REWRITE + RIGHT + ROLE + ROLES + ROLLBACK + ROLLUP + ROW + ROWNUM + ROWS + RULE + SAMPLE + SAVEPOINT + SCAN + SCAN_INSTANCES + SCHEMA + SCN + SCOPE + SD_ALL + SD_INHIBIT + SD_SHOW + SECOND + SEGMENT + SEG_BLOCK + SEG_FILE + SELECT + SELECTIVITY + SEQUENCE + SERIALIZABLE + SERVERERROR + SESSION + SESSION_CACHED_CURSORS + SESSIONS_PER_USER + SET + SHARE + SHARED + SHARED_POOL + SHRINK + SHUTDOWN + SINGLETASK + SIZE + SKIP + SKIP_UNUSABLE_INDEXES + SNAPSHOT + SOME + SORT + SOURCE + SPECIFICATION + SPLIT + SQL_TRACE + STANDBY + START + STARTUP + STATEMENT_ID + STATISTICS + STATIC + STOP + STORAGE + STORE + STRUCTURE + SUBPARTITION + SUBPARTITIONS + SUCCESSFUL + SUMMARY + SUSPEND + SWITCH + SYS_OP_BITVEC + SYS_OP_ENFORCE_NOT_NULL$ + SYS_OP_NOEXPAND + SYS_OP_NTCIMG$ + SYNONYM + SYSDBA + SYSOPER + SYSTEM + TABLE + TABLES + TABLESPACE + TABLESPACE_NO + TABNO + TEMPFILE + TEMPORARY + THAN + THE + THEN + THREAD + THROUGH + TIMEOUT + TIMEZONE_HOUR + TIMEZONE_MINUTE + TIME_ZONE + TO + TOPLEVEL + TRACE + TRACING + TRAILING + TRANSACTION + TRANSITIONAL + TRIGGER + TRIGGERS + TRUE + TRUNCATE + TYPE + TYPES + UNARCHIVED + UNBOUND + UNBOUNDED + UNDO + UNIFORM + UNION + UNIQUE + UNLIMITED + UNLOCK + UNRECOVERABLE + UNTIL + UNUSABLE + UNUSED + UPD_INDEXES + UPDATABLE + UPDATE + UPPPER + USAGE + USE + USE_STORED_OUTLINES + USER_DEFINED + USING + VALIDATE + VALIDATION + VALUES + VIEW + WHEN + WHENEVER + WHERE + WITH + WITHOUT + WORK + WRITE + YEAR + ZONE + ABS + ACOS + ADD_MONTHS + ASCII + ASCIISTR + ASIN + ATAN + ATAN2 + AVG + BFILENAME + BIN_TO_NUM + BITAND + CAST + CEIL + CHARTOROWID + CHR + COALESCE + COMPOSE + CONCAT + CONVERT + CORR + COS + COSH + COUNT + COVAR_POP + COVAR_SAMP + CUME_DIST + CURRENT_DATE + CURRENT_TIMESTAMP + DBTIMEZONE + DECODE + DECOMPOSE + DENSE_RANK + DEREF + DUMP + EMPTY_BLOB + EMPTY_CLOB + EXISTSNODE + EXP + EXTRACT + FIRST + FIRST_VALUE + FLOOR + FROM_TZ + GREATEST + GROUP_ID + GROUPING + GROUPING_ID + HEXTORAW + INITCAP + INSTR + INSTRB + LAG + LAST + LAST_DAY + LAST_VALUE + LEAD + LEAST + LENGTH + LENGTHB + LN + LOCALTIMESTAMP + LOG + LOWER + LPAD + LTRIM + MAKE_REF + MAX + MIN + MOD + MONTHS_BETWEEN + NCHR + NEW_TIME + NEXT_DAY + NLS_CHARSET_DECL_LEN + NLS_CHARSET_ID + NLS_CHARSET_NAME + NLS_INITCAP + NLS_LOWER + NLS_UPPER + NLSSORT + NTILE + NULLIF + NUMTODSINTERVAL + NUMTOYMINTERVAL + NVL + NVL2 + PERCENT_RANK + PERCENTILE_CONT + PERCENTILE_DISC + POWER + RANK + RATIO_TO_REPORT + RAWTOHEX + REF + REFTOHEX + REGR_SLOPE + REGR_INTERCEPT + REGR_COUNT + REGR_R2 + REGR_AVGX + REGR_AVGY + REGR_SXX + REGR_SYY + REGR_SXY + REPLACE + ROUND + ROW_NUMBER + ROWIDTOCHAR + ROWIDTONCHAR + RPAD + RTRIM + SESSIONTIMEZONE + SIGN + SIN + SINH + SOUNDEX + SUBSTR + SQRT + STDDEV + STDDEV_POP + STDDEV_SAMP + SUBSTR + SUBSTRB + SUM + SYS_CONNECT_BY_PATH + SYS_CONTEXT + SYS_DBURIGEN + SYS_EXTRACT_UTC + SYS_GUID + SYS_TYPEID + SYS_XMLAGG + SYS_XMLGEN + SYSDATE + SYSTIMESTAMP + TAN + TANH + TO_CHAR + TO_CLOB + TO_DATE + TO_DSINTERVAL + TO_LOB + TO_MULTI_BYTE + TO_NCHAR + TO_NCLOB + TO_NUMBER + TO_SINGLE_BYTE + TO_TIMESTAMP + TO_TIMESTAMP_TZ + TO_YMINTERVAL + TRANSLATE + TREAT + TRIM + TRUNC + TZ_OFFSET + UID + UNISTR + UPPER + USER + USERENV + VALUE + VAR_POP + VAR_SAMP + VARIANCE + VSIZE + WIDTH_BUCKET + ANYDATA + ANYDATASET + ANYTYPE + ARRAY + BFILE + BINARY_INTEGER + BLOB + BOOLEAN + CFILE + CHAR + CHARACTER + CLOB + DATE + DBURITYPE + DEC + DECIMAL + DOUBLE + FLOAT + FLOB + HTTPURITYPE + INT + INTEGER + LOB + LONG + MLSLABEL + NATIONAL + NCHAR + NCLOB + NUMBER + NUMERIC + NVARCHAR + NVARCHAR2 + OBJECT + PLS_INTEGER + PRECISION + RAW + RECORD + REAL + ROWID + SINGLE + SMALLINT + TIMESTAMP + TIME + URIFACTORYTYPE + URITYPE + UROWID + VARCHAR + VARCHAR2 + VARYING + VARRAY + XMLTYPE + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/standard.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/standard.plist new file mode 100644 index 00000000..780d96c3 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/standard.plist @@ -0,0 +1,48 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + allowSyntaxColouring + + keywords + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/stata.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/stata.plist new file mode 100644 index 00000000..c40407bd --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/stata.plist @@ -0,0 +1,2945 @@ + + + + + beginCommand + ` + endCommand + ' + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + * + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + adgakern + bhatmesd + bcvwarpw + bcloglog + autosmoo + atkinson + asurvcrv + asserteq + altitude + adgaker2 + xriqtest + xri_slll + xri_pnll + xri_mpll + xri_mell + xri_enll + xi_mkun2 + warpstep + warpdens + warpdenm + venndiag + varxplor + urnmodel + unlabeld + unitroot + unilogit + trpoislf + trimblnk + trigamma + svy_preg + svy_pars + svy_olog + svy_logt + stmfracp + stcoxtvc + stcoxplt + stb_qihh + stb_next + stb_list + stb_find + stb_dtl1 + stb_dtl0 + stb_dirs + st_rpool + splitstr + sm4253eh + sktestdc + similari + silvtest + scenario + rxrmkdta + rpoisson + roblowes + rfprobit + rfpr_ll1 + reshape2 + resample + replword + relsgini + regpred2 + ranksum2 + r_ltnrml + qsortidx + qa_drive + qa_dense + qa_clear + qa_begin + qa__exit + ptransdb + projdate + probpred + printlog + postclos + post_zap + poisson2 + plotrds2 + permband + parsoptp + parcoord + overlapi + npresent + notefile + nmissing + nlsm_rpt + nlsm_epu + namemnth + mypoislf + mx_model + multnorm + msurface + mpredict + mountain + mnthname + mkbilogn + mfracpol + metabias + mergedct + mdytodow + lrcotest + lorobwei + logistat + logiodds + logiodd2 + logdummy + lintrend + lastbday + labgraph + l2cvwarw + l2cvwarp + kornbrot + kerntriw + kerntria + kernquar + kerngaus + inflogit + ineqdeco + ineqdec0 + implogit + idatetof + iclassr2 + hreg2sls + hpfilter + hlmakfun + hlbivnor + heckpbtl + gwarpreg + grlexis2 + gpredict + glmlogis + gaussgen + ftoidate + friedman + frac_sel + frac_rep + frac_ord + forgraph + fitpower + firstocc + findsmpl + finddate + filldate + faketemp + extrname + extlogit + exercise + example5 + example4 + example3 + example2 + example1 + epoisson + dropoper + domdiver + diflogen + destring + defntion + datevars + date2obs + dagumfit + dagum_ll + cwhetero + cw_yesno + cw__find + cw__exer + cw__chap + cw__book + cpoisson + cosdetra + corrprob + conv2num + collfreq + colldiag + cnpoislf + centcalc + briertst + boxdetra + boxdetr2 + bhatplot + bcvwarp + bartcdf + anyproc + amemiya + aflogit + adjprop + adjmean + addnote + zippred + zinbreg + zinb_ll + z_rvrfy + z_rcopy + ystrday + xri_nll + xmerged + xi_mkun + xi_eicu + wsanova + wntestf + winshow + wcotest + warpreg + warpoly + warping + warpden + vserteq + varrank + varorth + varnull + varcond + var_key + var_get + unblock + trpois0 + trnbin0 + trigami + triatex + tidwell + testsum + testres + tauprob + tabrate + t_print + switchr + svy_reg + survtab + sumdist + sturng8 + sturng7 + sturng6 + sturng5 + sturng4 + sturng3 + sturng2 + sturng1 + stlexis + stfracp + stb_sys + stb_sel + stb_qih + stb_idx + stb_dtl + stb_clr + stb_cal + staalen + srecode + smtwice + slrplot + sktestd + sktest2 + simplex + setfwid + sampsiz + sampsi2 + sample2 + safetob + rxrsimu + rxrrisk + rxrmaxl + rxridge + rxrcrlq + running + rspread + rndpoix + rndivgx + rndgamx + rndbinx + rmttest + replstr + regpred + regmsng + regdiag + readtok + r_unfrm + r_lnrml + r_cnrml + qsturng + qa_text + qa_err2 + qa_ans2 + qa__zap + pwcorrs + pswdiff + predlog + prcompw + prcmp3x + prcmp2x + prcmp1x + prcmp0x + poverty + povdeco + post_fl + phtest2 + phtest1 + phscore + pearson + pattern + partres + parmest + overlap + outreg5 + omscore + ocrpred + ocratio + numdays + notedit + nlsm_mu + nlaphea + nicenum + nbinreg + nbin0lf + namedow + mx_marq + mwstati + movsumm + modltbl + mlcoint + ml_heck + mkquant + mixcase + metareg + metainf + metacum + mergein + mcompr3 + mcompr2 + mcompr1 + matrank + matrand + matorth + matnull + matnorm + matginv + matcond + mat2mac + lw_unit + lw_gfmt + ltablem + lspline + lrtest2 + loopdef + logsumm + logpred + logopen + logifit + lin_m6r + limport + lexport + lastday + labedit + kernsim + kernreg + kernepa + kerneld + kerncos + johnson + infilen + inequal + ineqfac + iclassr + hlclean + hhcount + hh_slct + heckpbt + gwrgrid + growthi + gr3save + gphsave + gologit + glcurve + genvsum + geivars + gamplot + fpgraph + fpderiv + fpcurve + fitline + fisheri + findobs + findlag + findbug + fcnplot + exprcmd + exchstr + eprobit + epiconf + ehcvsrc + dtainfo + dstndiz + downame + dispcon + discrim + digamma + days360 + datelab + cw_qnir + cw_more + cw__xeq + csunits + corcori + coranal + conhull + condraw + concord + compobs + compdta + clrscrn + chksumm + cenpois + cascade + bsmplot + browsew + bringin + boxcoxr + boxcoxg + bailey + atrgph + arpois + amstat + amoeba + alpha2 + adjksm + addtex + acplot + accrue + zipois + zip_ll + z_rplt + z_rcii + yrxlab + xrigls + xparse + xmerge + xi_eii + xi_eic + winset + vorder + violin + varset + univar + tvprob + tspred + tsmult + tsload + tryrej + tmerge + tgraph + textab + tester + t_text + t_menu + t_fval + t_fpar + t_form + t_drop + t_crcs + suprob + sttody + strepl + stegen + stcoxe + stb_ex + st_aux + spline + spbase + sp_adj + simula + simul2 + simple + robvar + robksm + rndwei + rndpoi + rndlgn + rndivg + rndgam + rndexp + rndchi + rndbin + ridder + report + ranova + ramsey + ralloc + r_nrml + r_chi2 + quandt + qdagum + qa_xeq + qa_err + qa_ask + qa_ans + pyears + prcomp + prcmp4 + prcmp3 + prcmp2 + prcmp1 + prcmp0 + ppunit + powell + poisml + poilog + plot3d + pgmhaz + pgm_ll + period + pdagum + pciest + outreg + omodel + obrien + numode + nonlin + nmatch + nlsm_s + nlsm_m + nlsm_h + nlsm_e + nbinlf + mx_mx1 + mv2snp + minlen + mhrate + memset + memchk + mcross + mcompp + matsum + matmin + matmax + manova + makfun + lstand + lpartr + lorenz + loglin + linest + lfitx2 + knnreg + jumble + jknife + hinflu + hidlin + hhcorr + header + hbolic + hansen + gumbel + growth + gr3use + gr3set + gphprt + genhwi + funnel + fpshow + fpplot + fisher + esarea + equipi + equimi + elapse + effmod + dyrate + dtdiff + digami + dickey + diablo + cw_use + cusumb + corcor + chplot + chkdup + censor + browse + brier2 + boxtid + bisect + biprob + bartq + bandw + anydx + akapm + z_rci + xriml + xi_ei + xfrac + tsreg + tsfit + today + tobin + tab2i + t_num + t_def + t2way + sttvc + stkap + stats + stage + spear + sortd + smrby + smfit + sm_ll + slice + savin + rndbb + regmv + reghv + r_exp + quasi + qsort + nwest + null2 + null1 + nptri + npt_s + nbgof + myols + mx_lf + mx_d1 + mx_d0 + monte + modti + mlfit + metap + metan + mcc3i + maxr2 + mateq + lwald + lotus + lnsim + lftbl + lexis + labbe + l1way + ktau2 + iptab + ifexp + hreg2 + hltex + hhtab + hhset + hh_is + grvar + gphwp + gphdt + genhw + galbr + fpgen + equip + equim + eqmat + ellip + dtadd + diest + crlad + confx + coll2 + coint + chkdp + byvar + brset + bound + binsm + besd + xtab + with + win2 + win1 + wgap + vbar + tabw + smri + s_no + rndt + rndf + repl + regh + redo + pbis + nptr + norm + nlsm + modt + modl + meta + loop + lead + ldev + keyb + jtoe + invt + gr3q + goll + gmci + glmr + glmp + genl + for3 + for2 + fig3 + fig2 + fig1 + expr + etoj + etab + dymh + dups + doit + defv + chow + brsq + breg + z_r + tci + stb + smr + seq + roc + r_t + qsm + psm + phi + pca + mca + lag + iqr + iov + hhi + gwr + gr3 + gr2 + gr1 + gof + gam + fpx + dif + cdf + bvs + br2 + biv + ac + a2 + tv + lw + fp + cw + bv + forvalues + xwindow + winhelp + program + foreach + window + progra + define + while + progr + whil + prog + forv + end + else + for + if + prcounts + prchange + mlogview + mlogtest + mlogplot + logclose + listcoef + _peunvec + prvalue + praccum + fitstat + _pepred + _pemarg + _pecats + _pebase + _peabbv + _pesum + _perhs + _peife + _pedum + xpost + prtab + prgen + brant + ts + histogram + select + variabl + t2title + t1title + shading + reverse + rescale + replace + r2title + r1title + percent + missing + l2title + l1title + fweight + density + b2title + b1title + yscale + ylabel + xscale + xlabel + vwidth + values + twoway + tlabel + saving + rscale + rlabel + normal + noaxis + margin + jitter + detail + define + border + ytick + xtick + using + ttick + title + rtick + label + clear + ylog + xlog + text + star + smcl + root + rlog + reps + rbox + note + noax + key4 + key3 + key2 + key1 + half + freq + dots + cell + _all + ylo + yla + xlo + xla + var + val + tla + row + rlo + rla + pie + pen + obs + gap + def + col + box + bor + bin + bar + alt + yt + ys + xt + xs + tt + ti + t2 + t1 + st + rt + rs + r2 + r1 + lo + l2 + l1 + hi + ba + b2 + b1 + t + p + o + m + g + d + b + stackreset + stackdepth + marksample + constraint + summarize + speekchk2 + speedchk1 + simulinit + showpoint + postclose + estimates + correlate + constrain + _xtrenorm + ztweib_5 + ztvary_5 + zttoct_5 + ztspli_5 + ztjoin_5 + ztfill_5 + ztereg_5 + ztbase_5 + zt_smp_5 + zt_sho_5 + zt_iss_5 + zt_hcd_5 + zinb_plf + zinb_llf + xtrere_p + xtreg_re + xtreg_ml + xtreg_fe + xtreg_be + xtrefe_p + xtps_ren + xtprobit + xtintreg + wilcoxon + weibul_p + weibu_sw + weib_lf0 + wdupdate + wdatetof + unabbrev + tutorial + tut_wait + tsreport + tokenize + tobit_sw + testparm + tempname + tempfile + tabulate + symmetry + swprobit + swologit + svytotal + svyreg_p + svyratio + svyprobt + svyoprob + svylogit + svylog_p + svyivreg + svyintrg + svy_head + svy_dreg + svy_disp + survcurv + summariz + stphtest + stphplot + st_subid + st_promo + st_issys + spline_x + spikeplt + spearman + snapspan + signtest + signrank + shewhart + sfrancia + seperate + separate + scobi_sw + regriv_p + regres_p + regre_p2 + quantile + probit_p + priorest + preserve + postfile + poisso_p + poiss_sw + poiss_lf + personal + outsheet + orthpoly + oprobitp + oprobi_p + oprob_sw + op_colnm + ologit_p + ologi_sw + nbreg_sw + nbreg_lf + nbreg_al + mvencode + mvdecode + mlvecsum + mlogit_p + mlmatsum + ml_searc + ml_repor + ml_rdgrd + ml_query + ml_model + ml_mlout + ml_hbhhh + ml_graph + ml_grad0 + ml_geqnr + ml_enrr0 + ml_enr0i + ml_egr0i + ml_eer0i + ml_edr0i + ml_edfr0 + ml_edfp0 + ml_ecr0i + ml_ebr0i + ml_ebhr0 + ml_ebhh0 + ml_ebh0q + ml_ebfr0 + ml_ebfg0 + ml_debug + ml_clear + ml_check + ml_bhhhs + mkspline + meqparse + md2debu_ + md1debu_ + matstrik + matcproc + lvr2plot + lpredict + logistic + logis_lf + lnorma_p + lnorm_sw + lnorm_lf + llogis_p + llogi_sw + linktest + leverage + ksmirnov + kdensity + kapmeier + kalarma1 + intrg_ll + hetpr_lf + heckprob + heckpr_p + heckp_lf + heckma_p + grmeanby + gr_print + gprobi_p + gphprint + gompertz + gomper_p + gompe_sw + gnbreg_p + gnbreg_5 + gnbre_lf + glogit_p + gettoken + genvmean + generate + gamma_sw + gamma_lf + ftowdate + fracpred + fracpoly + fracplot + frac_wgt + frac_mun + frac_dis + frac_ddp + frac_cox + frac_chk + frac_adj + frac_154 + fpredict + estimate + drawnorm + disp_res + describe + debugbuf + corrgram + correlat + contract + constrai + compress + collapse + collaps4 + codebook + cnreg_sw + clogl_sw + clogit_p + clogi_sw + checksum + bsampl_w + boxcox_p + bootsamp + bmemsize + biprobit + arima_dr + anovadef + acprplot + _wsrvcrv + _tx_mtr5 + _tx_mtr4 + _tx_mtr3 + _tx_mtr2 + _tx_mtr1 + _tutends + _tsheadr + _ts_peri + _ts_pars + _ts_meqn + _ts_gdat + _ts_flag + _ts_dsmp + _sw_lik2 + _subchar + _predict + _pred_se + _pred_me + _partset + _parsewt + _parsevl + _mfrmvec + _linemax + _ldrtest + _kalman1 + _jprxrpa + _jprglwz + _jprglld + _jprglil + _jprglfl + _jprglef + _jprfpxo + _jprfptp + _jprfpse + _jprfprp + _jprfpre + _jprfppp + _jprfpmm + _jprfplx + _jprfpin + _jprfpgn + _jprfpfp + _jprfpdx + _jprfpdt + _invlist + _grmiss2 + _grfirst + _gpctile + _gpctile + _gmedian + _gmdmean + _glmresd + _glmmapl + _glmmapf + _glmilnk + _gladder + _getrres + _fracwgt + _fracrep + _fracord + _fracmdp + _fracdis + _fracddp + _fraccox + _fracchk + _crczsku + _crcwsrv + _crcwsrv + _crcvarl + _crcunit + _crcunit + _crcunab + _crctmge + _crcswxx + _crcstep + _crcsrvc + _crcsrvc + _crcsrv2 + _crcslbl + _crcshdr + _crcrsfl + _crcrnfd + _crcplst + _crcphdr + _crcnuse + _crcnuse + _crcnms2 + _crcnlou + _crcmiss + _crcichi + _crcglil + _crcglil + _crcgldv + _crcexnt + _crcexnf + _crcexne + _crcexnd + _crcexnc + _crcexnb + _crcexna + _crcexn9 + _crcexn8 + _crcexn7 + _crcexn6 + _crcexn5 + _crcexn4 + _crcexn2 + _crcexn1 + _crceprs + _crcchkw + _crcchkt + _crcchi2 + _crcbygr + _crcbygr + _crcbcrt + _crcause + _crcacnt + _crcacnt + _crc4fld + _crc2use + _cr1invt + _cr1form + _cpmatnm + _callerr + _3dsvusr + _3drshow + _3drproj + _3dmkdta + _3ddflts + _3daxtbl + _3daxout + _3daxmin + ztsum_5 + ztset_5 + ztgen_5 + ztdes_5 + ztcox_5 + zt_is_5 + zt_hc_5 + zt_ct_5 + zip_plf + zip_llf + xwindow + xttrans + xttobit + xttest0 + xtrch_p + xtps_lf + xtps_fe + xtnbreg + xtnb_lf + xtnb_fe + xtlogit + xtint_p + xtgls_p + xtgee_p + xtcnt_p + xtbin_p + wntestq + wntestb + winexec + wilc_st + weibull + weib_lf + version + verinst + uniform + tut_chk + tsrevar + tokeniz + tobit_p + teststd + tempvar + tabulat + tabodds + tabdisp + sysmenu + symplot + swtobit + swoprbt + swlogit + swlogis + swcnreg + svytest + svyprop + svypois + svyolog + svymlog + svymean + svy_sub + svy_get + svy_est + survsum + summari + stsplit + streset + stcoxkm + stcox_p + st_smpl + st_show + st_note + sreturn + serrbar + sdtesti + scob_lf + safesum + rvpplot + rvfplot + runtest + restore + reshape + replace + renpfix + regress + ranksum + quietly + quadchk + qreg_sw + prtesti + printgr + predict + predict + prais_p + prais_e + pperron + poisson + poisgof + playsnd + pergram + pentium + outshee + outfile + oprobit + op_diff + op_comp + ologitp + old_ver + numlist + nptrend + noisily + nobreak + nlexp2a + newey_p + ml_plot + ml_init + ml_exde + ml_elfs + ml_elfi + ml_defd + ml_adjs + memsize + matname + markout + lsens_x + lookfor + loneway + logrank + loglogs + logit_p + lnskew0 + lnormal + llogist + kwallis + istdize + ipolate + invnorm + inspect + insheet + hprobit + hettest + hetprob + hetpr_p + helpchk + heckman + heck_d2 + hausman + hadimvo + greigen + gprobit + gomp_lf + glmpred + gladder + genrank + generat + gamma_p + ftodate + fracgen + frac_xo + frac_pv + frac_pq + frac_pp + frac_in + frac_dv + execute + estimat + ereg_sw + ereg_lf + dstdize + dprobit + dotplot + display + discard + dfuller + describ + datetof + ctst_st + cscript + cprplot + coxbase + correla + constra + confirm + compare + cloglog + clogitp + clog_lf + centile + capture + canon_p + c_local + bsample + bprobit + bitesti + bipr_lf + bipp_lf + bcskew0 + avplots + arima_p + arch_dr + adopath + _tx_rpl + _ttest2 + _ttest2 + _ttest1 + _ttest1 + _sw_ood + _sw_lik + _robust + _robksm + _rmcoll + _result + _repart + _pctile + _ksmwrk + _inlist + _gtrank + _gsrank + _grmiss + _grmean + _grlast + _grank2 + _gmdmed + _glmwgt + _glmrpt + _ggroup + _ggroup + _getrhs + _gcount + _fracxo + _fracxo + _fracpv + _fracpp + _fracpp + _fracin + _fracdv + _evlist + _diparm + _crcseq + _crcmeq + _crcmeq + _crcksm + _crcirr + _crcird + _crccip + _crcbin + _crcar1 + _bsqreg + _adjksm + __GEEUC + __GEERC + __GEEBT + _3dshad + _3dproj + _3dmnmx + ztir_5 + xwindo + xtrchh + xtpred + xtpois + xthaus + xtdata + xtcorr + xtclog + xt_tis + xt_iis + xchart + window + versio + update + typeof + ttesti + tsunab + tsfill + tokeni + testnl + tabula + tabdis + tab_or + sysdir + syntax + swweib + swqreg + swpois + swereg + svytab + svyset + svyreg + svydes + summar + subwin + stweib + stvary + sttoct + sttocc + strate + stjoin + stinit + stfill + stereg + stcurv + stbase + st_set + st_hcd + sretur + smooth + sktest + search + sdtest + scobit + scob_p + scalar + sampsi + sample + rreg_p + rotate + return + repeat + rename + regres + reg3_p + recode + recast + rchart + quietl + qreg_p + qreg_c + qqplot + pwcorr + prtest + probit + predic + plugin + pctile + pchart + ovtest + outshe + outfil + orthog + oprobi + op_str + op_inv + oneway + ologit + notify + noisil + nlpred + nllog4 + nllog3 + nlinit + nlgom4 + nlgom3 + nlexp3 + nlexp2 + mrdu0_ + mlopts + mlogit + mleval + ml_s_e + ml_opt + ml_nb0 + ml_max + ml_log + ml_inv + ml_hd0 + ml_elf + ml_eds + ml_e0i + ml_cnt + ml_c_d + mhodds + memory + mdytof + mdytoe + matrix + mantel + ltable + lrtest + lookup + lincom + lfit_p + ladder + kapwgt + joinby + intreg + inspec + inshee + infile + impute + hlogit + hilite + grebar + gphpen + gphdot + gnbreg + glogit + global + glm_sw + genstd + genera + ftomdy + format + for5_0 + fillin + factor + export + expand + execut + etomdy + etodow + estima + ereg_p + encode + eivreg + dynren + dwstat + doedit + displa + disp_s + dfbeta + descri + decode + cttost + ctst_5 + coxvar + coxhaz + cox_sw + correl + constr + confir + cnsreg + clogit + clog_p + clocal + cchart + bstrap + bsqreg + boxcox + blogit + bitowt + bitest + bipr_p + avplot + assert + areg_p + arch_p + append + aorder + adjust + _wkapm + _ttest + _ttest + _sfran + _opnum + _nlout + _newey + _mkvec + _maked + _isfit + _huber + _grsum + _grobs + _grmin + _grmax + _grank + _grank + _gmean + _glmfl + _gfill + _gfill + _getbv + _gdiff + _cu_c0 + _crcrr + _crcrd + _crcra + _crcor + _crcor + _crclf + _crcci + _cr1se + _byobs + _addop + _3dax0 + zts_5 + zip_p + zap_s + xwind + xttab + xtsum + xtreg + xtile + xtgls + xtgee + xtdes + xpose + xcorr + wmenu + windo + which + whelp + wdctl + versi + ttest + tsset + touch + token + tobit + timer + tabul + table + tabdi + symmi + swilk + swcox + svylc + svy_x + svmat + sureg + summa + stsum + stset + streg + stgen + stdes + stcox + stack + st_is + st_hc + st_ct + sretu + sqreg + sleep + simul + shell + score + scala + rotat + retur + renam + remap + regre + regdw + range + quiet + query + qnorm + prove + probi + predi + prais + popup + pnorm + plugi + pcorr + pause + parse + outsh + outfi + order + oprob + onewa + ologi + notes + noisi + newey + nbreg + mvreg + mnl0_ + mlsum + mlogi + ml_e2 + ml_e1 + ml_e0 + mkmat + mkdir + merge + means + matri + macro + lstat + lsens + looku + logit + local + kappa + kap_3 + ivreg + iqreg + integ + inspe + inshe + input + infix + infil + hotel + hereg + hareg + gwood + gsort + graph + globa + glm_p + gener + gamma + forma + facto + execu + estim + error + erase + encod + emdef + dynre + doedi + displ + descr + decod + debug + dbeta + cusum + cumul + cumsp + ctset + ct_is + cross + cox_p + count + corre + const + confi + cnreg + clogi + clear + cksum + chdir + canon + bstat + brier + break + asser + arima + appen + anova + alpha + about + _qreg + _nobs + _mvec + _hube + _gtma + _gsum + _gstd + _grsd + _gmtr + _gmtr + _gmin + _gmax + _gmad + _giqr + _gcut + _crct + _cr1t + _addl + zinb + xwin + wind + whic + wdlg + vwls + vers + unab + type + tset + trim + tobi + test + tabu + tabi + tabd + tab2 + tab1 + summ + stmh + stmc + stir + stem + sret + sqrt + sort + shel + scor + scal + save + rreg + rota + retu + rena + regr + reg3 + rcof + quie + quer + qreg + qchi + push + prob + pred + post + popu + plug + plot + pchi + pars + outs + outf + opro + onew + olog + nois + nl_p + news + move + more + mlog + mlf_ + ml_5 + merg + md2_ + md1_ + md0_ + mcci + matr + mark + macr + lroc + look + logi + loca + list + lfit + labe + ktau + keep + insp + insh + inpu + infi + hreg + hist + help + grap + glob + gene + ftoe + form + fact + exit + exec + etof + esti + erro + ereg + enco + egen + edit + dydx + drop + doed + disp + desc + deff + deco + coun + corr + corc + copy + cons + conf + cnre + clog + char + boot + beep + asse + args + areg + arch + appe + anov + _svy + _hub + _gsd + _gma + zip + win + whi + vif + vce + use + typ + tob + tis + tes + te + tab + sum + sts + sor + she + set + sds + sco + sca + say + sav + run + rot + ret + ren + reg + qui + que + qby + pwd + pro + pop + plo + par + pac + out + opr + one + olo + noi + net + mov + mor + mer + mcc + mat + man + mac + loo + log + loc + lis + lab + ksm + kap + iri + ins + inp + inf + iis + hlu + hel + gra + gph + glo + glm + gen + fit + fft + fac + exi + est + err + enc + edi + doe + dis + dir + des + dec + csi + crc + cox + cou + cor + cnr + clo + cii + cci + cat + cap + bee + ass + app + ano + ado + _ts + _hu + _ac + xi + wh + us + ty + ta + sw + su + st + so + sh + se + sa + ru + rm + qu + pr + pl + ou + no + nl + ml + ma + lv + ls + lo + li + la + ir + in + he + gr + gl + ge + ex + eq + en + ed + ds + do + di + de + ct + cs + cp + ci + cf + cd + cc + by + bs + be + as + ap + an + u + q + n + l + h + g + e + d + _gclsort + _gpcrank + _gprod + _gprop-_gpc + _grmedf + _grpos + _grprod + _gslope + _gsoundex + _gwtmean + abar + acplot + addtex + addtxt + adjacent + adjksm + adjmean + adjprop + adjust + adoedit + adotype + allcross + allpossible + alphawgt + anovaplot + archlm + areg2 + arimafit + autolog + avplot2 + avplot3 + barplot + barplot2 + bcoeff + betacoef + betafit + bgtest + bigtab + biplot + biprob + bking + blist + blogit2 + bnormpdf + boolean + bpagan + bpass + bspline + bygap + bys + byvar + canon + catdev + catenate + catgraph + catplot + cb2html + ccweight + cenpois + centcalc + center + centroid + cf2 + cf3 + cflpois + chaos + charlist + charutil + checkvar + chiplot + ci2 + cibplot + cid + ciform + cihplot + cij + ciplot + cipolate + circular + cistat + civplot + ciw + cleanlog + clemao_io + cltest + cluster + cme + cndnmb3 + cnsrsig + codebook2 + coldiag + colelms + collapse2 + collapseunique + concord + confirmdir + confsvy + contrast + copydesc + coranal + corr_svy + corrtab + cortesti + cpcorr + cpr + cpyxplot + crtest + csjl + ctabstat + cusum6 + cvxhull + cycleplot + dagumfit + dashgph + dashln + datelist + datesum + datmat + decomp + decompose + denton + descsave + desmat + detect + dfao + dfgls + diagt + diagtest + disjoint + dissim + distan + distinct + distplot + dmariano + dmerge + dmexogxt + dolog + dologx + domdiag + dotex + doub2flt + doubmass + dpplot + ds2 + ds3 + ds5 + dsconcat + dsearch + dtobit2 + dummies + dups + durbinh + eba + ebb + eclplot + effects + egenmore + elapse + ellip + ellip6 + ellip7 + enlarge + epiconf + epsigr + eqprhistogram + estout + estsave + etime + ewma + examples + expandby + expgen + explist + extremes + factext + factmerg + factortest + factref + far5 + fastcd + fbar + fedit + feldti + finddup + findval + fitmacro + fitstat + flower + fndmtch + fndmtch2 + fodstr + for211 + forfile + fracdiff + fracirf + fs + fsum + full_palette + fulltab + gammafit + gammasym + gby + gcause + geivars + geneigen + genfreq + genhwcci + gentrun + genvars + ghistcum + ginidesc + gipf + glcurve + glcurve7 + gllamm + glmcorr + gmci + gmlabvpos + gologit + gpfobl + gphepssj + gphudak + gprefscode + gpreset + grand + grand2 + grby + grfreq + grlogit + grnote + groups + grqreg + gumbelfit + gwhet + hadrilm + hansen2 + hapblock + hapipf + harmby + hausman + hbar + hbox + hcaccprox + heckman2 + heckprob2 + hegy4 + hetprob + himatrix + hireg + hist3 + histbox + histplot + hlist + hlpdir + hotdeck + hplot + hshaz + icomp + idonepsu + iia + inccat + indexplot + ineq + ineqdec0 + ineqdeco + ineqfac + inequal2 + inequal7 + ingap + intext + intterms + ipf + ipshin + irrepro + isco + isko + istdize + ivendog + ivglog + ivgmm0 + ivhettest + ivprob-ivtobit + ivreg2 + jb + jb6 + johans + jonter + kapgof + kdbox + kdensity + kdmany + kernreg1 + kernreg2 + keyplot + kpss + kr20 + kwallis2 + labsort + labsumm + labutil + lambda + latab + levels + levene + levinlin + lfsum + lincom2 + lincomest + linkplot + listtex + listutil + ljs + lmoments + lms + loevh + log2do2 + log2html + logpred + lomodrs + longch + longplot + lookforit + loopplot + lprplot + lrchg + lrdrop1 + lrmatx + lrplot + lrseq + lrutil + lstack + ltable2 + madfuller + majority + makematrix + maketex + margfx + marker + markov + mat2txt + matmap + matodd + matrixof + matvsort + mca + mcl + mcqscore + mdensity + median + medoid + meta_lr + metaaggr + metabias + metafunnel + metaninf + metatrim + mfilegr + mgen + minap + missing + mitools + mkbilogn + mkcorr + mkdat + mkstrsn + mktab + mlcoint + mlogpred + mmerge + mnthplot + modlpr + moreobs + mrdum + mrtab + msp + msplot + mstdize + mstore + muxplot + muxyplot + mvcorr + mvprobit + mvsamp1i + mvsampsi + mvsumm + mvtest + mylabels + mypkg + nbfit + nbinreg + ncf + nct + nearest + nearmrg + newey2 + nharvey + nicedates + nnest + nnmatch + normtest + nproc + ocratio + ofrtplot + omninorm + omodel + onewayplot + onewplot + oprobpr + ordplot + orthog + outdat + outfix + outfix2 + outreg + outreg5 + outseries + outtable + outtex + overid + overidxt + overlay + ovfplot + pairplot + panelauto + panelunit + pantest2 + parmest + parplot + partgam + pbeta + pcontract + pcorr2 + pexp + pgamma + pgmhaz8 + plotmatrix + pnrcheck + poisml + povdeco + poverty + powercal + ppplot + predcalc + predxcat + predxcon + printgph + probexog-tobexog + probitiv + psbayes + psmatch2 + ptrend + pwcorrs + pwcorrw + pweibull + pwploti + pyramid + qbeta + qexp + qfrplot + qgamma + qhapipf + qlognorm + qqplot2 + qrowname + qsim + quantil2 + qweibull + ralloc + ranova + ranvar + raschcvt + raschtest + rbounds + rdplot + readlog + recast2 + recode2 + reformat + reg3 + regaxis + reglike + regplot + regpred + regresby + renames + reshape8 + rfregk + rglm + rgroup + rhetplot + rmanova + rnd + roblpr + rocss + rollreg + rowranks + rowsort + rvfplot2 + rvlrplot + rvpplot2 + safedrop + savasas + savesome + sbplot + sbplot5 + sbrowni + sdecode + sdtest + seg + selectvars + sencode + senspec + seq + sf36 + shapley + shortdir + showgph + shownear + skewplot + slideplot + slist + smfit + smhsiao + smileplot + soepren + somersd + soreg + sortlistby + spaces + sparl + spell + spellutil + sphdist + spikeplt + split + splitvallabels + spsurv + sq + ssizebi + sskapp + sssplot + stack + stak + statsbyfast + statsmat + stbget + stbtcalc + stcascoh + stcmd + stcompet + stcoxgof + stcoxplt + stcstat + stcumh + stexpect + stgtcalc + stkerhaz + sto + storecmd + stpiece + stpm + stquant + strdate + strgen + strip + strparse + stselpre + studysi + sumdist + summdate + summvl + sunflower + suprob + survtime + survwgt + sutex + svmatf + svr + svvarlbl + svybs + svytabs + swapval + swblock + swboot + switchr + symmetry + t2way5 + tab2way + tab3way + tab_chi + taba + tabcond + tabcount + tabhbar + tabhplot + tablab + tablecol + tablepc + tableplot + tabmerge + tabplot + tabstatmat + tarow + textgph + tgraph + title + tknz + tmpdir + tobitiv + todate + tolower + tomode + torats + torumm + tosql + tpred + tpvar + trinary + triplot + triprobit + trnbin0 + trpois0 + tryem + tscollap + tsgraph + tslist + tsmktim + tsplot + tsspell + twoway_estfit + unique + unitab + univar + univstat + usagelog + usesas + vallab + vallist + vanelteren + varcase + varlab + varlag + vartyp + vecar + vecar6 + vececm + venndiag + violin + vlist + vmatch + vplplot + vreverse + vtokenize + wbull + wclogit + wgttest + whitef + whitetst + whotdeck + williams + winsor + wntstmvq + xcollapse + xcontract + xcorplot + xfrac + xi3 + xpredict + xrigls + xriml + xsampsi + xtab + xtabond2 + xtgraph + xtile2 + xtpattern + xttest2 + xttest3 + xttrans2 + zandrews + zb_qrm + zinb + zip + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/supercollider.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/supercollider.plist new file mode 100644 index 00000000..c14fadfa --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/supercollider.plist @@ -0,0 +1,71 @@ + + + + + beginCommand + + endCommand + + beginInstruction + | + endInstruction + | + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + ar + arg + case + classvar + collect + do + dup + false + if + inf + kr + new + nil + or + protect + switch + this + true + super + try + var + while + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/tcltk.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/tcltk.plist new file mode 100644 index 00000000..5c7de3bd --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/tcltk.plist @@ -0,0 +1,472 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + # + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + after + append + AppleScript + argv + argc + array + auto_execk + auto_load + auto_mkindex + auto_path + auto_reset + beep + bell + binary + bind + bindtags + bgerror + break + button + canvas + case + catch + cd + checkbutton + clipboard + clock + close + concat + console + continue + dde + destroy + else + elseif + encoding + entry + env + eof + error + errorCode + errorInfo + eval + event + exec + exit + expr + fblocked + fconfigure + fcopy + file + fileevent + flush + focus + font + for + foreach + format + frame + gets + glob + global + grab + grid + history + if + image + incr + info + interp + join + label + lappend + lindex + linsert + list + listbox + llength + load + lower + lrange + lreplace + lsearch + lsort + menu + menubutton + message + namespace + open + option + OptProc + pack + package + parray + pid + place + pkg_mkindex + proc + puts + pwd + radiobutton + raise + read + regexp + registry + regsub + rename + resource + return + scale + scan + scrollbar + seek + selection + send + set + socket + source + split + string + subst + switch + tclLog + tcl_endOfWord + tcl_findLibrary + tcl_library + tcl_patchLevel + tcl_platform + tcl_precision + tcl_rcFileName + tcl_rcRsrcName + tcl_startOfNextWord + tcl_startOfPreviousWord + tcl_traceCompile + tcl_traceExec + tcl_version + tcl_wordBreakAfter + tcl_wordBreakBefore + tell + text + time + tk + tkTabToWindow + tkwait + tk_chooseColor + tk_chooseDirectory + tk_focusFollowMouse + tk_focusNext + tk_focusPrev + tk_getOpenFile + tk_getSaveFile + tk_library + tk_messageBox + tk_optionMenu + tk_patchLevel + tk_popup + tk_strictMotif + tk_version + toplevel + trace + unknown + unset + update + uplevel + upvar + variable + vwait + while + winfo + wm + add + args + atime + attributes + body + bytelength + cancel + channels + clicks + cmdcount + commands + compare + complete + convertfrom + convertto + copy + default + delete + dirname + equal + executable + exists + extension + first + forget + format + functions + globals + hostname + idle + ifneeded + index + info + is + isdirectory + isfile + join + last + length + level + library + link + loaded + locals + lstat + map + match + mkdir + mtime + nameofexecutable + names + nativename + normalize + number + owned + patchlevel + pathtype + present + procs + provide + range + readable + readlink + remove + rename + repeat + replace + require + rootname + scan + script + seconds + separator + sharedlibextension + size + split + stat + system + tail + tclversion + tolower + totitle + toupper + trim + trimleft + trimright + type + unknown + variable + vars + vcompare + vdelete + versions + vinfo + volumes + vsatisfies + wordend + wordstart + writable + activate + actual + addtag + append + appname + aspect + atom + atomname + bbox + bind + broadcast + canvasx + canvasy + caret + cells + cget + children + class + clear + client + clone + colormapfull + colormapwindows + command + configure + containing + coords + create + current + curselection + dchars + debug + deiconify + delta + depth + deselect + dlineinfo + dtag + dump + edit + entrycget + entryconfigure + families + find + flash + focus + focusmodel + fpixels + fraction + frame + generate + geometry + get + gettags + grid + group + handle + height + hide + iconbitmap + iconify + iconmask + iconname + iconposition + iconwindow + icursor + id + identify + image + insert + interps + inuse + invoke + ismapped + itemcget + itemconfigure + keys + lower + manager + mark + maxsize + measure + metrics + minsize + move + name + nearest + overrideredirect + own + panecget + paneconfigure + panes + parent + pathname + pixels + pointerx + pointerxy + pointery + positionfrom + post + postcascade + postscript + protocol + proxy + raise + release + reqheight + reqwidth + resizable + rgb + rootx + rooty + scale + scaling + screen + screencells + screendepth + screenheight + screenmmheight + screenmmwidth + screenvisual + screenwidth + search + see + select + selection + server + set + show + sizefrom + stackorder + state + status + tag + title + toplevel + transient + types + unpost + useinputmethods + validate + values + viewable + visual + visualid + visualsavailable + vrootheight + vrootwidth + vrootx + vrooty + width + window + windowingsystem + withdraw + x + xview + y + + autocompleteWords + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/torquescript.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/torquescript.plist new file mode 100644 index 00000000..f6fd6a53 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/torquescript.plist @@ -0,0 +1,69 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + /* + beginInstruction + + beginSecondMultiLineComment + + beginVariable + $% + endCommand + + endFirstMultiLineComment + */ + endInstruction + + endSecondMultiLineComment + + endVariable + ./*+-()=; + firstSingleLineComment + // + firstString + " + functionDefinition + ^\s*\w*function\s+.* + keywords + + break + case + continue + datablock + default + else + function + if + for + new + or + package + return + switch + switch$ + while + yes + no + on + off + true + false + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + function + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/udo.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/udo.plist new file mode 100644 index 00000000..f37659b3 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/udo.plist @@ -0,0 +1,509 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + !begin_comment + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + !end_comment + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + # + firstString + + functionDefinition + ^[ \t]*!(begin_p?node|p?(sub)*node|ps*|s+n)\*?.*$ + includeInKeywordEndCharacterSet + !-.*~"') + includeInKeywordStartCharacterSet + (!-~ + keywords + + !! + !- + !.. + !a + !alias + !autoref + !autoref_items + !bbl + !bc + !bd + !be + !begin_appendix + !begin_blist + !begin_center + !begin_comment + !begin_description + !begin_document + !begin_enumerate + !begin_ignore + !begin_ilist + !begin_itemize + !begin_linedraw + !begin_node + !begin_node* + !begin_pnode + !begin_pnode* + !begin_preformatted + !begin_quote + !begin_raw + !begin_sourcecode + !begin_table + !begin_tlist + !begin_verbatim + !begin_xlist + !begin_flushleft + !begin_flushright + !bfr + !bi + !bigskip + !bil + !bn + !bn* + !bp + !bp* + !bq + !break + !btl + !bxl + !bfl + !chaptericon + !chaptericon_active + !chaptericon_text + !chapterimage + !cinclude + !code + !comment + !depth + !define + !docinfo + !doclayout + !drc_bcolor + !drc_icolor + !drc_ucolor + !drc_flags + !ebl + !ec + !ed + !ee + !efr + !ei + !eil + !else + !en + !endif + !endnode + !end_appendix + !end_blist + !end_center + !end_comment + !end_description + !end_document + !end_enumerate + !end_ignore + !end_ilist + !end_itemize + !end_linedraw + !end_node + !end_preformatted + !end_quote + !end_raw + !end_sourcecode + !end_table + !end_tlist + !end_verbatim + !end_xlist + !end_flushleft + !end_flushright + !eq + !error + !etl + !exl + !efl + !fussy + !h + !heading + !hh_alinkcolor + !hh_backcolor + !hh_backimage + !hh_img_suffix + !hh_linkcolor + !hh_textcolor + !hh_verbatim_backcolor + !hh_vlinkcolor + !hline + !htag_img_suffix + !html_alinkcolor + !html_backcolor + !html_backimage + !html_backpage + !html_button_alignment + !html_counter_command + !html_description + !html_doctype + !html_favicon_name + !html_frames_alignment + !html_frames_alinkcolor + !html_frames_backcolor + !html_frames_backimage + !html_frames_con_title + !html_frames_height + !html_frames_layout + !html_frames_linkcolor + !html_frames_position + !html_frames_textcolor + !html_frames_toc_title + !html_frames_vlinkcolor + !html_frames_width + !html_header_date + !html_header_links + !html_ignore_8bit + !html_img_suffix + !html_javascript + !html_keywords + !html_linkcolor + !html_merge_nodes + !html_merge_subnodes + !html_merge_subsubnodes + !html_merge_subsubsubnodes + !html_modern_alignment + !html_modern_backcolor + !html_modern_backimage + !html_modern_layout + !html_modern_width + !html_monofont_name + !html_monofont_size + !html_name + !html_name_prefix + !html_navigation + !html_nodesize + !html_no_xlist + !html_propfont_name + !html_propfont_size + !html_robots + !html_script_name + !html_style_name + !html_switch_language + !html_textcolor + !html_transparent_buttons + !html_use_hyphenation + !html_verbatim_backcolor + !html_vlinkcolor + !hyphen + !i + !if + !ifdest + !ifndest + !ifnlang + !ifnos + !ifnset + !ifos + !ifset + !ignore_bottomline + !ignore_headline + !ignore_index + !ignore_links + !ignore_raw_footer + !ignore_raw_header + !ignore_subsubsubtoc + !ignore_subsubtoc + !ignore_subtoc + !ignore_title + !image + !image* + !image_alignment + !image_counter + !include + !index + !input + !item + !iflang + !l + !label + !language + !ldinclude + !lh + !linedrawsize + !listheading + !listoftables + !listoffigures + !listsubheading + !listsubsubheading + !listsubsubsubheading + !lsh + !lssh + !lsssh + !macro + !maketitle + !man_lpp + !man_type + !mapping + !medskip + !n + !n* + !newpage + !node + !node* + !nop + !no_8bit + !no_bottomlines + !no_buttons + !no_effects + !no_footers + !no_headlines + !no_icons + !no_images + !no_img_size + !no_index + !no_links + !no_numbers + !no_popup_headlines + !no_preamble + !no_quotes + !no_sourcecode + !no_table_lines + !no_titles + !no_umlaute + !no_urls + !no_verbatim_umlaute + !no_xlinks + !nroff_type + !p + !p* + !parwidth + !pdf_high_compression + !pdf_medium_compression + !pinclude + !pnode + !pnode* + !ps + !ps* + !pss + !pss* + !psss + !psss* + !psubnode + !psubnode* + !psubsubnode + !psubsubnode* + !psubsubsubnode + !psubsubsubnode* + !raw + !rinclude + !rtf_add_colour + !rtf_charwidth + !rtf_keep_tables + !rtf_monofont + !rtf_monofont_size + !rtf_no_tables + !rtf_propfont + !rtf_propfont_size + !set + !sh + !short + !sinclude + !sloppy + !smallskip + !sn + !sn* + !sort_hyphen_file + !ssh + !ssn + !ssn* + !sssh + !sssn + !sssn* + !stg_short_title + !subheading + !subnode + !subnode* + !subsubheading + !subsubnode + !subsubnode* + !subsubsubheading + !subsubsubnode + !subsubsubnode* + !subsubsubtoc + !subsubsubtoc_offset + !subsubtoc + !subsubtoc_offset + !subtoc + !subtoc_offset + !tableofcontents + !table_alignment + !table_caption + !table_caption* + !table_counter + !tabwidth + !tex_209 + !tex_2e + !tex_dpi + !tex_emtex + !tex_lindner + !tex_miktex + !tex_strunk + !tex_tetex + !tex_verb + !toc + !toc_offset + !toplink + !udolink + !universal_charset + !unset + !use_about_udo + !use_alias_inside_index + !use_ansi_tables + !use_auto_helpids + !use_auto_subsubsubtocs + !use_auto_subsubtocs + !use_auto_subtocs + !use_auto_toptocs + !use_chapter_images + !use_comments + !use_formfeed + !use_justification + !use_label_inside_index + !use_mirrored_indices + !use_nodes_inside_index + !use_output_buffer + !use_raw_footer + !use_raw_header + !use_short_envs + !use_short_tocs + !use_style_book + !use_udo_index + !verbatimsize + !vinclude + !wh4_backcolor + !wh4_background + !wh4_charwidth + !wh4_helpid + !wh4_high_compression + !wh4_inline_bitmaps + !wh4_linkcolor + !wh4_medium_compression + !wh4_monofont + !wh4_monofont_size + !wh4_old_keywords + !wh4_prefix_helpids + !wh4_propfont + !wh4_propfont_size + !wh4_textcolor + !win_backcolor + !win_charwidth + !win_helpid + !win_high_compression + !win_inline_bitmaps + !win_linkcolor + !win_medium_compression + !win_monofont + !win_monofont_size + !win_old_keywords + !win_prefix_helpids + !win_propfont + !win_propfont_size + !win_textcolor + !x + !/- + !~ + "" + '' + (!alpha) + (!aqua) + (!b) + (!B) + (!beta) + (!black) + (!blue) + (!coloff) + (!comment) + (!copyright) + (!deg) + (!del) + (!DEL) + (!euro) + (!fuchsia) + (!gray) + (!green) + (!grin) + (!i) + (!I) + (!idx) + (!ilink) + (!img) + (!index) + (!ins) + (!INS) + (!label) + (!LaTeX) + (!LaTeXe) + (!laugh) + (!lime) + (!link) + (!maroon) + (!n) + (!N) + (!navy) + (!nl) + (!nolink) + (!olive) + (!plink) + (!pound) + (!purple) + (!raw) + (!red) + (!reg) + (!short_today) + (!silver) + (!T) + (!t) + (!teal) + (!TeX) + (!tm) + (!today) + (!u) + (!U) + (!url) + (!V) + (!v) + (!white) + (!xlink) + (!yellow) + ("") + ('') + (--) + (---) + -- + --- + ~ + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vb.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vb.plist new file mode 100644 index 00000000..cb48a6fb --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vb.plist @@ -0,0 +1,111 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + ' + secondSingleLineComment + + beginFirstMultiLineComment + + endFirstMultiLineComment + + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*\w*(function|sub)\s+.* + removeFromFunction + function + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + if + then + else + elseif + select + case + for + to + step + next + each + in + do + while + until + loop + wend + exit + end + function + sub + class + property + get + let + set + byval + byref + const + dim + redim + preserve + as + set + with + new + public + default + private + rem + call + execute + eval + on + error + goto + resume + option + explicit + erase + randomize + is + mod + and + or + not + xor + imp + false + true + empty + nothing + null + + autocompleteWords + + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/verilog.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/verilog.plist new file mode 100644 index 00000000..2eeaf04a --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/verilog.plist @@ -0,0 +1,143 @@ + + + + + beginCommand + + endCommand + + beginInstruction + + endInstruction + + beginVariable + + endVariable + + firstString + " + secondString + + firstSingleLineComment + // + secondSingleLineComment + + beginFirstMultiLineComment + /* + endFirstMultiLineComment + */ + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + and + always + assign + attribute + begin + buf + bufif0 + bufif1 + case + cmos + deassign + default + defparam + disable + else + endattribute + end + endcase + endfunction + endprimitive + endmodule + endtable + endtask + event + for + force + forever + fork + function + highz0 + highz1 + if + `include + initial + inout + input + integer + join + large + medium + module + nand + negedge + nor + not + notif0 + notif1 + nmos + or + output + parameter + pmos + posedge + primitive + pulldown + pullup + pull0 + pull1 + rcmos + reg + release + repeat + rnmos + rpmos + rtran + rtranif0 + rtranif1 + scalared + small + specify + specparam + strong0 + strong1 + supply0 + supply1 + table + task + tran + tranif0 + tranif1 + time + tri + triand + trior + trireg + tri0 + tri1 + vectored + wait + wand + weak0 + weak1 + while + wire + wor + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vhdl.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vhdl.plist new file mode 100644 index 00000000..866c7e81 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/vhdl.plist @@ -0,0 +1,144 @@ + + + + + autocompleteWords + + beginCommand + + beginFirstMultiLineComment + + beginInstruction + + beginSecondMultiLineComment + + beginVariable + + endCommand + + endFirstMultiLineComment + + endInstruction + + endSecondMultiLineComment + + endVariable + + firstSingleLineComment + -- + firstString + " + functionDefinition + ^\s*.*\(.*\)\n?\s*\{ + keywords + + abs + access + after + alias + all + and + architecture + array + assert + attribute + begin + block + body + buffer + bus + case + component + configuration + constant + disconnect + downto + else + elsif + end + entity + exit + file + for + function + generate + generic + group + guarded + if + impure + in + inertial + inout + is + label + library + linkage + literal + loop + map + mod + nand + new + next + nor + not + null + of + on + open + or + others + out + package + port + postponed + procedure + process + pure + range + record + register + reject + rem + report + return + rol + ror + select + severity + shared + signal + sla + sll + sra + srl + subtype + then + to + transport + type + unaffected + units + until + use + variable + wait + when + while + with + xnor + xor + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + removeFromFunction + + secondSingleLineComment + + secondString + ' + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/xml.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/xml.plist new file mode 100644 index 00000000..c3e9bdbf --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/Syntax Definitions/xml.plist @@ -0,0 +1,56 @@ + + + + + beginCommand + < + endCommand + > + beginInstruction + <? + endInstruction + ?> + beginVariable + + endVariable + + firstString + " + secondString + ' + firstSingleLineComment + + secondSingleLineComment + + beginFirstMultiLineComment + <!-- + endFirstMultiLineComment + --> + beginSecondMultiLineComment + + endSecondMultiLineComment + + functionDefinition + + removeFromFunction + + keywordsCaseSensitive + + recolourKeywordIfAlreadyColoured + + keywords + + CDATA + EMPTY + INCLUDE + IGNORE + NDATA + #IMPLIED + #PCDATA + #REQUIRED + + autocompleteWords + + + + \ No newline at end of file diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SyntaxDefinitions.plist b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SyntaxDefinitions.plist new file mode 100644 index 00000000..17b0c0b6 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/SyntaxDefinitions.plist @@ -0,0 +1,678 @@ + + + + + + name + GLSL + file + glsl + extensions + fs vs + + + name + ActionScript + file + actionscript + extensions + as + + + name + ActionScript 3 + file + actionscript3 + extensions + as + + + name + Active4D + file + active4d + extensions + a4d a4l etc + + + name + Ada + file + ada + extensions + ada adb ads a + + + name + AMPL + file + ampl + extensions + run mod dat + + + name + Apache + file + apache + extensions + htaccess conf + + + name + Applescript + file + applescript + extensions + scpt applescript + + + name + ASM-x86 + file + asm-x86 + extensions + asm + + + name + ASM-MIPS + file + asm-mips + extensions + asm + + + name + ASP - JavaScript + file + asp-js + extensions + asp + + + name + ASP - VB + file + asp-vb + extensions + asp + + + name + ASP.NET - C# + file + aspdotnet-cs + extensions + aspx ascx asmx + + + name + ASP.NET - VB + file + aspdotnet-vb + extensions + aspx ascx asmx + + + name + AWK + file + awk + extensions + awk + + + name + Batch + file + batch + extensions + bat cmd + + + name + C + file + c + extensions + c + + + name + C++ + file + cpp + extensions + cpp cxx cc + + + name + C# + file + csharp + extensions + cs + + + name + Cobol + file + cobol + extensions + cobol + + + name + CoffeeScript + file + coffeescript + extensions + coffee + + + name + ColdFusion + file + coldfusion + extensions + cfm cfc cfml dbm + + + name + Csound + file + csound + extensions + csd orc sco + + + name + CSS + file + css + extensions + css + + + name + D + file + d + extensions + d + + + name + Dylan + file + dylan + extensions + dylan + + + name + Eiffel + file + eiffel + extensions + e + + + name + Erlang + file + erl + extensions + erl hrl + + + name + eZ Publish + file + eztpl + extensions + tpl + + + name + Fortran + file + fortran + extensions + f for f90 fpp + + + name + FreeFem++ + file + freefem + extensions + edp + + + name + GEDCOM + file + gedcom + extensions + ged + + + name + GNU Assembler + file + gnuassembler + extensions + s + + + name + Haskell + file + haskell + extensions + hs lhs + + + name + Header + file + header + extensions + h + + + name + HTML + file + html + extensions + html htm xhtml shtml shtm + + + name + IDL + file + idl + extensions + pro + + + name + Java + file + java + extensions + java + + + name + JavaFX + file + javafx + extensions + fx + + + name + JavaScript + file + javascript + extensions + js + + + name + JSP + file + jsp + extensions + jsp + + + name + LaTeX + file + latex + extensions + tex + + + name + Lilypond + file + lilypond + extensions + ly lytex + + + name + Lisp + file + lisp + extensions + lisp lsp + + + name + Logtalk + file + logtalk + extensions + lgt config + + + name + LSL + file + lsl + extensions + lsl + + + name + Lua + file + lua + extensions + lua + + + name + Matlab + file + matlab + extensions + grl mat mex myt + + + name + MetaPost + file + metapost + extensions + mp + + + name + MEL + file + mel + extensions + mel ma + + + name + Metaslang + file + metaslang + extensions + sw + + + name + MySQL + file + mysql + extensions + sql + + + name + Nemerle + file + nemerle + extensions + n + + + name + NEURON + file + nrnhoc + extensions + hoc + + + name + Objective Caml + file + objectivecaml + extensions + ml + + + name + Objective-C + file + objectivec + extensions + m mm + + + name + Ox + file + ox + extensions + ox oxsrc oxtxt h + + + name + Pascal + file + pascal + extensions + pp pas p + + + name + PDF + file + pdf + extensions + pdf + + + name + Perl + file + perl + extensions + pl pm + + + name + PHP + file + php + extensions + php php3 phtml phtm + + + name + Plist + file + plist + extensions + plist + + + name + PostScript + file + postscript + extensions + ps eps ai + + + name + Prolog + file + prolog + extensions + prolog pro + + + name + Python + file + python + extensions + py pyw + + + name + R/S-PLUS + file + r + extensions + r + + + name + RHTML + file + rhtml + extensions + rhtml + + + name + Ruby + file + ruby + extensions + rb + + + name + Scala + file + scala + extensions + scala + + + name + SGML + file + sgml + extensions + sgml + + + name + Shell + file + shell + extensions + sh tool + + + name + SML + file + sml + extensions + sml ml + + + name + SQL + file + sql + extensions + sql + + + name + Stata + file + stata + extensions + ado do dta log + + + name + SuperCollider + file + supercollider + extensions + sc scd + + + name + Tcl/Tk + file + tcltk + extensions + tcl tk + + + name + TorqueScript + file + torquescript + extensions + cs + + + name + Udo + file + udo + extensions + u ui + + + name + VB + file + vb + extensions + vb + + + name + Verilog + file + verilog + extensions + v vg + + + name + VHDL + file + vhdl + extensions + vhd + + + name + XML + file + xml + extensions + xml dtd xsd xsl + + + name + GraphViz + file + graphviz + extensions + gv dot + + + name + F-Script + file + f-script + extensions + fs + + + diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-0.png b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-0.png new file mode 100644 index 00000000..1503be66 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-0.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-1.png b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-1.png new file mode 100644 index 00000000..c9cc262b Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-1.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-2.png b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-2.png new file mode 100644 index 00000000..21900131 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint-2.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint.png b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint.png new file mode 100644 index 00000000..646ac6c4 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-breakpoint.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-warning.png b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-warning.png new file mode 100644 index 00000000..97ba38f9 Binary files /dev/null and b/external/MGSFragaria/MGSFragaria.framework/Versions/A/Resources/editor-warning.png differ diff --git a/external/MGSFragaria/MGSFragaria.framework/Versions/Current b/external/MGSFragaria/MGSFragaria.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/external/MGSFragaria/MGSFragaria.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/external/MGSFragaria/MGSPreferencesController.h b/external/MGSFragaria/MGSPreferencesController.h new file mode 100644 index 00000000..8b5338b7 --- /dev/null +++ b/external/MGSFragaria/MGSPreferencesController.h @@ -0,0 +1,24 @@ +// +// MGSPreferencesController.h +// Fragaria +// +// Created by Jonathan on 30/04/2010. +// Copyright 2010 mugginsoft.com. All rights reserved. +// + +#import +#import +#import "DBPrefsWindowController.h" + +@interface MGSPreferencesController : DBPrefsWindowController { + IBOutlet NSView *generalView; + MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; + MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; + NSString *toolbarIdentifier; + NSString *generalIdentifier; + NSString *textIdentifier; + NSString *fontIdentifier; + +} +- (IBAction)revertToStandardSettings:(id)sender; +@end diff --git a/external/MGSFragaria/MGSPreferencesController.m b/external/MGSFragaria/MGSPreferencesController.m new file mode 100644 index 00000000..437b189f --- /dev/null +++ b/external/MGSFragaria/MGSPreferencesController.m @@ -0,0 +1,160 @@ +// +// MGSPreferencesController.m +// KosmicEditor +// +// Created by Jonathan on 30/04/2010. +// Copyright 2010 mugginsoft.com. All rights reserved. +// + +#import "MGSPreferencesController.h" +#import + +@interface MGSPreferencesController() +- (BOOL)commitEditingAndDiscard:(BOOL)discard; +@end + +@implementation MGSPreferencesController + +#pragma mark - +#pragma mark Instance methods + +/* + + -initWithWindow: is the designated initializer for NSWindowController. + + */ +- (id)initWithWindow:(NSWindow *)window +{ +#pragma unused(window) + + self = [super initWithWindow:window]; + if (self) { + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:window]; + + } + return self; +} + + +/* + + - showWindow: + + */ +- (void)showWindow:(id)sender +{ + // load view controllers + textEditingPrefsViewController = [MGSFragariaPreferences sharedInstance].textEditingPrefsViewController; + + fontsAndColoursPrefsViewController = [MGSFragariaPreferences sharedInstance].fontsAndColoursPrefsViewController; + + [super showWindow:sender]; +} + +/* + + - setupToolbar + + */ +- (void)setupToolbar +{ + generalIdentifier = NSLocalizedString(@"General", @"Preferences tab name"); + textIdentifier = NSLocalizedString(@"Text Editing", @"Preferences tab name"); + fontIdentifier = NSLocalizedString(@"Fonts & Colours", @"Preferences tab name"); + + [self addView:generalView label:generalIdentifier]; + + [self addView:textEditingPrefsViewController.view label:textIdentifier image:[NSImage imageNamed:@"General.png"]]; + + [self addView:fontsAndColoursPrefsViewController.view label:fontIdentifier image:[NSImage imageNamed:@"General.png"]]; + +} + +/* + + - changeFont: + + */ +- (void)changeFont:(id)sender +{ + /* NSFontManager will send this method up the responder chain */ + [fontsAndColoursPrefsViewController changeFont:sender]; +} + +/* + + - revertToStandardSettings: + + */ +- (void)revertToStandardSettings:(id)sender +{ + [[MGSFragariaPreferences sharedInstance] revertToStandardSettings:sender]; +} + +/* + + - commitEditingAndDiscard: + + */ +- (BOOL)commitEditingAndDiscard:(BOOL)discard +{ + BOOL commit = YES; + + if ([toolbarIdentifier isEqual:textIdentifier]) { + if (![textEditingPrefsViewController commitEditingAndDiscard:discard]) { + commit = NO; + } + } else if ([toolbarIdentifier isEqual:fontIdentifier]) { + if (![fontsAndColoursPrefsViewController commitEditingAndDiscard:discard]) { + commit = NO; + } + + } else { + + // commit edits, discarding changes on error + if (![[NSUserDefaultsController sharedUserDefaultsController] commitEditing]) { + if (discard) [[NSUserDefaultsController sharedUserDefaultsController] discardEditing]; + commit = NO; + } + } + + return commit; +} + +/* + + - windowWillClose + + */ +- (void)windowWillClose:(NSNotification *)notification +{ + if ([notification object] != [self window]) { + return; + } + + // commit editing, discard any uncommitted changes + [self commitEditingAndDiscard:YES]; +} + + +/* + + - displayViewForIdentifier:animate: + + */ +- (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate +{ + // look for uncommitted changes + if (![self commitEditingAndDiscard:NO] && toolbarIdentifier) { + + // we have uncommited changes, reselect the tool bar item + [[[self window] toolbar] setSelectedItemIdentifier:toolbarIdentifier]; + } else { + [super displayViewForIdentifier:identifier animate:animate]; + } + + toolbarIdentifier = identifier; +} + +@end diff --git a/external/MGSFragaria/Preferences.xib b/external/MGSFragaria/Preferences.xib new file mode 100644 index 00000000..cede763f --- /dev/null +++ b/external/MGSFragaria/Preferences.xib @@ -0,0 +1,214 @@ + + + + 1060 + 12B19 + 2549 + 1187 + 624.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2549 + + + YES + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSUserDefaultsController + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + MGSPreferencesController + + + FirstResponder + + + NSApplication + + + YES + + + + 268 + + YES + + + 258 + {{66, 71}, {151, 32}} + + _NS:9 + YES + + 67108864 + 134217728 + Reset Editor Prefs + + LucidaGrande + 13 + 1044 + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + {271, 176} + + + _NS:9 + NSView + + + + + YES + + + revertToStandardSettings: + + + + 430 + + + + generalView + + + + 431 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 7 + + + Shared Defaults + + + 427 + + + YES + + + + + + 428 + + + YES + + + + + + 429 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 427.IBPluginDependency + 428.IBPluginDependency + 429.IBPluginDependency + 7.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 431 + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + +