diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-20 23:24:30 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-20 23:24:30 +0000 |
commit | 334bfbad3fda3860f51b74cd6370786ef253ad49 (patch) | |
tree | 2cc40bf67b0ad86fc1e8c2e5f0a2e2085498ae7b /Plugins/skins/SkinLib/FontState_v8_wrapper.cpp | |
parent | ff634d35c1fbd2831be6c1206bb9298cd5a14eda (diff) |
skins: templates are kept in memory
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@128 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib/FontState_v8_wrapper.cpp')
-rw-r--r-- | Plugins/skins/SkinLib/FontState_v8_wrapper.cpp | 72 |
1 files changed, 51 insertions, 21 deletions
diff --git a/Plugins/skins/SkinLib/FontState_v8_wrapper.cpp b/Plugins/skins/SkinLib/FontState_v8_wrapper.cpp index 20f9697..4a81dd0 100644 --- a/Plugins/skins/SkinLib/FontState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/FontState_v8_wrapper.cpp @@ -16,20 +16,24 @@ using namespace v8; static Handle<Value> Get_FontState_face(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return String::New((const V8_TCHAR *) tmp->getFace());
+ return scope.Close( String::New((const V8_TCHAR *) tmp->getFace()) );
}
static void Set_FontState_face(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -49,20 +53,24 @@ static void Set_FontState_face(Local<String> property, Local<Value> value, const static Handle<Value> Get_FontState_size(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getSize());
+ return scope.Close( Int32::New(tmp->getSize()) );
}
static void Set_FontState_size(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -79,20 +87,24 @@ static void Set_FontState_size(Local<String> property, Local<Value> value, const static Handle<Value> Get_FontState_italic(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isItalic());
+ return scope.Close( Boolean::New(tmp->isItalic()) );
}
static void Set_FontState_italic(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -109,20 +121,24 @@ static void Set_FontState_italic(Local<String> property, Local<Value> value, con static Handle<Value> Get_FontState_bold(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isBold());
+ return scope.Close( Boolean::New(tmp->isBold()) );
}
static void Set_FontState_bold(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -139,20 +155,24 @@ static void Set_FontState_bold(Local<String> property, Local<Value> value, const static Handle<Value> Get_FontState_underline(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isUnderline());
+ return scope.Close( Boolean::New(tmp->isUnderline()) );
}
static void Set_FontState_underline(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -169,20 +189,24 @@ static void Set_FontState_underline(Local<String> property, Local<Value> value, static Handle<Value> Get_FontState_strikeOut(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isStrikeOut());
+ return scope.Close( Boolean::New(tmp->isStrikeOut()) );
}
static void Set_FontState_strikeOut(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -199,20 +223,24 @@ static void Set_FontState_strikeOut(Local<String> property, Local<Value> value, static Handle<Value> Get_FontState_color(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
FontState *tmp = (FontState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getColor());
+ return scope.Close( Int32::New(tmp->getColor()) );
}
static void Set_FontState_color(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -229,6 +257,8 @@ static void Set_FontState_color(Local<String> property, Local<Value> value, cons void AddFontStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("face"), Get_FontState_face, Set_FontState_face);
templ->SetAccessor(String::New("size"), Get_FontState_size, Set_FontState_size);
templ->SetAccessor(String::New("italic"), Get_FontState_italic, Set_FontState_italic);
|