39static JSBool
FlasherGetProperty(JSContext *context, JSObject *
this, jsid propID, jsval *value);
40static JSBool
FlasherSetProperty(JSContext *context, JSObject *
this, jsid propID, JSBool strict, jsval *value);
42static JSBool
FlasherRemove(JSContext *context, uintN argc, jsval *vp);
58 JSCLASS_NO_OPTIONAL_MEMBERS
111 if (outEntity == NULL)
return NO;
114 result = OOJSEntityGetEntity(context, jsobj, &entity);
115 if (!result)
return NO;
126@implementation OOFlasherEntity (OOJavaScriptExtensions)
128- (void)getJSClass:(JSClass **)outClass andPrototype:(JSObject **)outPrototype
150 if (!JSID_IS_INT(propID))
return YES;
158 if (entity ==
nil) { *value = JSVAL_VOID;
return YES; }
160 switch (JSID_TO_INT(propID))
171 return JS_NewNumberValue(context, [entity frequency], value);
174 return JS_NewNumberValue(context, [entity fraction], value);
177 return JS_NewNumberValue(context, [entity phase], value);
180 return JS_NewNumberValue(context, [entity diameter], value);
194static JSBool
FlasherSetProperty(JSContext *context, JSObject *
this, jsid propID, JSBool strict, jsval *value)
196 if (!JSID_IS_INT(propID))
return YES;
206 if (entity ==
nil)
return YES;
208 switch (JSID_TO_INT(propID))
211 if (JS_ValueToBoolean(context, *value, &bValue))
220 if (colorForScript !=
nil || JSVAL_IS_NULL(*value))
228 if (JS_ValueToNumber(context, *value, &fValue))
239 if (JS_ValueToNumber(context, *value, &fValue))
241 if (fValue > 0.0 && fValue <= 1.0)
250 if (JS_ValueToNumber(context, *value, &fValue))
258 if (JS_ValueToNumber(context, *value, &fValue))
282#define GET_THIS_FLASHER(THISENT) do { \
283 if (EXPECT_NOT(!JSFlasherGetFlasherEntity(context, OOJS_THIS, &THISENT))) return NO; \
284 if (OOIsStaleEntity(THISENT)) OOJS_RETURN_VOID; \
#define OOJS_PROFILE_EXIT
#define OOJS_NATIVE_ENTER(cx)
#define OOJS_PROFILE_ENTER
OOINLINE JSClass * JSEntityClass(void)
OOINLINE JSObject * JSEntityPrototype(void)
static JSBool FlasherGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
static JSPropertySpec sFlasherProperties[]
static JSObject * sFlasherPrototype
static JSFunctionSpec sFlasherMethods[]
static JSBool FlasherSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value)
static BOOL JSFlasherGetFlasherEntity(JSContext *context, JSObject *jsobj, OOFlasherEntity **outEntity)
static JSBool FlasherRemove(JSContext *context, uintN argc, jsval *vp)
#define GET_THIS_FLASHER(THISENT)
static JSClass sFlasherClass
void InitOOJSFlasher(JSContext *context, JSObject *global)
#define OOJS_PROP_READWRITE_CB
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
void OOJSObjectWrapperFinalize(JSContext *context, JSObject *this)
void OOJSReportBadPropertySelector(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
void OOJSRegisterSubclass(JSClass *subclass, JSClass *superclass)
OOINLINE jsval OOJSValueFromBOOL(int b) INLINE_CONST_FUNC
void OOJSReportBadPropertyValue(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec, jsval value)
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)
NSString * oo_jsClassName()
BOOL isVisibleToScripts()
OOColor * colorWithDescription:(id description)
NSArray * normalizedArray()
void setPhase:(float phase)
void setFrequency:(float frequency)
void setActive:(BOOL active)
void setFraction:(float fraction)
void setColor:(OOColor *color)
void setDiameter:(float diameter)