// hit regions void KPR_canvasRenderingContext2D_addHitRegion(xsMachine *the) { FskCanvas2dContext ctx = xsGetHostData(xsThis); const char *id = NULL, *control = NULL; FskConstCanvas2dPath path = NULL; xsVars(1); xsEnterSandbox(); /* Enter sandbox to access the properties of an object */ xsFindString(xsArg(0), xsID("id"), &id); xsFindString(xsArg(0), xsID("control"), &control); if (xsHasOwn(xsArg(0), xsID("path"))) path = xsGetHostData(xsGet(xsArg(0), xsID("path"))); //xsFindString(xsArg(0), xsID("parentID"), &parentID); //xsFindString(xsArg(0), xsID("cursor"), &cursor); //xsFindString(xsArg(0), xsID("fillRule"), &fillRuleStr); //xsFindString(xsArg(0), xsID("label"), &label); //xsFindString(xsArg(0), xsID("role"), &label); xsLeaveSandbox(); (void)FskCanvas2dAddHitRegion(ctx, path, id, control); }
void KprDebugMachineLockView(KprDebugMachine self, int theView) { KprDebug debug = self->debug; xsMachine* the = debug->the; // FskDebugStr("%s: %d", __FUNCTION__, theView); if (xsTypeOf(debug->behavior) == xsUndefinedType) goto bail; { xsTry { xsVar(0) = xsAccess(debug->behavior); if (xsHasOwn(xsVar(0), xsID(self->address))) xsDelete(xsVar(0), xsID(self->address)); xsVar(1) = xsNewInstanceOf(xsArrayPrototype); xsNewHostProperty(xsVar(0), xsID(self->address), xsVar(1), xsDefault, xsDontScript); } xsCatch { } } bail: return; }
void KprDebugMachineCallback(KprDebugMachine machine, char* function) { KprDebug self = machine->debug; xsMachine* the = self->the; if (xsTypeOf(self->behavior) == xsUndefinedType) goto bail; { xsTry { xsVar(0) = xsAccess(self->behavior); if (xsFindResult(xsVar(0), xsID(function))) { if (xsHasOwn(xsVar(0), xsID(machine->address))) { xsVar(1) = xsGet(xsVar(0), xsID(machine->address)); xsDelete(xsVar(0), xsID(machine->address)); } (void)xsCallFunction2(xsResult, xsVar(0), xsString(machine->address), xsVar(1)); } } xsCatch { } } bail: return; }