本文整理汇总了C++中JSClassCreate函数的典型用法代码示例。如果您正苦于以下问题:C++ JSClassCreate函数的具体用法?C++ JSClassCreate怎么用?C++ JSClassCreate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JSClassCreate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例9: MyObject_class
static JSClassRef MyObject_class(JSContextRef context)
{
static JSClassRef jsClass;
if (!jsClass)
jsClass = JSClassCreate(&MyObject_definition);
return jsClass;
}
示例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;
}
示例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;
}
示例12: EmptyObject_class
static JSClassRef EmptyObject_class(JSContextRef context)
{
UNUSED_PARAM(context);
static JSClassRef jsClass;
if (!jsClass)
jsClass = JSClassCreate(&EmptyObject_definition);
return jsClass;
}
示例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);
}
示例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;
}
示例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);
}