Permalink
Browse files

Added intf#set-idle-timer to Gambit REPL app to control whether the d…

…evice is allowed to go to sleep.
  • Loading branch information...
1 parent 96f801c commit 039d42849114aa4f19b878405462f63bac54f789 @feeley feeley committed Feb 21, 2012
Showing with 11 additions and 2 deletions.
  1. +1 −0 examples/iOS/ViewController.h
  2. +4 −0 examples/iOS/ViewController.m
  3. +2 −1 examples/iOS/intf#.scm
  4. +3 −0 examples/iOS/intf.scm
  5. +1 −1 include/stamp.h
@@ -26,6 +26,7 @@ void set_webView_content(int view, NSString *str, NSString *base_url_path, BOOL
void set_webView_content_from_file(int view, NSString *path, NSString *base_url_path, BOOL enable_scaling, NSString *mime_type);
NSString *eval_js_in_webView(int view, NSString *script);
void open_URL(NSString *url);
+void set_idle_timer(BOOL enable);
void segm_ctrl_set_title(int segment, NSString *title);
void segm_ctrl_insert(int segment, NSString *title);
void segm_ctrl_remove(int segment);
@@ -618,6 +618,10 @@ void open_URL(NSString *url) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
+void set_idle_timer(BOOL enable) {
+
+ [UIApplication sharedApplication].idleTimerDisabled = !enable;
+}
void segm_ctrl_set_title(int segment, NSString *title) {
View
@@ -2,7 +2,7 @@
;;; File: "intf#.scm"
-;;; Copyright (c) 2011 by Marc Feeley, All Rights Reserved.
+;;; Copyright (c) 2011-2012 by Marc Feeley, All Rights Reserved.
;;;============================================================================
@@ -73,6 +73,7 @@ set-webView-content-from-file
eval-js-in-webView
open-URL
+set-idle-timer
segm-ctrl-set-title
segm-ctrl-insert
set-pref
View
@@ -422,6 +422,9 @@ c-declare-end
(define open-URL
(c-lambda (NSString*) void "open_URL"))
+(define set-idle-timer
+ (c-lambda (bool) void "set_idle_timer"))
+
(define segm-ctrl-set-title
(c-lambda (int NSString*) void "segm_ctrl_set_title"))
View
@@ -3,4 +3,4 @@
*/
#define ___STAMP_YMD 20120221
-#define ___STAMP_HMS 154311
+#define ___STAMP_HMS 170233

0 comments on commit 039d428

Please sign in to comment.