Skip to content

Commit

Permalink
moven' and grooven!
Browse files Browse the repository at this point in the history
  • Loading branch information
August Mueller committed Oct 14, 2009
1 parent c62d72f commit b65e793
Show file tree
Hide file tree
Showing 10 changed files with 1,345 additions and 340 deletions.
38 changes: 35 additions & 3 deletions jscocoa/JSCocoa/JSCocoaController.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -38,10 +38,33 @@ typedef struct JSValueRefAndContextRef JSValueRefAndContextRef;


JSGlobalContextRef ctx; JSGlobalContextRef ctx;
id _delegate; id _delegate;

//
// Safe dealloc
// - (void)dealloc cannot be overloaded as it is called during JS GC, which forbids new JS code execution.
// As the js dealloc method cannot be called, safe dealloc allows it to be executed during the next run loop cycle
// NOTE : upon destroying a JSCocoaController, safe dealloc is disabled
//
BOOL useSafeDealloc; BOOL useSafeDealloc;

//
// Split call
// Allows calling multi param ObjC messages with a jQuery-like syntax.
//
// obj.do({ this : 'hello', andThat : 'world' })
// instead of
// obj.dothis_andThat_('hello', 'world')
//
BOOL useSplitCall;

// JSLint : used for ObjJ syntax, class syntax, return if
BOOL useJSLint;
} }


@property (assign) id delegate; @property (assign) id delegate;
@property BOOL useSafeDealloc;
@property BOOL useSplitCall;
@property BOOL useJSLint;


- (id)init; - (id)init;
- (id)initWithGlobalContext:(JSGlobalContextRef)ctx; - (id)initWithGlobalContext:(JSGlobalContextRef)ctx;
Expand Down Expand Up @@ -101,6 +124,17 @@ typedef struct JSValueRefAndContextRef JSValueRefAndContextRef;
- (id)instanceStats; - (id)instanceStats;
+ (void)logBoxedObjects; + (void)logBoxedObjects;


//
// Class inspection (shortcuts to JSCocoaLib)
//
+ (id)rootclasses;
+ (id)classes;
+ (id)protocols;
+ (id)imageNames;
+ (id)methods;
+ (id)runtimeReport;
+ (id)explainMethodEncoding:(id)encoding;

// //
// Class handling // Class handling
// //
Expand Down Expand Up @@ -140,8 +174,6 @@ typedef struct JSValueRefAndContextRef JSValueRefAndContextRef;


- (BOOL)useAutoCall; - (BOOL)useAutoCall;
- (void)setUseAutoCall:(BOOL)b; - (void)setUseAutoCall:(BOOL)b;
- (BOOL)useSafeDealloc;
- (void)setUseSafeDealloc:(BOOL)b;


- (const char*)typeEncodingOfMethod:(NSString*)methodName class:(NSString*)className; - (const char*)typeEncodingOfMethod:(NSString*)methodName class:(NSString*)className;
+ (const char*)typeEncodingOfMethod:(NSString*)methodName class:(NSString*)className; + (const char*)typeEncodingOfMethod:(NSString*)methodName class:(NSString*)className;
Expand Down Expand Up @@ -193,7 +225,7 @@ typedef struct JSValueRefAndContextRef JSValueRefAndContextRef;
// Custom handler for calling // Custom handler for calling
// Return YES to indicate you handled calling // Return YES to indicate you handled calling
// Return NO to let JSCocoa handle calling // Return NO to let JSCocoa handle calling
- (JSValueRef) JSCocoa:(JSCocoaController*)controller callMethod:(NSString*)methodName ofObject:(id)object argumentCount:(int)argumentCount arguments:(JSValueRef*)arguments inContext:(JSContextRef)ctx exception:(JSValueRef*)exception; - (JSValueRef) JSCocoa:(JSCocoaController*)controller callMethod:(NSString*)methodName ofObject:(id)callee privateObject:(JSCocoaPrivateObject*)thisPrivateObject argumentCount:(int)argumentCount arguments:(JSValueRef*)arguments inContext:(JSContextRef)localCtx exception:(JSValueRef*)exception;


// //
// Getting global properties (classes, structures, C function names, enums via OSXObject_getProperty) // Getting global properties (classes, structures, C function names, enums via OSXObject_getProperty)
Expand Down
Loading

0 comments on commit b65e793

Please sign in to comment.