Ejemplo n.º 1
0
void
_gum_jsc_polyfill_init (GumJscPolyfill * self,
                        GumJscCore * core,
                        JSObjectRef scope)
{
  JSContextRef ctx = core->ctx;
  JSClassDefinition def;
  JSClassRef klass;
  JSObjectRef module;

  self->core = core;

  def = kJSClassDefinitionEmpty;
  def.className = "ProxyModule";
  def.staticFunctions = gumjs_proxy_module_functions;
  klass = JSClassCreate (&def);
  module = JSObjectMake (ctx, klass, self);
  JSClassRelease (klass);
  _gumjs_object_set (ctx, scope, "Proxy", module);

  def = kJSClassDefinitionEmpty;
  def.attributes = kJSClassAttributeNoAutomaticPrototype;
  def.className = "Proxy";
  def.finalize = gumjs_proxy_finalize;
  def.hasProperty = gumjs_proxy_has_property;
  def.getProperty = gumjs_proxy_get_property;
  def.setProperty = gumjs_proxy_set_property;
  def.getPropertyNames = gumjs_proxy_get_property_names;
  self->proxy = JSClassCreate (&def);
}
Ejemplo n.º 2
0
static void window_object_cleared__(
	WebKitWebView  *wv,
	WebKitWebFrame *wf,
	JSGlobalContextRef ctx,
	gpointer        window_object,
	gpointer        user_data)
{
	const char* name0 = "z$";
	JSStringRef name = JSStringCreateWithUTF8CString(name0);

	JSObjectRef func;
	//func = JSObjectMakeFunctionWithCallback(ctx, name, zs__);
	{
		JSClassDefinition cd = kJSClassDefinitionEmpty;
		cd.className = name0;
		cd.callAsFunction = zs__;
		JSClassRef cr = JSClassCreate (&cd);
		func = JSObjectMake (ctx, cr, NULL);
	}

	JSObjectRef o = JSContextGetGlobalObject(ctx);
	JSObjectSetProperty(ctx, o, name, func, kJSPropertyAttributeNone, NULL);
	JSStringRelease(name);
	/*bool b=*/JSObjectSetPrivate(func, (void*)webkit_view___::from__(wv));
}
Ejemplo n.º 3
0
void Java_com_vasco_digipass_sdk_smartfaceplugin_PluginImp_initNative(JNIEnv *env, jobject thiz,jlong jsContext,jlong envMap)
{
	long jscontextlong = (long)jsContext;
	DPPlugin* instance = DPPlugin::getInstance();
	instance->jsContext = (JSContextRef)jsContext;
	instance->envMap = (std::map<long,JNIEnv*>*)envMap;
	instance->pluginImpObject = env->NewGlobalRef(thiz);
    jclass clazz = env->GetObjectClass(thiz);
    jmethodID initMethod = env->GetMethodID(clazz,"init","(Ljava/lang/String;)V");
    jstring fingerprint = env->NewStringUTF(DBFINGERPRINT);
    env->CallVoidMethod(thiz,initMethod,fingerprint);
    env->DeleteLocalRef(fingerprint);
    instance->getBytes = env->GetMethodID(clazz,"getBytes","(Ljava/lang/String;)[B");
    instance->putBytes = env->GetMethodID(clazz,"putBytes","(Ljava/lang/String;Ljava/lang/String;[B)Z");
    instance->initializeRegistrationDataV2JavaFunction = env->GetMethodID(clazz,"initializeRegistrationDataV2","(Ljava/lang/String;[Z)Ljava/lang/String;");
    instance->decryptActivationDataJavaFunction = env->GetMethodID(clazz,"decryptActivationData","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Z)Ljava/lang/String;");
    instance->validateSharedDataChecksumJavaFunction = env->GetMethodID(clazz,"validateSharedDataChecksum","(Ljava/lang/String;[Z)Ljava/lang/String;");
    env->DeleteLocalRef(clazz);
    JSStringRef str = JSStringCreateWithUTF8CString("VASCO");
	JSClassRef classDef = JSClassCreate(&spjsdpplugin_def);
	JSObjectRef classObj = JSObjectMake(instance->jsContext, classDef, (void*)DPPlugin::getInstance());
	JSObjectSetProperty(instance->jsContext, JSContextGetGlobalObject(instance->jsContext), str, classObj, kJSPropertyAttributeNone, NULL);
    JSClassRelease(classDef);
	JSStringRelease(str);
}
Ejemplo n.º 4
0
void
cltimer_initilize(ScriptContext *sctx) {
    /** 
     * Constructs a new Timer.
     *
     * @name Timer
     * @class 
     *      A timer object for measuring time, e.g. for debugging purposes
     * @since 1.10
     * */

    JSStaticValue gtimer_values[] = {
        { "elapsed",                 gtimer_elapsed,        NULL, kJSDefaultAttributes }, 
        { 0, 0, 0, 0 }, 
    };
    JSStaticFunction gtimer_functions[] = {
        { "start",              gtimer_start,       kJSDefaultAttributes }, 
        { "stop",               gtimer_stop,        kJSDefaultAttributes }, 
        { "continue",           gtimer_continue,    kJSDefaultAttributes }, 
        { "reset",              gtimer_reset,       kJSDefaultAttributes }, 
        { 0, 0, 0 }, 
    };

    JSClassDefinition cd = kJSClassDefinitionEmpty;
    cd.className = "Timer";
    cd.staticFunctions = gtimer_functions;
    cd.staticValues = gtimer_values;
    cd.finalize = finalize;
    sctx->classes[CLASS_TIMER] = JSClassCreate(&cd);
    sctx->constructors[CONSTRUCTOR_TIMER] = scripts_create_constructor(sctx->global_context, "Timer", sctx->classes[CLASS_TIMER], gtimer_construtor_cb, NULL);
}
Ejemplo n.º 5
0
JSClassRef AccessibilityController::getJSClass()
{
    static JSStaticFunction staticFunctions[] = {
        { "logFocusEvents", logFocusEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "logValueChangeEvents", logValueChangeEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "logScrollingStartEvents", logScrollingStartEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "elementAtPoint", getElementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0 }
    };

    static JSStaticValue staticValues[] = {
        { "focusedElement", getFocusedElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "rootElement", getRootElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0, 0 }
    };

    static JSClassDefinition classDefinition = {
        0, kJSClassAttributeNone, "AccessibilityController", 0, staticValues, staticFunctions,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };

    static JSClassRef ref = 0;
    if (!ref)
        ref = JSClassCreate(&classDefinition);
    else
        JSClassRetain(ref);

    return ref;
}
Ejemplo n.º 6
0
JSClassRef AccessibilityController::getJSClass()
{
    static JSStaticFunction staticFunctions[] = {
        { "logFocusEvents", logFocusEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "logValueChangeEvents", logValueChangeEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "logScrollingStartEvents", logScrollingStartEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "logAccessibilityEvents", logAccessibilityEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "elementAtPoint", getElementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "accessibleElementById", getAccessibleElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "addNotificationListener", addNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "removeNotificationListener", removeNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "enableEnhancedAccessibility", enableEnhancedAccessibilityCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0 }
    };

    static JSStaticValue staticValues[] = {
        { "focusedElement", getFocusedElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "rootElement", getRootElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "enhancedAccessibilityEnabled", getEnhancedAccessibilityEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "platformName", getPlatformNameCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0, 0 }
    };

    static JSClassDefinition classDefinition = {
        0, kJSClassAttributeNone, "AccessibilityController", 0, staticValues, staticFunctions,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };

    return JSClassCreate(&classDefinition);
}
Ejemplo n.º 7
0
pdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx)
{
	pdf_jsimp *imp = fz_malloc_struct(ctx, pdf_jsimp);

	fz_try(ctx)
	{
		JSClassDefinition classDef = kJSClassDefinitionEmpty;

		classDef.getProperty = getProperty;
		classDef.setProperty = setProperty;

		imp->nat_ctx = jsctx;
		imp->class_ref = JSClassCreate(&classDef);
		imp->jscore_ctx = JSGlobalContextCreate(imp->class_ref);
		if (imp->jscore_ctx == NULL)
			fz_throw(ctx, FZ_ERROR_GENERIC, "JSGlobalContextCreate failed");
	}
	fz_catch(ctx)
	{
		pdf_drop_jsimp(imp);
		fz_rethrow(ctx);
	}

	imp->ctx = ctx;

	return imp;
}
Ejemplo n.º 8
0
void
_gum_jsc_process_init (GumJscProcess * self,
                       GumJscCore * core,
                       JSObjectRef scope)
{
  JSContextRef ctx = core->ctx;
  JSClassDefinition def;
  JSClassRef klass;
  JSObjectRef process;

  self->core = core;

  def = kJSClassDefinitionEmpty;
  def.className = "Process";
  def.staticFunctions = gumjs_process_functions;
  klass = JSClassCreate (&def);
  process = JSObjectMake (ctx, klass, self);
  JSClassRelease (klass);

  _gumjs_object_set_string (ctx, process, "arch", GUM_SCRIPT_ARCH);
  _gumjs_object_set_string (ctx, process, "platform", GUM_SCRIPT_PLATFORM);
  _gumjs_object_set_uint (ctx, process, "pageSize", gum_query_page_size ());
  _gumjs_object_set_uint (ctx, process, "pointerSize", GLIB_SIZEOF_VOID_P);

  _gumjs_object_set (ctx, scope, def.className, process);
}
	static void create(JSContextRef ctx, JSObjectRef global) {
		JSClassDefinition classDefinition = kJSClassDefinitionEmpty;
		classDefinition.callAsConstructor = classConstructor;
		JSClassRef clsRef = JSClassCreate(&classDefinition);
		JSObjectRef classDef = JSObjectMake(ctx, clsRef, NULL);
		JSStringRef className = JSStringCreateWithUTF8CString("ManipulationDeltaEventHandler");
		JSObjectSetProperty(ctx, global, className, classDef, kJSPropertyAttributeNone, NULL);
	}
Ejemplo n.º 10
0
static JSClassRef MyObject_class(JSContextRef context)
{
    static JSClassRef jsClass;
    if (!jsClass)
        jsClass = JSClassCreate(&MyObject_definition);
    
    return jsClass;
}
Ejemplo n.º 11
0
Instance::Instance(JNIEnv *env, jobject thiz, JSContextRef ctx) {
	env->GetJavaVM(&jvm);
	JSClassDefinition definition = kJSClassDefinitionEmpty;
	definition.finalize = StaticFinalizeCallback;
	classRef = JSClassCreate(&definition);
	this->thiz = env->NewGlobalRef(thiz);
	objRef = JSObjectMake((JSContextRef) ctx, (JSClassRef) NULL, NULL);
	objMap[objRef] = this;
}
Ejemplo n.º 12
0
JSClassRef QtBuiltinBundlePage::navigatorQtObjectClass()
{
    static JSClassRef classRef = 0;
    if (!classRef) {
        const JSClassDefinition navigatorQtObjectClass = kJSClassDefinitionEmpty;
        classRef = JSClassCreate(&navigatorQtObjectClass);
    }
    return classRef;
}
JNIEXPORT jintLong JNICALL WebKit_win32_NATIVE(JSClassCreate)
	(JNIEnv *env, jclass that, jintLong arg0)
{
	jintLong rc = 0;
	WebKit_win32_NATIVE_ENTER(env, that, JSClassCreate_FUNC);
	rc = (jintLong)JSClassCreate((const JSClassDefinition*)arg0);
	WebKit_win32_NATIVE_EXIT(env, that, JSClassCreate_FUNC);
	return rc;
}
Ejemplo n.º 14
0
static JSClassRef EmptyObject_class(JSContextRef context)
{
    UNUSED_PARAM(context);
    
    static JSClassRef jsClass;
    if (!jsClass)
        jsClass = JSClassCreate(&EmptyObject_definition);
    
    return jsClass;
}
Ejemplo n.º 15
0
Function::Function(JNIEnv* env, jobject thiz, JSContextRef ctx, JSStringRef name) {
	env->GetJavaVM(&jvm);
	definition = kJSClassDefinitionEmpty;
	definition.callAsFunction = StaticFunctionCallback;
	definition.callAsConstructor = StaticConstructorCallback;
	classRef = JSClassCreate(&definition);

	this->thiz = env->NewGlobalRef(thiz);
	objRef = JSObjectMake(ctx, classRef, NULL);
	objMap[objRef] = this;
}
Ejemplo n.º 16
0
JSClassRef RJSCreateWrapperClass(const char * name, JSObjectGetPropertyCallback getter = NULL, JSObjectSetPropertyCallback setter = NULL, const JSStaticFunction *funcs = NULL,
                                 JSObjectGetPropertyNamesCallback propertyNames = NULL) {
    JSClassDefinition classDefinition = kJSClassDefinitionEmpty;
    classDefinition.className = name;
    classDefinition.finalize = RJSFinalize<T>;
    classDefinition.getProperty = getter;
    classDefinition.setProperty = setter;
    classDefinition.staticFunctions = funcs;
    classDefinition.getPropertyNames = propertyNames;
    return JSClassCreate(&classDefinition);
}
Ejemplo n.º 17
0
static JSClassRef GetGenericConstructorClassRef()
{
	static JSClassRef sGenericConstructorClassRef = NULL;
	if (sGenericConstructorClassRef == NULL)
	{
		JSClassDefinition def = kJSClassDefinitionEmpty;
		def.className = "GenericConstructor";
		def.callAsConstructor = GenericConstructor_callAsConstructor;
		sGenericConstructorClassRef = JSClassCreate( &def);
	}
	return sGenericConstructorClassRef;
}
JSClassRef TextInputController::getJSClass()
{
    static JSStaticValue* staticValues = TextInputController::staticValues();
    static JSStaticFunction* staticFunctions = TextInputController::staticFunctions();
    static JSClassDefinition classDefinition = 
    {
        0, kJSClassAttributeNone, "TextInputController", 0, staticValues, staticFunctions,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };

    return JSClassCreate(&classDefinition);
}
Ejemplo n.º 19
0
static JSClassRef getClass(JSContextRef context) {
    static JSClassRef eventSenderClass = 0;

    if (!eventSenderClass) {
        JSClassDefinition classDefinition = {0};
        classDefinition.staticFunctions = staticFunctions;
        classDefinition.staticValues = staticValues;

        eventSenderClass = JSClassCreate(&classDefinition);
    }

    return eventSenderClass;
}
Ejemplo n.º 20
0
JSClassDefinition *
seed_get_signal_class (void)
{
  JSClassDefinition signal_holder = kJSClassDefinitionEmpty;

  signal_holder.className = "gobject_signals";
  signal_holder.getProperty = seed_signal_holder_get_property;
  signal_holder.staticFunctions = signal_holder_static_functions;
  signal_holder_class = JSClassCreate (&signal_holder);
  JSClassRetain (signal_holder_class);

  return &gobject_signal_def;
}
Ejemplo n.º 21
0
static JSClassRef Base_class(JSContextRef context)
{
    static JSClassRef jsClass;
    if (!jsClass) {
        JSClassDefinition definition = kJSClassDefinitionEmpty;
        definition.staticValues = Base_staticValues;
        definition.staticFunctions = Base_staticFunctions;
        definition.initialize = Base_initialize;
        definition.finalize = Base_finalize;
        jsClass = JSClassCreate(&definition);
    }
    return jsClass;
}
Ejemplo n.º 22
0
//interface
MDNativeBindingInterface::MDNativeBindingInterface(JSNativeInterface *nativeInterface)
{

    ASSERT(nativeInterface);

    memset(&m_jsClass, 0x0, sizeof(m_jsClass));

    m_jsClass.className = nativeInterface->name;
    m_jsClass.staticFunctions = static_cast<JSStaticFunction*>(nativeInterface->method);
    m_jsClass.staticValues = nativeInterface->property;

    m_classRef = JSClassCreate(&m_jsClass);
}
Ejemplo n.º 23
0
JSClassRef NativeFunctionWithRetvalClass() {
  static JSClassRef instance = nullptr;
  if (!instance) {
    JSClassDefinition def;
    memset(&def, 0, sizeof(def));
    def.className = "NativeFunctionWithRetval";
    def.attributes = kJSClassAttributeNone;
    def.callAsFunction = NativeFunctionWithRetvalCallback;
    def.finalize = NativeFunctionWithRetvalFinalize;
    instance = JSClassCreate(&def);
  }
  return instance;
}
Ejemplo n.º 24
0
/**
 * return a void pointer
 */
EXPORTAPI JSObjectRef HyperloopVoidPointerToJSValue(JSContextRef ctx, void *pointer, JSValueRef *exception)
{
    static JSClassRef ref = nullptr;
    if (ref==nullptr)
    {
        JSClassDefinition def = kJSClassDefinitionEmpty;
        def.finalize = Finalizer;
        def.initialize = Initializer;
        def.className = "void *";
        ref = JSClassCreate(&def);
    }
    return JSObjectMake(ctx, ref, new Hyperloop::NativeObject<void *>(pointer));
}
Ejemplo n.º 25
0
//Caches and returns the JSShape class.
JSClassRef JSFeature_class(JSContextRef ctx)
{
    static JSClassRef jsClass;
    if (!jsClass) {
        JSClassDefinition classDefinition = kJSClassDefinitionEmpty;
        classDefinition.initialize = JSFeature_initialize;
        classDefinition.finalize = JSFeature_finalize;
        classDefinition.getProperty = JSFeature_getProperty;
        
        jsClass = JSClassCreate(&classDefinition);
    }
    
    return jsClass;
}
Ejemplo n.º 26
0
void installGlobalProxy(
    JSGlobalContextRef ctx,
    const char* name,
    JSObjectGetPropertyCallback callback) {
  JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty;
  proxyClassDefintion.className = "_FBProxyClass";
  proxyClassDefintion.getProperty = callback;

  JSClassRef proxyClass = JSClassCreate(&proxyClassDefintion);
  JSObjectRef proxyObj = JSObjectMake(ctx, proxyClass, nullptr);
  JSClassRelease(proxyClass);

  Object::getGlobalObject(ctx).setProperty(name, Value(ctx, proxyObj));
}
Ejemplo n.º 27
0
/* Callback - JavaScript window object has been cleared */
static void window_object_cleared_cb(WebKitWebView  *web_view,
                                     WebKitWebFrame *frame,
                                     gpointer        context,
                                     gpointer        window_object,
                                     gpointer        user_data)

{
    /* Add classes to JavaScriptCore */
    JSClassRef classDef = JSClassCreate(&class_def);
    JSObjectRef classObj = JSObjectMake(context, classDef, context);
    JSObjectRef globalObj = JSContextGetGlobalObject(context);
    JSStringRef str = JSStringCreateWithUTF8CString("CustomClass");
    JSObjectSetProperty(context, globalObj, str, classObj, kJSPropertyAttributeNone, NULL);
}
	static JSObjectRef classConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) {
		PrivateObjectContainer* poc = new PrivateObjectContainer();
		JSValueRef val = arguments[0];
		JSValueRef val2 = arguments[1];
		JSObjectRef objRef = JSValueToObject(ctx, val, NULL);
		void* raw = JSObjectGetPrivate(objRef);
		ManipulationHandler_UID^ nobj = (ManipulationHandler_UID^)reinterpret_cast<PrivateObjectContainer*>(raw)->get();
		poc->set(nobj);
	    nobj->SetDeltaCallback((int64)JSValueToObject(ctx, val2, NULL));
		JSClassDefinition classDefinition = kJSClassDefinitionEmpty;
		classDefinition.finalize = classDestructor;
		JSClassRef classDef = JSClassCreate(&classDefinition);
		return JSObjectMake(ctx, classDef, poc);
	}
JSClassRef AccessibilityUIElement::getJSClass()
{
    static JSStaticValue staticValues[] = {
        { "role", getRoleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "description", getDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "width", getWidthCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "height", getHeightCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "intValue", getIntValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "minValue", getMinValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "maxValue", getMaxValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "insertionPointLineNumber", getInsertionPointLineNumberCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "selectedTextRange", getSelectedTextRangeCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "supportsPressAction", getSupportsPressActionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0, 0 }
    };

    static JSStaticFunction staticFunctions[] = {
        { "allAttributes", allAttributesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfLinkedUIElements", attributesOfLinkedUIElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfDocumentLinks", attributesOfDocumentLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfChildren", attributesOfChildrenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "parameterizedAttributeNames", parameterizedAttributeNamesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "childAtIndex", childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfColumnHeaders", attributesOfColumnHeadersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfRowHeaders", attributesOfRowHeadersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfColumns", attributesOfColumnsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfRows", attributesOfRowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfVisibleCells", attributesOfVisibleCellsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "attributesOfHeader", attributesOfHeaderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "indexInTable", indexInTableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "rowIndexRange", rowIndexRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "columnIndexRange", columnIndexRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "cellForColumnAndRow", cellForColumnAndRowCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "titleUIElement", titleUIElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { "setSelectedTextRange", setSelectedTextRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
        { 0, 0, 0 }
    };

    static JSClassDefinition classDefinition = {
        0, kJSClassAttributeNone, "AccessibilityUIElement", 0, staticValues, staticFunctions,
        0, finalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };

    static JSClassRef accessibilityUIElementClass = JSClassCreate(&classDefinition);
    return accessibilityUIElementClass;
}
Ejemplo n.º 30
0
MDNativeBindingClass::MDNativeBindingClass(JSNativeClass *nativeClass)
{

    ASSERT(nativeClass);

    memset(&m_jsClass, 0x0, sizeof(m_jsClass));

    m_jsClass.className = nativeClass->name;
    m_jsClass.staticFunctions = static_cast<JSStaticFunction*>(nativeClass->method);
    m_jsClass.staticValues = nativeClass->property;
    m_jsClass.callAsConstructor = nativeClass->ctor;
    m_jsClass.finalize = nativeClass->dtor;

    m_classRef = JSClassCreate(&m_jsClass);
}