• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ JSClassCreate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中JSClassCreate函数的典型用法代码示例。如果您正苦于以下问题:C++ JSClassCreate函数的具体用法?C++ JSClassCreate怎么用?C++ JSClassCreate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了JSClassCreate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _gum_jsc_polyfill_init

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);
}
开发者ID:terry2012,项目名称:frida-gum,代码行数:30,代码来源:gumjscpolyfill.c


示例2: window_object_cleared__

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));
}
开发者ID:zzzzzzzzzzz0,项目名称:zhscript,代码行数:25,代码来源:webkit_view___.cpp


示例3: Java_com_vasco_digipass_sdk_smartfaceplugin_PluginImp_initNative

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);
}
开发者ID:memedum90,项目名称:demoforios,代码行数:25,代码来源:plugin-jni-Android.cpp


示例4: cltimer_initilize

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);
}
开发者ID:vifino,项目名称:dwb,代码行数:31,代码来源:cl_gtimer.c


示例5: JSClassCreate

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);
}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:30,代码来源:AccessibilityController.cpp


示例6: fz_malloc_struct

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;
}
开发者ID:azaleafisitania,项目名称:sumatrapdf,代码行数:27,代码来源:pdf-jsimp-jscore.c


示例7: _gum_jsc_process_init

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);
}
开发者ID:terry2012,项目名称:frida-gum,代码行数:26,代码来源:gumjscprocess.c


示例8: create

	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);
	}
开发者ID:FokkeZB,项目名称:hyperloop,代码行数:8,代码来源:Windows_UI_Xaml_Input_ManipulationDeltaEventHandler.hpp


示例9: MyObject_class

static JSClassRef MyObject_class(JSContextRef context)
{
    static JSClassRef jsClass;
    if (!jsClass)
        jsClass = JSClassCreate(&MyObject_definition);
    
    return jsClass;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:8,代码来源:testapi.c


示例10: JSClassCreate

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;
}
开发者ID:banketree,项目名称:AndroidJSCore,代码行数:9,代码来源:JSObject.cpp


示例11: WebKit_win32_NATIVE

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;
}
开发者ID:HendrikPeilke,项目名称:eclipse.platform.swt,代码行数:9,代码来源:webkit_win32.cpp


示例12: EmptyObject_class

static JSClassRef EmptyObject_class(JSContextRef context)
{
    UNUSED_PARAM(context);
    
    static JSClassRef jsClass;
    if (!jsClass)
        jsClass = JSClassCreate(&EmptyObject_definition);
    
    return jsClass;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:10,代码来源:testapi.c


示例13: RJSCreateWrapperClass

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);
}
开发者ID:Aneeskhan,项目名称:realm-js,代码行数:11,代码来源:js_util.hpp


示例14: GetGenericConstructorClassRef

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;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:12,代码来源:JS4D.cpp


示例15: JSClassCreate

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);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:12,代码来源:TextInputController.cpp


示例16: getClass

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;
}
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:13,代码来源:EventSender.cpp


示例17: seed_get_signal_class

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;
}
开发者ID:dannote,项目名称:seed,代码行数:13,代码来源:seed-signals.c


示例18: Base_class

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;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:13,代码来源:testapi.c


示例19: ASSERT

//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);
}
开发者ID:bytewang,项目名称:vitas,代码行数:14,代码来源:MDNativeBindingManager.cpp


示例20: NativeFunctionWithRetvalClass

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;
}
开发者ID:FinnProjects,项目名称:ultralight,代码行数:13,代码来源:JSHelpers.cpp



注:本文中的JSClassCreate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ JSD_LOCK函数代码示例发布时间:2022-05-30
下一篇:
C++ JSB_PRECONDITION2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap