void JSInterleavedVideoFrame::JSGetData(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) {
	v8::Isolate* isolate = info.GetIsolate();
	v8::HandleScope scope(isolate);
	JSInterleavedVideoFrame* self = UnwrapSelf<JSInterleavedVideoFrame>(info.This());
	// Make sure we're writeable.
	self->MakeWriteable(isolate);
	if (self->dataInstance.IsEmpty()) {
		info.GetReturnValue().Set(v8::Null());
	} else {
		info.GetReturnValue().Set(self->dataInstance);
	}
}
Exemple #2
0
void JsSprite::JS_GetTexture(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
	DEFINE_HANDLE_SCOPE_AND_GET_SELF_FOR_SPRITE(info);
	
	JsSprite * that = GetWrappedObject<JsSprite>(info.This());
	if (!that->_texture)
	{
		info.GetReturnValue().SetNull();
		return;
	}

	info.GetReturnValue().Set(that->_texture->handle(info.GetIsolate()));
}
Exemple #3
0
void GetSymbolName(Local<String> property, const v8::PropertyCallbackInfo<v8::Value>& info) {
  Local<Object> self = info.Holder();
  //Local<External> ext = Local<External>::Cast(self->GetInternalField(0));
  Lisp_Object ptr = (Lisp_Object) self->GetAlignedPointerFromInternalField(0); //(Lisp_Object)ext->Value();
  
  info.GetReturnValue().Set (String::New(SSDATA(SYMBOL_NAME(ptr))));
}
Exemple #4
0
	static void var_get(v8::Local<v8::String>, v8::PropertyCallbackInfo<v8::Value> const& info)
	{
		v8::Isolate* isolate = info.GetIsolate();

		Variable* var = detail::get_external_data<Variable*>(info.Data());
		info.GetReturnValue().Set(to_v8(isolate, *var));
	}
Exemple #5
0
/** position:
* get curretn position
* 
* @return int
*	buffer position
*/
void CJSBuffer::GetPosition(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
	CBufferObj* pBuffer = GetCObject<CBufferObj>(info.Holder());
	size_t uPosition = pBuffer->GetPosition();
	ASSERT(uPosition < 0xFFFFFFFF);
	info.GetReturnValue().Set(v8::Uint32::New(v8::Isolate::GetCurrent(), (uint32)uPosition));
}
Exemple #6
0
void TNodeJsFIn::length(v8::Local<v8::String> Name, const v8::PropertyCallbackInfo<v8::Value>& Info) {
    v8::Isolate* Isolate = v8::Isolate::GetCurrent();
    v8::HandleScope HandleScope(Isolate);

    TNodeJsFIn* JsFIn = ObjectWrap::Unwrap<TNodeJsFIn>(Info.Holder());

    Info.GetReturnValue().Set(v8::Integer::New(Isolate, JsFIn->SIn->Len()));
}
Exemple #7
0
void TNodeJsSA::name(v8::Local<v8::String> Name, const v8::PropertyCallbackInfo<v8::Value>& Info) {
	v8::Isolate* Isolate = v8::Isolate::GetCurrent();
	v8::HandleScope HandleScope(Isolate);

	v8::Local<v8::Object> Self = Info.Holder();
	TNodeJsSA* JsSA = ObjectWrap::Unwrap<TNodeJsSA>(Self);
	Info.GetReturnValue().Set(v8::String::NewFromUtf8(Isolate, JsSA->SA->GetAggrNm().CStr()));
}
Exemple #8
0
void TNodeJsSA::val(v8::Local<v8::String> Name, const v8::PropertyCallbackInfo<v8::Value>& Info) {
	v8::Isolate* Isolate = v8::Isolate::GetCurrent();
	v8::HandleScope HandleScope(Isolate);

	v8::Local<v8::Object> Self = Info.Holder();
	TNodeJsSA* JsSA = ObjectWrap::Unwrap<TNodeJsSA>(Self);
	Info.GetReturnValue().Set(TNodeJsUtil::ParseJson(Isolate, JsSA->SA->SaveJson(-1)));
}
Exemple #9
0
static void FXJSE_V8_GenericNamedPropertyEnumeratorCallback(
    const v8::PropertyCallbackInfo<v8::Array>& info) {
  const FXJSE_CLASS* lpClass =
      static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
  v8::Isolate* pIsolate = info.GetIsolate();
  v8::Local<v8::Array> newArray = v8::Array::New(pIsolate, lpClass->propNum);
  for (int i = 0; i < lpClass->propNum; i++) {
    newArray->Set(
        i, v8::String::NewFromUtf8(pIsolate, lpClass->properties[i].name));
  }
  info.GetReturnValue().Set(newArray);
}
Exemple #10
0
static void FXJSE_V8_GenericNamedPropertyQueryCallback(
    v8::Local<v8::Name> property,
    const v8::PropertyCallbackInfo<v8::Integer>& info) {
  v8::Local<v8::Object> thisObject = info.This();
  const FXJSE_CLASS* lpClass =
      static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
  v8::Isolate* pIsolate = info.GetIsolate();
  v8::HandleScope scope(pIsolate);
  v8::String::Utf8Value szPropName(property);
  CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
  CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
  lpThisValue->ForceSetValue(thisObject);
  if (FXJSE_DynPropQueryAdapter(lpClass,
                                reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
                                szFxPropName)) {
    info.GetReturnValue().Set(v8::DontDelete);
  } else {
    const int32_t iV8Absent = 64;
    info.GetReturnValue().Set(iV8Absent);
  }
  delete lpThisValue;
  lpThisValue = nullptr;
}
Exemple #11
0
static void FXJSE_V8_GenericNamedPropertyGetterCallback(
    v8::Local<v8::Name> property,
    const v8::PropertyCallbackInfo<v8::Value>& info) {
  v8::Local<v8::Object> thisObject = info.This();
  const FXJSE_CLASS* lpClass =
      static_cast<FXJSE_CLASS*>(info.Data().As<v8::External>()->Value());
  v8::String::Utf8Value szPropName(property);
  CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
  CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
  lpThisValue->ForceSetValue(thisObject);
  CFXJSE_Value* lpNewValue = CFXJSE_Value::Create(info.GetIsolate());
  FXJSE_DynPropGetterAdapter(
      lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName,
      reinterpret_cast<FXJSE_HVALUE>(lpNewValue));
  info.GetReturnValue().Set(lpNewValue->DirectGetValue());
  delete lpThisValue;
  lpThisValue = nullptr;
}
Exemple #12
0
void JsVlcPlayer::getJsCallback( v8::Local<v8::String> property,
                                 const v8::PropertyCallbackInfo<v8::Value>& info,
                                 Callbacks_e callback )
{
    using namespace v8;

    JsVlcPlayer* jsPlayer = ObjectWrap::Unwrap<JsVlcPlayer>( info.Holder() );

    if( jsPlayer->_jsCallbacks[callback].IsEmpty() )
        return;

    Isolate* isolate = Isolate::GetCurrent();
    HandleScope scope( isolate );

    Local<Function> callbackFunc =
        Local<Function>::New( isolate, jsPlayer->_jsCallbacks[callback] );

    info.GetReturnValue().Set( callbackFunc );
}
Exemple #13
0
void JSCanvasRenderingContext2D::JSSetFillStyle(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) {
	JSCanvasRenderingContext2D* self = UnwrapSelf<JSCanvasRenderingContext2D>(info.Holder());
	info.GetReturnValue().Set(self->GetFillStyle());
}
void SessionWrapper::getPageSize(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
	SessionHolder* pSessionHolder = Wrapper::unwrapNative<SessionHolder>(info);
	info.GetReturnValue().Set(pSessionHolder->getPageSize());
}
Exemple #15
0
void _ms_pos(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    CMemoryStream* pNative = unwrap_memorystream(info.Holder());
    info.GetReturnValue().Set(v8::Integer::New(v8::Isolate::GetCurrent(), pNative->GetSize()));
}
Exemple #16
0
 void HasSetConfigDir(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& args) {
     args.GetReturnValue().Set(Filesystem::HasSetUserDir());
 }
void TimerWrapper::cancelled(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    Poco::Util::TimerTask* pTimerTask = Poco::JS::Core::Wrapper::unwrapNative<Poco::Util::TimerTask>(info);
    info.GetReturnValue().Set(pTimerTask->isCancelled());
}