Permalink
Browse files

Modifications for Gambit REPL v2.0 for iOS

  • Loading branch information...
feeley committed Jul 25, 2011
1 parent 4f42f83 commit 394beeb81e24ce90722b8798459a6405c17e8c23
Showing with 2,904 additions and 939 deletions.
  1. +130 −86 examples/iOS/AccessoryView.xib
  2. BIN examples/iOS/GambitREPL.xcodeproj.tgz
  3. +2 −2 examples/iOS/Info.plist
  4. +109 −232 examples/iOS/MainWindow.xib
  5. +2 −1 examples/iOS/README
  6. +1 −1 examples/iOS/ViewController.h
  7. +17 −7 examples/iOS/ViewController.m
  8. +94 −3 examples/iOS/ViewController.xib
  9. BIN examples/iOS/edit.png
  10. +15 −0 examples/iOS/html#.scm
  11. +331 −0 examples/iOS/html.scm
  12. +17 −0 examples/iOS/json#.scm
  13. +269 −0 examples/iOS/json.scm
  14. BIN examples/iOS/key-8ball-46x42.png
  15. BIN examples/iOS/key-comma-46x42.png
  16. BIN examples/iOS/key-doublequote-46x42.png
  17. BIN examples/iOS/key-edit-46x42.png
  18. BIN examples/iOS/key-empty-46x42.png
  19. BIN examples/iOS/key-f1-46x42.png
  20. BIN examples/iOS/key-f10-46x42.png
  21. BIN examples/iOS/key-f11-46x42.png
  22. BIN examples/iOS/key-f12-46x42.png
  23. BIN examples/iOS/key-f2-46x42.png
  24. BIN examples/iOS/key-f3-46x42.png
  25. BIN examples/iOS/key-f4-46x42.png
  26. BIN examples/iOS/key-f5-46x42.png
  27. BIN examples/iOS/key-f6-46x42.png
  28. BIN examples/iOS/key-f7-46x42.png
  29. BIN examples/iOS/key-f8-46x42.png
  30. BIN examples/iOS/key-f9-46x42.png
  31. BIN examples/iOS/key-heart-46x42.png
  32. BIN examples/iOS/key-lambda-46x42.png
  33. BIN examples/iOS/key-lparen-46x42.png
  34. BIN examples/iOS/key-minus-46x42.png
  35. BIN examples/iOS/key-note-46x42.png
  36. BIN examples/iOS/key-plus-46x42.png
  37. BIN examples/iOS/key-quote-46x42.png
  38. BIN examples/iOS/key-rocket-46x42.png
  39. BIN examples/iOS/key-rparen-46x42.png
  40. BIN examples/iOS/key-sharp-46x42.png
  41. BIN examples/iOS/key-star-46x42.png
  42. BIN examples/iOS/key-stop-46x42.png
  43. BIN examples/iOS/key-user-46x42.png
  44. +40 −0 examples/iOS/make-appstore-screenshots
  45. +139 −0 examples/iOS/make-keys
  46. +48 −31 examples/iOS/makefile.in
  47. +1,047 −576 examples/iOS/program.scm
  48. +16 −0 examples/iOS/url#.scm
  49. +139 −0 examples/iOS/url.scm
  50. +27 −0 examples/iOS/wiki#.scm
  51. +461 −0 examples/iOS/wiki.scm

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
View
@@ -28,13 +28,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>2.0</string>
<key>CFBundleSignature</key>
<string>GamC</string>
<key>CFBundleURLTypes</key>
<array/>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>2.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,6 +1,7 @@
This program implements the "Gambit REPL" application for iOS devices.
It is a simple development environment for Scheme. The user can
-interact with a REPL, and edit/save/run small scripts.
+interact with a REPL, edit/save/run small scripts, and upload
+scripts to a public script repository.
This example was tested with iOS 4.3 and XCode 4.0 . If you do not have
these versions, some adjustments will be needed at the top of the
@@ -17,7 +17,7 @@ void set_textView_font(NSString *name, int size);
void set_textView_content(NSString *str);
void add_output_to_textView(NSString *str);
void add_input_to_textView(NSString *str);
-void set_webView_content(NSString *str);
+void set_webView_content(NSString *str, BOOL enable_scaling, NSString *mime_type);
void open_URL(NSString *url);
void set_pref(NSString *key, NSString *value);
NSString *get_pref(NSString *key);
@@ -389,15 +389,18 @@ void add_input_to_textView(NSString *str) {
}
-void set_webView_content(NSString *str) {
+void set_webView_content(NSString *str, BOOL enable_scaling, NSString *mime_type) {
ViewController *vc = theViewController;
if (vc != nil)
{
[vc.webView
- loadHTMLString:str
+ loadData:[str dataUsingEncoding:NSUnicodeStringEncoding]
+ MIMEType:mime_type
+ textEncodingName:@"UTF-8"
baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]
];
+ vc.webView.scalesPageToFit = enable_scaling;
}
}
@@ -460,7 +463,9 @@ - (BOOL)textView:(UITextView *)textView2 shouldChangeTextInRange:(NSRange)range
___disable_heartbeat_interrupts ();
- [textView resignFirstResponder];
+#if 0
+ [textView resignFirstResponder]; // Hide the keyboard after "return" key is pressed
+#endif
}
else
add_to_textView(line);
@@ -486,10 +491,15 @@ - (IBAction)touch_down:(id)sender {
if (keyboardSounds != 0)
{
if (keyboardSounds == -1) // delayed check of user preferences?
- keyboardSounds =
- CFPreferencesGetAppBooleanValue(CFSTR("keyboard"),
- CFSTR("/var/mobile/Library/Preferences/com.apple.preferences.sounds"),
- NULL);
+ {
+ Boolean exists_and_valid;
+ keyboardSounds =
+ CFPreferencesGetAppBooleanValue(CFSTR("keyboard"),
+ CFSTR("/var/mobile/Library/Preferences/com.apple.preferences.sounds"),
+ &exists_and_valid);
+ if (!exists_and_valid)
+ keyboardSounds = true; // by default turn on keyboard clicks
+ }
if (keyboardSounds != 0)
AudioServicesPlaySystemSound(1104); // keyboard "tock" sound
@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1056</int>
- <string key="IBDocument.SystemVersion">10J567</string>
+ <string key="IBDocument.SystemVersion">10K540</string>
<string key="IBDocument.InterfaceBuilderVersion">1305</string>
- <string key="IBDocument.AppKitVersion">1038.35</string>
- <string key="IBDocument.HIToolboxVersion">462.00</string>
+ <string key="IBDocument.AppKitVersion">1038.36</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">300</string>
@@ -235,6 +235,19 @@
<string>touch_down:</string>
<string>touch_up_COMMA:</string>
<string>touch_up_DQUOTE:</string>
+ <string>touch_up_F10:</string>
+ <string>touch_up_F11:</string>
+ <string>touch_up_F12:</string>
+ <string>touch_up_F13:</string>
+ <string>touch_up_F1:</string>
+ <string>touch_up_F2:</string>
+ <string>touch_up_F3:</string>
+ <string>touch_up_F4:</string>
+ <string>touch_up_F5:</string>
+ <string>touch_up_F6:</string>
+ <string>touch_up_F7:</string>
+ <string>touch_up_F8:</string>
+ <string>touch_up_F9:</string>
<string>touch_up_LPAREN:</string>
<string>touch_up_MINUS:</string>
<string>touch_up_PLUS:</string>
@@ -257,6 +270,19 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
@@ -266,6 +292,19 @@
<string>touch_down:</string>
<string>touch_up_COMMA:</string>
<string>touch_up_DQUOTE:</string>
+ <string>touch_up_F10:</string>
+ <string>touch_up_F11:</string>
+ <string>touch_up_F12:</string>
+ <string>touch_up_F13:</string>
+ <string>touch_up_F1:</string>
+ <string>touch_up_F2:</string>
+ <string>touch_up_F3:</string>
+ <string>touch_up_F4:</string>
+ <string>touch_up_F5:</string>
+ <string>touch_up_F6:</string>
+ <string>touch_up_F7:</string>
+ <string>touch_up_F8:</string>
+ <string>touch_up_F9:</string>
<string>touch_up_LPAREN:</string>
<string>touch_up_MINUS:</string>
<string>touch_up_PLUS:</string>
@@ -289,6 +328,58 @@
<string key="name">touch_up_DQUOTE:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F10:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F11:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F12:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F13:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F1:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F2:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F3:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F4:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F5:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F6:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F7:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F8:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">touch_up_F9:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo">
<string key="name">touch_up_LPAREN:</string>
<string key="candidateClassName">id</string>
View
Binary file not shown.
View
@@ -0,0 +1,15 @@
+;;;============================================================================
+
+;;; File: "html#.scm"
+
+;;; Copyright (c) 2011 by Marc Feeley, All Rights Reserved.
+
+;;;============================================================================
+
+(##namespace ("html#"
+
+html-escape
+
+))
+
+;;;============================================================================
Oops, something went wrong.

0 comments on commit 394beeb

Please sign in to comment.