Mercurial > MadButterfly
view nodejs/mbfly_njs.h @ 678:40ba8915edc7
Support modifier function after creating a new object
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 06 Aug 2010 19:30:52 +0800 |
parents | f264b50c469c |
children | 7685c57e29d0 |
line wrap: on
line source
#ifndef __MBFLY_NJS_H_ #define __MBFLY_NJS_H_ #include <v8.h> extern "C" { #include <mb.h> } #define THROW(x) \ do { \ v8::Handle<v8::Value> exc; \ exc = v8::Exception::Error(v8::String::New(x)); \ return v8::ThrowException(exc); \ } while(0) #define THROW_noret(x) \ do { \ v8::Handle<v8::Value> exc; \ exc = v8::Exception::Error(v8::String::New(x)); \ v8::ThrowException(exc); \ } while(0) #define UNWRAP(o) v8::External::Unwrap((o)->GetInternalField(0)) #define WRAP(o, v) (o)->SetInternalField(0, v8::External::Wrap(v)) #define SET(o, n, v) (o)->Set(v8::String::New(n), v) #define GET(o, n) (o)->Get(v8::String::New(n)) redraw_man_t *xnjsmb_rt_rdman(v8::Handle<v8::Object> mbrt); /* From coord.cc */ void xnjsmb_coord_mkroot(v8::Handle<v8::Object> js_rt); v8::Handle<v8::Value> export_xnjsmb_auto_coord_new(coord_t *coord); /* From shapes.cc */ void xnjsmb_shapes_init_mb_rt_temp(v8::Handle<v8::FunctionTemplate> rt_temp); /* From paints.cc */ void xnjsmb_paints_init_mb_rt_temp(v8::Handle<v8::FunctionTemplate> rt_temp); /* From font.cc */ void xnjsmb_font_init_mb_rt_temp(v8::Handle<v8::FunctionTemplate> mb_rt_temp); /* From image_ldr.cc */ void xnjsmb_img_ldr_init_mb_rt_temp(v8::Handle<v8::Object> mb_rt_temp); /* From observer.cc */ v8::Handle<v8::Value> export_xnjsmb_auto_subject_new(subject_t *subject); void xnjsmb_observer_init(void); #endif /* __MBFLY_NJS_H_ */