diff --git a/tools/Quickdev16/AppController.h b/tools/Quickdev16/AppController.h new file mode 100644 index 0000000..e3f86cd --- /dev/null +++ b/tools/Quickdev16/AppController.h @@ -0,0 +1,19 @@ +#import + +@interface AppController : NSObject { + IBOutlet NSTextField *textField; + IBOutlet NSColorWell *colorWell; + IBOutlet NSButton *stopButton; + IBOutlet NSTableView *tableView; + NSSpeechSynthesizer *speechSynth; +} +- (IBAction)sayIt:(id)sender; +- (IBAction)stopIt:(id)sender; +- (IBAction)changeTextColor:(id)sender; +- (void)speechSynthesizer:(NSSpeechSynthesizer *)send + didFinishSpeaking:(BOOL)finishedSpeaking; +- (int)numberOfRowsInTableView:(NSTableView *) aTableView; +-(id)tableView:(NSTableView*) aTableView +objectValueForTableColumn:(NSTableColumn *) aTableColumn row:(int)row; + +@end diff --git a/tools/Quickdev16/AppController.m b/tools/Quickdev16/AppController.m new file mode 100644 index 0000000..887e434 --- /dev/null +++ b/tools/Quickdev16/AppController.m @@ -0,0 +1,106 @@ +#import "AppController.h" + +@implementation AppController +- (id) init { + [super init]; + NSLog(@"init"); + speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil]; + [speechSynth setDelegate:self]; + return self; +} + +- (void)awakeFromNib{ + NSColor *initialColor = [ textField textColor]; + NSLog(@"setting init color %@",initialColor); + [colorWell setColor:initialColor]; + NSString *defaultVoice = [NSSpeechSynthesizer defaultVoice]; + NSArray *voices = [NSSpeechSynthesizer availableVoices]; + int defaultRow = [voices indexOfObject:defaultVoice]; + [tableView selectRow:defaultRow byExtendingSelection:NO]; + [tableView scrollRowToVisible:defaultRow]; + +} +- (IBAction)sayIt:(id)sender { + NSString *string = [textField stringValue]; + if ( [string length] == 0) { + NSLog(@"No message"); + return; + } + [speechSynth startSpeakingString:string]; + NSLog(@"Have started speaking: %@", string); + [stopButton setEnabled:YES]; +} + +- (IBAction)stopIt:(id)sender { + NSLog(@"stopping"); + [speechSynth stopSpeaking]; + +} + +- (void)speechSynthesizer:(NSSpeechSynthesizer *)send + didFinishSpeaking:(BOOL)finishedSpeaking +{ + NSLog(@"didFinished=%d",finishedSpeaking); + [stopButton setEnabled:NO]; + +} + + +- (IBAction)changeTextColor:(id)sender{ + NSColor *newColor = [sender color]; + NSLog(@"Change Color %@",newColor); + [textField setTextColor:newColor]; + +} + +- (int)numberOfRowsInTableView:(NSTableView *) aTableView{ + NSLog(@"numberOfRowsInTableView %d", [[NSSpeechSynthesizer availableVoices] count]); + + return [[NSSpeechSynthesizer availableVoices] count]; +} +-(id)tableView:(NSTableView*) aTableView + objectValueForTableColumn:(NSTableColumn *) aTableColumn row:(int)row{ + NSString *voice = [[NSSpeechSynthesizer availableVoices] objectAtIndex:row ]; + return [[NSSpeechSynthesizer attributesForVoice:voice] valueForKey:NSVoiceName]; +} + +- (void)tableViewSelectionDidChange:(NSNotification *)nofication{ + NSArray *availableVoices = [NSSpeechSynthesizer availableVoices]; + int row = [tableView selectedRow]; + if ( row == -1) { + return; + } + + NSString *selectedVoice = [availableVoices objectAtIndex:row]; + [speechSynth setVoice:selectedVoice]; + NSLog(@"new voice=%@",selectedVoice); +} + +-(BOOL)selectionShouldChangeInTableView:(NSTableView *) aTableView +{ + if ([speechSynth isSpeaking]){ + NSBeep(); + return NO; + } else { + return YES; + } +} + +-(NSSize)windowWillResize:(NSWindow *)send toSize:(NSSize) framesize; +{ + float w = framesize.width; + float h = framesize.height; + NSLog(@"called willResize %f x %f ",w,h); + + w = w*2; + framesize.width = w; + return framesize; +} + +- (void) dealloc { + NSLog(@"dealloc"); + [speechSynth release]; + [super dealloc]; + +} +@end diff --git a/tools/Quickdev16/English.lproj/MainMenu.xib b/tools/Quickdev16/English.lproj/MainMenu.xib index b8e74af..0b266a0 100644 --- a/tools/Quickdev16/English.lproj/MainMenu.xib +++ b/tools/Quickdev16/English.lproj/MainMenu.xib @@ -13,7 +13,6 @@ YES - YES @@ -1318,21 +1317,21 @@ 263 2 - {{157, 191}, {480, 270}} + {{157, -335}, {504, 796}} 611844096 Quickdev16 NSWindow {1.79769e+308, 1.79769e+308} - + 256 YES 12 - {{13, 5}, {454, 213}} + {{13, 531}, {454, 213}} YES @@ -1441,7 +1440,7 @@ 268 - {{20, 248}, {106, 23}} + {{20, 774}, {106, 23}} YES @@ -1461,7 +1460,7 @@ 268 - {{20, 219}, {106, 23}} + {{20, 745}, {106, 23}} YES @@ -1481,7 +1480,7 @@ 268 - {{354, 248}, {106, 23}} + {{354, 774}, {106, 23}} YES @@ -1499,8 +1498,7 @@ - {480, 270} - + {504, 796} {{0, 0}, {1440, 878}} {1.79769e+308, 1.79769e+308} @@ -3610,7 +3608,6 @@ 588.IBPluginDependency 589.IBPluginDependency 590.IBPluginDependency - 591.IBPluginDependency 72.IBPluginDependency 72.ImportedFromIB2 73.IBPluginDependency @@ -3849,9 +3846,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{338, 221}, {480, 270}} + {{936, 60}, {504, 796}} com.apple.InterfaceBuilder.CocoaPlugin - {{338, 221}, {480, 270}} + {{936, 60}, {504, 796}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3878,7 +3875,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin diff --git a/tools/Quickdev16/Quickdev16.xcodeproj/david.pbxuser b/tools/Quickdev16/Quickdev16.xcodeproj/david.pbxuser index fb07d76..98c37d4 100644 --- a/tools/Quickdev16/Quickdev16.xcodeproj/david.pbxuser +++ b/tools/Quickdev16/Quickdev16.xcodeproj/david.pbxuser @@ -63,6 +63,21 @@ userBuildSettings = { }; }; + 631A51A6104CF59900E73564 /* AppController.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {593, 449}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 614}"; + }; + }; + 631A51A9104CF5B700E73564 /* AppController.m */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {933, 1261}}"; + sepNavSelRange = "{782, 0}"; + sepNavVisRange = "{597, 1402}"; + sepNavWindowFrame = "{{15, 60}, {992, 818}}"; + }; + }; 631E1874104C5D72001A8B18 /* Quickdev16 */ = { isa = PBXExecutable; activeArgIndices = ( diff --git a/tools/Quickdev16/Quickdev16.xcodeproj/project.pbxproj b/tools/Quickdev16/Quickdev16.xcodeproj/project.pbxproj index 3f37da7..2b2e569 100644 --- a/tools/Quickdev16/Quickdev16.xcodeproj/project.pbxproj +++ b/tools/Quickdev16/Quickdev16.xcodeproj/project.pbxproj @@ -9,8 +9,8 @@ /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 256AC3DA0F4B6AC300CF3369 /* Quickdev16AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* Quickdev16AppDelegate.m */; }; - 631A5181104CF44F00E73564 /* BGHUDAppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 631A5180104CF44F00E73564 /* BGHUDAppKit.framework */; }; 631A51AA104CF5B700E73564 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 631A51A9104CF5B700E73564 /* AppController.m */; }; + 631A5252104CF9FB00E73564 /* BGHUDAppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 631A5251104CF9FB00E73564 /* BGHUDAppKit.framework */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; @@ -27,9 +27,9 @@ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 631A5180104CF44F00E73564 /* BGHUDAppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BGHUDAppKit.framework; path = /Users/david/Devel/arch/osx/code/BGHUDAppKit/BGHUDAppKit.framework; sourceTree = ""; }; 631A51A6104CF59900E73564 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 631A51A9104CF5B700E73564 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; + 631A5251104CF9FB00E73564 /* BGHUDAppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BGHUDAppKit.framework; path = /Users/david/Devel/arch/osx/code/BGHUDAppKit/build/Release/BGHUDAppKit.framework; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Quickdev16-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Quickdev16-Info.plist"; sourceTree = ""; }; 8D1107320486CEB800E47090 /* Quickdev16.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Quickdev16.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -40,7 +40,7 @@ buildActionMask = 2147483647; files = ( 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 631A5181104CF44F00E73564 /* BGHUDAppKit.framework in Frameworks */, + 631A5252104CF9FB00E73564 /* BGHUDAppKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -120,7 +120,7 @@ children = ( 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - 631A5180104CF44F00E73564 /* BGHUDAppKit.framework */, + 631A5251104CF9FB00E73564 /* BGHUDAppKit.framework */, ); name = Frameworks; sourceTree = ""; @@ -216,6 +216,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../../../../osx/code/BGHUDAppKit\"", + "\"$(SRCROOT)/../../../../../osx/code/BGHUDAppKit/build/Release\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -237,6 +238,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../../../../osx/code/BGHUDAppKit\"", + "\"$(SRCROOT)/../../../../../osx/code/BGHUDAppKit/build/Release\"", ); GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/cdecls.pbxbtree b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/cdecls.pbxbtree index 7618624..4c2cc5d 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/cdecls.pbxbtree and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/cdecls.pbxbtree differ diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/decls.pbxbtree b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/decls.pbxbtree index d147bc2..1d07e1a 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/decls.pbxbtree and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/decls.pbxbtree differ diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/pbxindex.header b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/pbxindex.header index ed055c3..64dab04 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/pbxindex.header and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/pbxindex.header differ diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/refs.pbxbtree b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/refs.pbxbtree index 5d0cb6e..3cced43 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/refs.pbxbtree and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/refs.pbxbtree differ diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/strings.pbxstrings/control b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/strings.pbxstrings/control index 97427ac..c2d0bb4 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/strings.pbxstrings/control and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/strings.pbxstrings/control differ diff --git a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/symbols0.pbxsymbols b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/symbols0.pbxsymbols index b0bb92f..762cd51 100644 Binary files a/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/symbols0.pbxsymbols and b/tools/Quickdev16/build/Quickdev16.build/Quickdev16.pbxindex/symbols0.pbxsymbols differ