Sha256: daa416e5daa67ef686708146d37c8c980697824699957042d32b3dee0fc80b5c
Contents?: true
Size: 1.13 KB
Versions: 3
Compression:
Stored size: 1.13 KB
Contents
#import <CRuby.h> #import "RubySketch.h" #include "../src/ios/view_controller.h" static ReflexViewController* active_reflex_view_controller = nil; static ReflexViewController* ReflexViewController_create() { return active_reflex_view_controller; } static void ReflexViewController_show (UIViewController*, ReflexViewController*) { } @implementation RubySketch + (void) setup { static BOOL done = NO; if (done) return; done = YES; [CRuby addLibrary:@"RubySketch" bundle:[NSBundle bundleForClass:RubySketch.class]]; ReflexViewController_set_create_fun(ReflexViewController_create); ReflexViewController_set_show_fun(ReflexViewController_show); } + (void) start: (NSString*) path { [CRuby evaluate:[NSString stringWithFormat:@ "raise 'already started' unless require 'rubysketch-processing'\n" "load '%@'\n" "RUBYSKETCH_WINDOW.__send__ :end_draw\n" "RUBYSKETCH_WINDOW.show", path ]]; } + (void) setActiveReflexViewController: (id) reflexViewController { active_reflex_view_controller = reflexViewController; } + (void) resetActiveReflexViewController { active_reflex_view_controller = nil; } @end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubysketch-0.3.22 | src/RubySketch.mm |
rubysketch-0.3.21 | src/RubySketch.mm |
rubysketch-0.3.20 | src/RubySketch.mm |