#include "globals.h" #include "TextFieldState_v8_wrapper.h" #include #include "TextFieldState.h" #include "utf8_helpers.h" using namespace v8; #ifdef UNICODE # define V8_TCHAR uint16_t #else # define V8_TCHAR char #endif static Handle Get_TextFieldState_text(Local property, const AccessorInfo &info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); TextFieldState *tmp = (TextFieldState *) wrap->Value(); return String::New((const V8_TCHAR *) tmp->getText()); } static void Set_TextFieldState_text(Local property, Local value, const AccessorInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); TextFieldState *tmp = (TextFieldState *) wrap->Value(); String::Utf8Value utf8_value(value); tmp->setText(Utf8ToTchar(*utf8_value)); } void AddTextFieldStateAcessors(Handle &templ) { templ->SetAccessor(String::New("text"), Get_TextFieldState_text, Set_TextFieldState_text); }