#include "globals.h" #include "FieldState_v8_wrapper.h" #include #include "FieldState.h" using namespace v8; #ifdef UNICODE # define V8_TCHAR uint16_t #else # define V8_TCHAR char #endif static Handle Get_FieldState_x(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getX()); } static void Set_FieldState_x(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setX(value->Int32Value()); } static Handle Get_FieldState_y(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getY()); } static void Set_FieldState_y(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setY(value->Int32Value()); } static Handle Get_FieldState_width(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getWidth()); } static void Set_FieldState_width(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setWidth(value->Int32Value()); } static Handle Get_FieldState_height(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getHeight()); } static void Set_FieldState_height(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setHeight(value->Int32Value()); } static Handle Get_FieldState_left(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getLeft()); } static void Set_FieldState_left(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setLeft(value->Int32Value()); } static Handle Get_FieldState_top(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getTop()); } static void Set_FieldState_top(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setTop(value->Int32Value()); } static Handle Get_FieldState_right(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getRight()); } static void Set_FieldState_right(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setRight(value->Int32Value()); } static Handle Get_FieldState_bottom(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Int32::New(tmp->getBottom()); } static void Set_FieldState_bottom(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setBottom(value->Int32Value()); } static Handle Get_FieldState_visible(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); return Boolean::New(tmp->isVisible()); } static void Set_FieldState_visible(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); FieldState *tmp = (FieldState *) wrap->Value(); tmp->setVisible(value->BooleanValue()); } void AddFieldStateAcessors(Handle &templ) { templ->SetAccessor(String::New("x"), Get_FieldState_x, Set_FieldState_x); templ->SetAccessor(String::New("y"), Get_FieldState_y, Set_FieldState_y); templ->SetAccessor(String::New("width"), Get_FieldState_width, Set_FieldState_width); templ->SetAccessor(String::New("height"), Get_FieldState_height, Set_FieldState_height); templ->SetAccessor(String::New("left"), Get_FieldState_left, Set_FieldState_left); templ->SetAccessor(String::New("top"), Get_FieldState_top, Set_FieldState_top); templ->SetAccessor(String::New("right"), Get_FieldState_right, Set_FieldState_right); templ->SetAccessor(String::New("bottom"), Get_FieldState_bottom, Set_FieldState_bottom); templ->SetAccessor(String::New("visible"), Get_FieldState_visible, Set_FieldState_visible); }