@@ -30,47 +30,50 @@ WindowInt *window;
3030
3131void createWindowJS (const v8::FunctionCallbackInfo<v8::Value>& args)
3232{
33+ v8::String::Utf8Value str (v8::Isolate::GetCurrent (), args[0 ]);
34+ std::string name (*str);
35+
3336 v8::Local<v8::Object> bufferObj = args[0 ].As <v8::Object>();
3437 unsigned char * handle = (unsigned char *)node::Buffer::Data (bufferObj);
3538
36- window->createWindow (handle);
39+ window->createWindow (name, handle);
3740}
3841
3942void destroyWindowJS (const v8::FunctionCallbackInfo<v8::Value>& args)
4043{
41- v8::Local< v8::Object> bufferObj = args[0 ]. As <v8::Object>( );
42- unsigned char * handle = ( unsigned char *) node::Buffer::Data (bufferObj );
44+ v8::String::Utf8Value str ( v8::Isolate::GetCurrent (), args[0 ]);
45+ std::string name (*str );
4346
44- window->destroyWindow (handle );
47+ window->destroyWindow (name );
4548}
4649
4750void connectIOSurfaceJS (const v8::FunctionCallbackInfo<v8::Value>& args)
4851{
49- v8::Local< v8::Object> bufferObj = args[0 ]. As <v8::Object>( );
50- unsigned char * handle = ( unsigned char *) node::Buffer::Data (bufferObj );
52+ v8::String::Utf8Value str ( v8::Isolate::GetCurrent (), args[0 ]);
53+ std::string name (*str );
5154
5255 v8::Local<v8::Uint32> surfaceID = v8::Local<v8::Uint32>::Cast (args[1 ]);
5356
54- window->connectIOSurfaceJS (handle , surfaceID->Uint32Value ());
57+ window->connectIOSurfaceJS (name , surfaceID->Uint32Value ());
5558}
5659
5760void destroyIOSurfaceJS (const v8::FunctionCallbackInfo<v8::Value>& args)
5861{
59- v8::Local< v8::Object> bufferObj = args[0 ]. As <v8::Object>( );
60- unsigned char * handle = ( unsigned char *) node::Buffer::Data (bufferObj );
62+ v8::String::Utf8Value str ( v8::Isolate::GetCurrent (), args[0 ]);
63+ std::string name (*str );
6164
62- window->destroyIOSurface (handle );
65+ window->destroyIOSurface (name );
6366}
6467
6568void moveWindowJS (const v8::FunctionCallbackInfo<v8::Value>& args)
6669{
67- v8::Local< v8::Object> bufferObj = args[0 ]. As <v8::Object>( );
68- unsigned char * handle = ( unsigned char *) node::Buffer::Data (bufferObj );
70+ v8::String::Utf8Value str ( v8::Isolate::GetCurrent (), args[0 ]);
71+ std::string name (*str );
6972
7073 v8::Local<v8::Uint32> cx = v8::Local<v8::Uint32>::Cast (args[1 ]);
7174 v8::Local<v8::Uint32> cy = v8::Local<v8::Uint32>::Cast (args[2 ]);
7275
73- window->moveWindow (handle , cx->Uint32Value (), cy->Uint32Value ());
76+ window->moveWindow (name , cx->Uint32Value (), cy->Uint32Value ());
7477}
7578
7679void init (v8::Local<v8::Object> exports) {
0 commit comments