Пример #1
0
void RegisterModule(v8::Handle<v8::Object> target) {
  NODE_SET_METHOD(target, "render", render);
  NODE_SET_METHOD(target, "renderSync", render_sync);
  NODE_SET_METHOD(target, "renderFile", render_file);
  NODE_SET_METHOD(target, "renderFileSync", render_file_sync);
  NODE_SET_METHOD(target, "importedCallback", imported_callback);
}
Пример #2
0
void Geometry::Initialize(Handle<Object> target)
{
	HandleScope scope;

	constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Geometry::New));
	constructor->InstanceTemplate()->SetInternalFieldCount(1);
	constructor->SetClassName(String::NewSymbol("Geometry"));

	NODE_SET_METHOD(constructor, "fromWKBType", Geometry::create);
	NODE_SET_METHOD(constructor, "fromWKT", Geometry::createFromWkt);
	NODE_SET_METHOD(constructor, "fromWKB", Geometry::createFromWkb);

	NODE_SET_PROTOTYPE_METHOD(constructor, "toString", toString);
	NODE_SET_PROTOTYPE_METHOD(constructor, "toKML", exportToKML);
	NODE_SET_PROTOTYPE_METHOD(constructor, "toGML", exportToGML);
	NODE_SET_PROTOTYPE_METHOD(constructor, "toJSON", exportToJSON);
	NODE_SET_PROTOTYPE_METHOD(constructor, "toWKT", exportToWKT);
	NODE_SET_PROTOTYPE_METHOD(constructor, "toWKB", exportToWKB);
	NODE_SET_PROTOTYPE_METHOD(constructor, "isEmpty", isEmpty);
	NODE_SET_PROTOTYPE_METHOD(constructor, "isValid", isValid);
	NODE_SET_PROTOTYPE_METHOD(constructor, "isSimple", isSimple);
	NODE_SET_PROTOTYPE_METHOD(constructor, "isRing", isRing);
	NODE_SET_PROTOTYPE_METHOD(constructor, "clone", clone);
	NODE_SET_PROTOTYPE_METHOD(constructor, "empty", empty);
	NODE_SET_PROTOTYPE_METHOD(constructor, "closeRings", closeRings);
	NODE_SET_PROTOTYPE_METHOD(constructor, "intersects", intersects);
	NODE_SET_PROTOTYPE_METHOD(constructor, "equals", equals);
	NODE_SET_PROTOTYPE_METHOD(constructor, "disjoint", disjoint);
	NODE_SET_PROTOTYPE_METHOD(constructor, "touches", touches);
	NODE_SET_PROTOTYPE_METHOD(constructor, "crosses", crosses);
	NODE_SET_PROTOTYPE_METHOD(constructor, "within", within);
	NODE_SET_PROTOTYPE_METHOD(constructor, "contains", contains);
	NODE_SET_PROTOTYPE_METHOD(constructor, "overlaps", overlaps);
	NODE_SET_PROTOTYPE_METHOD(constructor, "boundary", boundary);
	NODE_SET_PROTOTYPE_METHOD(constructor, "distance", distance);
	NODE_SET_PROTOTYPE_METHOD(constructor, "convexHull", convexHull);
	NODE_SET_PROTOTYPE_METHOD(constructor, "buffer", buffer);
	NODE_SET_PROTOTYPE_METHOD(constructor, "intersection", intersection);
	NODE_SET_PROTOTYPE_METHOD(constructor, "union", unionGeometry);
	NODE_SET_PROTOTYPE_METHOD(constructor, "difference", difference);
	NODE_SET_PROTOTYPE_METHOD(constructor, "symDifference", symDifference);
	NODE_SET_PROTOTYPE_METHOD(constructor, "centroid", centroid);
	NODE_SET_PROTOTYPE_METHOD(constructor, "simplify", simplify);
	NODE_SET_PROTOTYPE_METHOD(constructor, "simplifyPreserveTopology", simplifyPreserveTopology);
	NODE_SET_PROTOTYPE_METHOD(constructor, "segmentize", segmentize);
	NODE_SET_PROTOTYPE_METHOD(constructor, "swapXY", swapXY);
	NODE_SET_PROTOTYPE_METHOD(constructor, "getEnvelope", getEnvelope);
	NODE_SET_PROTOTYPE_METHOD(constructor, "getEnvelope3D", getEnvelope3D);
	NODE_SET_PROTOTYPE_METHOD(constructor, "transform", transform);
	NODE_SET_PROTOTYPE_METHOD(constructor, "transformTo", transformTo);

	ATTR(constructor, "srs", srsGetter, srsSetter);
	ATTR(constructor, "wkbSize", wkbSizeGetter, READ_ONLY_SETTER);
	ATTR(constructor, "dimension", dimensionGetter, READ_ONLY_SETTER);
	ATTR(constructor, "coordinateDimension", coordinateDimensionGetter, READ_ONLY_SETTER);
	ATTR(constructor, "type", typeGetter, READ_ONLY_SETTER);
	ATTR(constructor, "name", nameGetter, READ_ONLY_SETTER);

	target->Set(String::NewSymbol("Geometry"), constructor->GetFunction());
}
// Sets up everything for the Logger object when the addon is initialized
void Logger::Initialize(Handle<Object> target) {
    NanScope();

    Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(Logger::New);
    lcons->InstanceTemplate()->SetInternalFieldCount(1);
    lcons->SetClassName(NanNew("Logger"));

    // Static methods
    NODE_SET_METHOD(lcons->GetFunction(), "getSeverity", Logger::get_severity);
    NODE_SET_METHOD(lcons->GetFunction(), "setSeverity", Logger::set_severity);

    // Constants
    NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"NONE",mapnik::logger::severity_type::none);
    NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"ERROR",mapnik::logger::severity_type::error);
    NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"DEBUG",mapnik::logger::severity_type::debug);
    NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"WARN",mapnik::logger::severity_type::warn);

    // What about booleans like:
    // ENABLE_STATS
    // ENABLE_LOG
    // DEFAULT_LOG_SEVERITY
    // RENDERING_STATS
    // DEBUG

    // Not sure if needed...
    target->Set(NanNew("Logger"),lcons->GetFunction());
    NanAssignPersistent(constructor, lcons);

}
Пример #4
0
	void init (v8::Handle<v8::Object> target) {
		NODE_SET_METHOD(target, "find", Find);
		NODE_SET_METHOD(target, "registerAdded", RegisterAdded);
		NODE_SET_METHOD(target, "registerRemoved", RegisterRemoved);
		NODE_SET_METHOD(target, "startMonitoring", StartMonitoring);
		NODE_SET_METHOD(target, "stopMonitoring", StopMonitoring);
		InitDetection();
	}
Пример #5
0
/*
    Register module
*/
void RegisterModule(v8::Handle<v8::Object> target) {
    // Init
    Process::Init(target);

    // Add properties to target
    NODE_SET_METHOD(target, "getProcesses", memscan_getProcesses);
    NODE_SET_METHOD(target, "openProcess", memscan_openProcess);
}
Пример #6
0
 void init (v8::Handle<v8::Object> target) 
 {
   v8::HandleScope scope;
   NODE_SET_METHOD(target, "open", Open);
   NODE_SET_METHOD(target, "write", Write);
   NODE_SET_METHOD(target, "close", Close);
   NODE_SET_METHOD(target, "list", List);
 }
Пример #7
0
void Image::Initialize(Handle<Object> target) {

    HandleScope scope;

    constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Image::New));
    constructor->InstanceTemplate()->SetInternalFieldCount(1);
    constructor->SetClassName(String::NewSymbol("Image"));

    NODE_SET_PROTOTYPE_METHOD(constructor, "encodeSync", encodeSync);
    NODE_SET_PROTOTYPE_METHOD(constructor, "encode", encode);
    NODE_SET_PROTOTYPE_METHOD(constructor, "view", view);
    NODE_SET_PROTOTYPE_METHOD(constructor, "save", save);
    NODE_SET_PROTOTYPE_METHOD(constructor, "setGrayScaleToAlpha", setGrayScaleToAlpha);
    NODE_SET_PROTOTYPE_METHOD(constructor, "width", width);
    NODE_SET_PROTOTYPE_METHOD(constructor, "height", height);
    NODE_SET_PROTOTYPE_METHOD(constructor, "painted", painted);
    NODE_SET_PROTOTYPE_METHOD(constructor, "composite", composite);
    NODE_SET_PROTOTYPE_METHOD(constructor, "premultiply", premultiply);
    NODE_SET_PROTOTYPE_METHOD(constructor, "demultiply", demultiply);
    NODE_SET_PROTOTYPE_METHOD(constructor, "clear", clear);

    ATTR(constructor, "background", get_prop, set_prop);

    // This *must* go after the ATTR setting
    NODE_SET_METHOD(constructor->GetFunction(),
                    "open",
                    Image::open);

    target->Set(String::NewSymbol("Image"),constructor->GetFunction());
}
Пример #8
0
/*static*/ void wxNode_wxSizerFlags::AddMethods(v8::Handle<v8::FunctionTemplate> target) {
  wxNode_wxEvtHandler::AddMethods(target);
  NODE_SET_PROTOTYPE_METHOD(target, "proportion", _Proportion);
  NODE_SET_PROTOTYPE_METHOD(target, "expand", _Expand);
  NODE_SET_PROTOTYPE_METHOD(target, "align", _Align);
  NODE_SET_PROTOTYPE_METHOD(target, "centre", _Centre);
  NODE_SET_PROTOTYPE_METHOD(target, "center", _Center);
  NODE_SET_PROTOTYPE_METHOD(target, "top", _Top);
  NODE_SET_PROTOTYPE_METHOD(target, "left", _Left);
  NODE_SET_PROTOTYPE_METHOD(target, "right", _Right);
  NODE_SET_PROTOTYPE_METHOD(target, "bottom", _Bottom);
  NODE_SET_METHOD(target, "getDefaultBorder", _GetDefaultBorder);
  NODE_SET_PROTOTYPE_METHOD(target, "border", _Border);
  NODE_SET_PROTOTYPE_METHOD(target, "doubleBorder", _DoubleBorder);
  NODE_SET_PROTOTYPE_METHOD(target, "tripleBorder", _TripleBorder);
  NODE_SET_PROTOTYPE_METHOD(target, "horzBorder", _HorzBorder);
  NODE_SET_PROTOTYPE_METHOD(target, "doubleHorzBorder", _DoubleHorzBorder);
  NODE_SET_PROTOTYPE_METHOD(target, "shaped", _Shaped);
  NODE_SET_PROTOTYPE_METHOD(target, "fixedMinSize", _FixedMinSize);
  NODE_SET_PROTOTYPE_METHOD(target, "reserveSpaceEvenIfHidden", _ReserveSpaceEvenIfHidden);
  NODE_SET_PROTOTYPE_METHOD(target, "getProportion", _GetProportion);
  NODE_SET_PROTOTYPE_METHOD(target, "getFlags", _GetFlags);
  NODE_SET_PROTOTYPE_METHOD(target, "getBorderInPixels", _GetBorderInPixels);
  
  
}
Пример #9
0
    static void start(v8::Handle<v8::Object> target) {
#if (NODE_MODULE_VERSION > 0x000B)
        v8::HandleScope scope(v8::Isolate::GetCurrent());
#else
        v8::HandleScope scope;
#endif
        NODE_SET_METHOD(target, "hello", get_hello);
    }
Пример #10
0
void Image::Initialize(Handle<Object> target) {

    NanScope();

    Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(Image::New);
    lcons->InstanceTemplate()->SetInternalFieldCount(1);
    lcons->SetClassName(NanNew("Image"));

    NODE_SET_PROTOTYPE_METHOD(lcons, "getPixel", getPixel);
    NODE_SET_PROTOTYPE_METHOD(lcons, "setPixel", setPixel);
    NODE_SET_PROTOTYPE_METHOD(lcons, "encodeSync", encodeSync);
    NODE_SET_PROTOTYPE_METHOD(lcons, "encode", encode);
    NODE_SET_PROTOTYPE_METHOD(lcons, "view", view);
    NODE_SET_PROTOTYPE_METHOD(lcons, "save", save);
    NODE_SET_PROTOTYPE_METHOD(lcons, "setGrayScaleToAlpha", setGrayScaleToAlpha);
    NODE_SET_PROTOTYPE_METHOD(lcons, "width", width);
    NODE_SET_PROTOTYPE_METHOD(lcons, "height", height);
    NODE_SET_PROTOTYPE_METHOD(lcons, "painted", painted);
    NODE_SET_PROTOTYPE_METHOD(lcons, "composite", composite);
    NODE_SET_PROTOTYPE_METHOD(lcons, "premultiplySync", premultiplySync);
    NODE_SET_PROTOTYPE_METHOD(lcons, "premultiply", premultiply);
    NODE_SET_PROTOTYPE_METHOD(lcons, "demultiplySync", demultiplySync);
    NODE_SET_PROTOTYPE_METHOD(lcons, "demultiply", demultiply);
    NODE_SET_PROTOTYPE_METHOD(lcons, "clear", clear);
    NODE_SET_PROTOTYPE_METHOD(lcons, "clearSync", clear);
    NODE_SET_PROTOTYPE_METHOD(lcons, "compare", compare);

    ATTR(lcons, "background", get_prop, set_prop);

    // This *must* go after the ATTR setting
    NODE_SET_METHOD(lcons->GetFunction(),
                    "open",
                    Image::open);
    NODE_SET_METHOD(lcons->GetFunction(),
                    "fromBytes",
                    Image::fromBytes);
    NODE_SET_METHOD(lcons->GetFunction(),
                    "openSync",
                    Image::openSync);
    NODE_SET_METHOD(lcons->GetFunction(),
                    "fromBytesSync",
                    Image::fromBytesSync);
    target->Set(NanNew("Image"),lcons->GetFunction());
    NanAssignPersistent(constructor, lcons);
}
Пример #11
0
/*static*/ void wxNode_wxButton::AddMethods(v8::Handle<v8::FunctionTemplate> target) {
  wxNode_wxAnyButton::AddMethods(target);
  NODE_SET_PROTOTYPE_METHOD(target, "setAuthNeeded", _SetAuthNeeded);
  NODE_SET_PROTOTYPE_METHOD(target, "getAuthNeeded", _GetAuthNeeded);
  NODE_SET_PROTOTYPE_METHOD(target, "setDefault", _SetDefault);
  NODE_SET_METHOD(target, "getDefaultSize", _GetDefaultSize);
  
  
}
Пример #12
0
void 
Ocv::Init(v8::Handle<v8::Object> target) {
 v8::HandleScope scope;

 char out [21];
 int n = sprintf(out, "%i.%i", CV_MAJOR_VERSION, CV_MINOR_VERSION);
 target->Set(v8::String::NewSymbol("version"), v8::String::New(out, n));
 NODE_SET_METHOD(target, "readImage", ReadImage);
}
Пример #13
0
/**
 * @details This is called from the module initialisation function
 * when the module is first loaded by Node. It should only be called
 * once per process.
 *
 * @param target The object representing the module.
 */
void Map::Init(Handle<Object> target) {
  HandleScope scope;

  Local<FunctionTemplate> template_ = FunctionTemplate::New(New);

  map_template = Persistent<FunctionTemplate>::New(template_);
  map_template->InstanceTemplate()->SetInternalFieldCount(1);
  map_template->SetClassName(String::NewSymbol("Map"));

  data_symbol = NODE_PSYMBOL("data");
  headers_symbol = NODE_PSYMBOL("headers");

  NODE_SET_PROTOTYPE_METHOD(map_template, "mapserv", MapservAsync);
  NODE_SET_METHOD(map_template, "FromFile", FromFileAsync);
  NODE_SET_METHOD(map_template, "FromString", FromStringAsync);

  target->Set(String::NewSymbol("Map"), map_template->GetFunction());
}
Пример #14
0
void CudaDevice::Initialize (Handle<Object> target) {
  HandleScope scope;

  cuInit(0);

  NODE_SET_METHOD(target, "DriverGetVersion", driverGetVersion);
  NODE_SET_METHOD(target, "DeviceGetCount", deviceGetCount);

  Local<FunctionTemplate> t = FunctionTemplate::New(CudaDevice::New);
  constructor_template = Persistent<FunctionTemplate>::New(t);
  constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
  constructor_template->SetClassName(String::NewSymbol("CudaDevice"));

  NODE_SET_PROTOTYPE_METHOD(constructor_template, "GetName", CudaDevice::getName);
  NODE_SET_PROTOTYPE_METHOD(constructor_template, "TotalMem", CudaDevice::totalMem);
  NODE_SET_PROTOTYPE_METHOD(constructor_template, "ComputeCapability", CudaDevice::computeCapability);

  target->Set(String::NewSymbol("CudaDevice"), constructor_template->GetFunction());
}
Пример #15
0
/*static*/ void wxNode_wxWebViewEvent::AddMethods(v8::Handle<v8::FunctionTemplate> target) {
  wxNode_wxNotifyEvent::AddMethods(target);
  NODE_SET_PROTOTYPE_METHOD(target, "getURL", _GetURL);
  NODE_SET_PROTOTYPE_METHOD(target, "getTarget", _GetTarget);
  NODE_SET_PROTOTYPE_METHOD(target, "clone", _Clone);
  NODE_SET_PROTOTYPE_METHOD(target, "getClassInfo", _GetClassInfo);
  NODE_SET_METHOD(target, "wxCreateObject", _wxCreateObject);
  
  
}
Пример #16
0
void init(Handle<Object> exports)
{
  NODE_SET_METHOD(exports, "createKernel", CreateKernel);
  NODE_SET_METHOD(exports, "createKernelsInProgram", CreateKernelsInProgram);
  NODE_SET_METHOD(exports, "retainKernel", RetainKernel);
  NODE_SET_METHOD(exports, "releaseKernel", ReleaseKernel);
  NODE_SET_METHOD(exports, "setKernelArg", SetKernelArg);
  NODE_SET_METHOD(exports, "getKernelInfo", GetKernelInfo);
#ifdef CL_VERSION_1_2
  NODE_SET_METHOD(exports, "getKernelArgInfo", GetKernelArgInfo);
#endif
  NODE_SET_METHOD(exports, "getKernelWorkGroupInfo", GetKernelWorkGroupInfo);
}
Пример #17
0
void init(Handle<Object> target) 
{
    DBG("edge::init");
    V8SynchronizationContext::Initialize();
    bufferConstructor = Persistent<Function>::New(Handle<Function>::Cast(
        Context::GetCurrent()->Global()->Get(String::New("Buffer")))); 
    json = Persistent<v8::Object>::New(Context::GetCurrent()->Global()->Get(String::New("JSON"))->ToObject());
    jsonParse = Persistent<Function>::New(Handle<Function>::Cast(json->Get(String::New("parse"))));
    debugMode = (0 < GetEnvironmentVariable("EDGE_DEBUG", NULL, 0));
    NODE_SET_METHOD(target, "initializeClrFunc", initializeClrFunc);
}
Пример #18
0
  void init (v8::Handle<v8::Object> target)
  {
    NanScope();
    NODE_SET_METHOD(target, "set", Set);
    NODE_SET_METHOD(target, "open", Open);
    NODE_SET_METHOD(target, "update", Update);
    NODE_SET_METHOD(target, "write", Write);
    NODE_SET_METHOD(target, "close", Close);
    NODE_SET_METHOD(target, "list", List);
    NODE_SET_METHOD(target, "flush", Flush);
    NODE_SET_METHOD(target, "drain", Drain);

#ifndef WIN32
    SerialportPoller::Init(target);
#endif
  }
Пример #19
0
void JsRegistrar::initAll(Handle<Object> exports)
{
  // Got this from the NodeJS docs. Seems to be a bit simpler than
  // what we were doing.
  NODE_SET_METHOD(exports,"hello",Method);
//  Isolate* current = exports->GetIsolate();
//  exports->Set(String::NewFromUtf8("hello"),
//      FunctionTemplate::New(Method)->GetFunction());

  for (size_t i = 0; i < _initializers.size(); i++)
  {
    _initializers[i]->Init(exports);
  }
}
Пример #20
0
void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module)
{
  std::cout << "[C++] NodeJS Module 'plugin' has been initialized" << std::endl;

  NODE_SET_METHOD(exports, "startApplication", startApplication);
  NODE_SET_METHOD(exports, "stopApplication", stopApplication);
  NODE_SET_METHOD(exports, "requestState", requestState);
  NODE_SET_METHOD(exports, "sendCommand", sendCommand);

  NODE_SET_METHOD(exports, "getBool", getBool);
  NODE_SET_METHOD(exports, "getInt", getInt);
  NODE_SET_METHOD(exports, "getStr", getStr);
}
Пример #21
0
// API to allocate a new object from JS
Handle<Value> NodeFSEvents::New(const Arguments& args)
{
    HandleScope scope;

    if (args.Length() != 1 || !args[0]->IsString()) {
        return ThrowException(String::New("Bad arguments"));
    }

    String::Utf8Value szPathName(args[0]->ToString());

    NodeFSEvents *nativeobj = new NodeFSEvents(*szPathName);
    nativeobj->Wrap(args.Holder());
    NODE_SET_METHOD(args.Holder(), "stop", NodeFSEvents::Shutdown);
    return args.This();
}
Пример #22
0
  void init (v8::Handle<v8::Object> target) 
  {
    v8::HandleScope scope;
    NODE_SET_METHOD(target, "open", Open);
    NODE_SET_METHOD(target, "write", Write);
    NODE_SET_METHOD(target, "close", Close);
    NODE_SET_METHOD(target, "list", List);
    NODE_SET_METHOD(target, "flush", Flush);
    NODE_SET_METHOD(target, "drain", Drain);
#ifndef WIN32
    NODE_SET_METHOD(target, "getStatus", GetStatus);
    NODE_SET_METHOD(target, "setStatus", SetStatus);
#endif

#ifndef WIN32
    SerialportPoller::Init(target);
#endif
  }
Пример #23
0
/*static*/ void wxNode_wxKeyEvent::AddMethods(v8::Handle<v8::FunctionTemplate> target) {
    wxNode_wxEvent::AddMethods(target);
    NODE_SET_PROTOTYPE_METHOD(target, "getKeyCode", _GetKeyCode);
    NODE_SET_PROTOTYPE_METHOD(target, "isKeyInCategory", _IsKeyInCategory);
    NODE_SET_PROTOTYPE_METHOD(target, "getUnicodeKey", _GetUnicodeKey);
    NODE_SET_PROTOTYPE_METHOD(target, "getRawKeyCode", _GetRawKeyCode);
    NODE_SET_PROTOTYPE_METHOD(target, "getRawKeyFlags", _GetRawKeyFlags);
    NODE_SET_PROTOTYPE_METHOD(target, "getPosition", _GetPosition);
    NODE_SET_PROTOTYPE_METHOD(target, "getX", _GetX);
    NODE_SET_PROTOTYPE_METHOD(target, "getY", _GetY);
    NODE_SET_PROTOTYPE_METHOD(target, "doAllowNextEvent", _DoAllowNextEvent);
    NODE_SET_PROTOTYPE_METHOD(target, "isNextEventAllowed", _IsNextEventAllowed);
    NODE_SET_PROTOTYPE_METHOD(target, "clone", _Clone);
    NODE_SET_PROTOTYPE_METHOD(target, "getEventCategory", _GetEventCategory);
    NODE_SET_PROTOTYPE_METHOD(target, "getClassInfo", _GetClassInfo);
    NODE_SET_METHOD(target, "wxCreateObject", _wxCreateObject);


}
Пример #24
0
void EModuleHelper::InitializeModule( Local< Object > target )
{
	Isolate* isolate = target->GetIsolate( );
	HandleScope scope( isolate );

	NODE_SET_METHOD( target, "setWriteStreamInitializer", EModuleHelper::SetWriteStreamInitializer );
	NODE_SET_METHOD( target, "setReadStreamInitializer", EModuleHelper::SetReadStreamInitializer );
	NODE_SET_METHOD( target, "setPromiseInitializer", EModuleHelper::SetPromiseInitializer );

	NODE_SET_METHOD( target, "setLogHandler", EModuleHelper::SetLogHandler );

	NODE_SET_METHOD( target, "processNextChunk", EModuleHelper::ProcessNextChunk );
	NODE_SET_METHOD( target, "requestNextChunk", EModuleHelper::RequestNextChunk );
}
Пример #25
0
  void ArrayType::Init(Handle<Object> target)
  {
    HandleScope scope;

    Local<FunctionTemplate> t = FunctionTemplate::New(New);

    s_ct = Persistent<FunctionTemplate>::New(t);
    s_ct->Inherit(Type::s_ct);
    s_ct->InstanceTemplate()->SetInternalFieldCount(1);
    s_ct->SetClassName(String::NewSymbol("ArrayType"));


    NODE_SET_METHOD(s_ct, "get", ArrayType::Get);

    NODE_SET_PROTOTYPE_METHOD(s_ct, "dump", ArrayType::Dump);
    NODE_SET_PROTOTYPE_METHOD(s_ct, "toString", ArrayType::ToString);

    s_func = Persistent<Function>::New(s_ct->GetFunction());
    target->Set(String::NewSymbol("ArrayType"),
		s_func);
  }
Пример #26
0
/*static*/ void wxNode_wxTextValidator::AddMethods(v8::Handle<v8::FunctionTemplate> target) {
    wxNode_wxValidator::AddMethods(target);
    NODE_SET_PROTOTYPE_METHOD(target, "clone", _Clone);
    NODE_SET_PROTOTYPE_METHOD(target, "copy", _Copy);
    NODE_SET_PROTOTYPE_METHOD(target, "validate", _Validate);
    NODE_SET_PROTOTYPE_METHOD(target, "transferToWindow", _TransferToWindow);
    NODE_SET_PROTOTYPE_METHOD(target, "transferFromWindow", _TransferFromWindow);
    NODE_SET_PROTOTYPE_METHOD(target, "onChar", _OnChar);
    NODE_SET_PROTOTYPE_METHOD(target, "getStyle", _GetStyle);
    NODE_SET_PROTOTYPE_METHOD(target, "setStyle", _SetStyle);
    NODE_SET_PROTOTYPE_METHOD(target, "getTextEntry", _GetTextEntry);
    NODE_SET_PROTOTYPE_METHOD(target, "setCharIncludes", _SetCharIncludes);
    NODE_SET_PROTOTYPE_METHOD(target, "setIncludes", _SetIncludes);
    NODE_SET_PROTOTYPE_METHOD(target, "getIncludes", _GetIncludes);
    NODE_SET_PROTOTYPE_METHOD(target, "setCharExcludes", _SetCharExcludes);
    NODE_SET_PROTOTYPE_METHOD(target, "setExcludes", _SetExcludes);
    NODE_SET_PROTOTYPE_METHOD(target, "getExcludes", _GetExcludes);
    NODE_SET_PROTOTYPE_METHOD(target, "hasFlag", _HasFlag);
    NODE_SET_PROTOTYPE_METHOD(target, "getClassInfo", _GetClassInfo);
    NODE_SET_METHOD(target, "wxCreateObject", _wxCreateObject);


}
Пример #27
0
/*static*/ void wxNodeObject::AddMethods(v8::Handle<v8::FunctionTemplate>& ct) {
  NODE_SET_METHOD(ct, "extend", extend);
}
Пример #28
0
void SpatialReference::Initialize(Handle<Object> target)
{
	NanScope();

	Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(SpatialReference::New);
	lcons->InstanceTemplate()->SetInternalFieldCount(1);
	lcons->SetClassName(NanNew("SpatialReference"));

	NODE_SET_METHOD(lcons, "fromUserInput", fromUserInput);
	NODE_SET_METHOD(lcons, "fromWKT", fromWKT);
	NODE_SET_METHOD(lcons, "fromProj4", fromProj4);
	NODE_SET_METHOD(lcons, "fromEPSG", fromEPSG);
	NODE_SET_METHOD(lcons, "fromEPSGA", fromEPSGA);
	NODE_SET_METHOD(lcons, "fromESRI", fromESRI);
	NODE_SET_METHOD(lcons, "fromWMSAUTO", fromWMSAUTO);
	NODE_SET_METHOD(lcons, "fromXML", fromXML);
	NODE_SET_METHOD(lcons, "fromURN", fromURN);
	NODE_SET_METHOD(lcons, "fromCRSURL", fromCRSURL);
	NODE_SET_METHOD(lcons, "fromURL", fromURL);
	NODE_SET_METHOD(lcons, "fromMICoordSys", fromMICoordSys);

	NODE_SET_PROTOTYPE_METHOD(lcons, "toString", toString);
	NODE_SET_PROTOTYPE_METHOD(lcons, "toWKT", exportToWKT);
	NODE_SET_PROTOTYPE_METHOD(lcons, "toPrettyWKT", exportToPrettyWKT);
	NODE_SET_PROTOTYPE_METHOD(lcons, "toProj4", exportToProj4);
	NODE_SET_PROTOTYPE_METHOD(lcons, "toXML", exportToXML);

	NODE_SET_PROTOTYPE_METHOD(lcons, "clone", clone);
	NODE_SET_PROTOTYPE_METHOD(lcons, "cloneGeogCS", cloneGeogCS);
	NODE_SET_PROTOTYPE_METHOD(lcons, "setWellKnownGeogCS", setWellKnownGeogCS);
	NODE_SET_PROTOTYPE_METHOD(lcons, "morphToESRI", morphToESRI);
	NODE_SET_PROTOTYPE_METHOD(lcons, "morphFromESRI", morphFromESRI);
	NODE_SET_PROTOTYPE_METHOD(lcons, "EPSGTreatsAsLatLong", EPSGTreatsAsLatLong);
	NODE_SET_PROTOTYPE_METHOD(lcons, "EPSGTreatsAsNorthingEasting", EPSGTreatsAsNorthingEasting);
	NODE_SET_PROTOTYPE_METHOD(lcons, "getLinearUnits", getLinearUnits);
	NODE_SET_PROTOTYPE_METHOD(lcons, "getAngularUnits", getAngularUnits);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isGeocentric", isGeocentric);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isProjected", isProjected);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isLocal", isLocal);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isVectical", isVertical);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isCompound", isCompound);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isSameGeogCS", isSameGeogCS);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isSameVertCS", isSameVertCS);
	NODE_SET_PROTOTYPE_METHOD(lcons, "isSame", isSame);
	NODE_SET_PROTOTYPE_METHOD(lcons, "getAuthorityName", getAuthorityName);
	NODE_SET_PROTOTYPE_METHOD(lcons, "getAuthorityCode", getAuthorityCode);
	NODE_SET_PROTOTYPE_METHOD(lcons, "getAttrValue", getAttrValue);
	NODE_SET_PROTOTYPE_METHOD(lcons, "autoIdentifyEPSG", autoIdentifyEPSG);
	NODE_SET_PROTOTYPE_METHOD(lcons, "validate", validate);

	target->Set(NanNew("SpatialReference"), lcons->GetFunction());

	NanAssignPersistent(constructor, lcons);
}
Пример #29
0
///////////////////////////////
// NodeJs-Filesystem
void TNodeJsFs::Init(v8::Handle<v8::Object> exports) {
    // Add all prototype methods, getters and setters here.
    NODE_SET_METHOD(exports, "openRead", _openRead);
    NODE_SET_METHOD(exports, "openWrite", _openWrite);
    NODE_SET_METHOD(exports, "openAppend", _openAppend);
    NODE_SET_METHOD(exports, "exists", _exists);
    NODE_SET_METHOD(exports, "copy", _copy);
    NODE_SET_METHOD(exports, "move", _move);
    NODE_SET_METHOD(exports, "del", _del);
    NODE_SET_METHOD(exports, "rename", _rename);
    NODE_SET_METHOD(exports, "fileInfo", _fileInfo);
    NODE_SET_METHOD(exports, "mkdir", _mkdir);
    NODE_SET_METHOD(exports, "rmdir", _rmdir);
    NODE_SET_METHOD(exports, "listFile", _listFile);
}
Пример #30
0
 void init(v8::Handle<v8::Object> target)
 {
     NODE_SET_METHOD(target, "helloWorld", Func);
 }