static JSValueRef isMarkerRangeEqualCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { if (argumentCount != 1) return JSValueMakeBoolean(context, false); JSObjectRef otherMarker = JSValueToObject(context, arguments[0], exception); return JSValueMakeBoolean(context, toTextMarkerRange(thisObject)->isEqual(toTextMarkerRange(otherMarker))); }
static JSValueRef endTextMarkerForTextMarkerRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { AccessibilityTextMarkerRange* markerRange = 0; if (argumentCount == 1) markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception)); return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->endTextMarkerForTextMarkerRange(markerRange)); }
static JSValueRef textMarkerRangeLengthCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { AccessibilityTextMarkerRange* range = 0; if (argumentCount == 1) range = toTextMarkerRange(JSValueToObject(context, arguments[0], exception)); return JSValueMakeNumber(context, (int)toAXElement(thisObject)->textMarkerRangeLength(range)); }
static void markerRangeFinalize(JSObjectRef thisObject) { delete toTextMarkerRange(thisObject); }