From 3abd781670e4cd7a82d5ab2966ef9f8131535b54 Mon Sep 17 00:00:00 2001 From: pescuma Date: Tue, 6 Jan 2009 05:45:37 +0000 Subject: skins: Added border to fields State is now got through interface It works! git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@124 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp | 60 ++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp') diff --git a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp index a2e057e..ba8d611 100644 --- a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp @@ -17,7 +17,13 @@ static Handle Get_BorderState_left(Local property, const Accessor { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return Undefined(); + BorderState *tmp = (BorderState *) wrap->Value(); + if (tmp == NULL) + return Undefined(); + return Int32::New(tmp->getLeft()); } @@ -25,8 +31,15 @@ static void Set_BorderState_left(Local property, Local value, con { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return; + BorderState *tmp = (BorderState *) wrap->Value(); - tmp->setLeft(value->Int32Value()); + if (tmp == NULL) + return; + + if (!value.IsEmpty() && value->IsInt32()) + tmp->setLeft(value->Int32Value()); } @@ -34,7 +47,13 @@ static Handle Get_BorderState_right(Local property, const Accesso { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return Undefined(); + BorderState *tmp = (BorderState *) wrap->Value(); + if (tmp == NULL) + return Undefined(); + return Int32::New(tmp->getRight()); } @@ -42,8 +61,15 @@ static void Set_BorderState_right(Local property, Local value, co { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return; + BorderState *tmp = (BorderState *) wrap->Value(); - tmp->setRight(value->Int32Value()); + if (tmp == NULL) + return; + + if (!value.IsEmpty() && value->IsInt32()) + tmp->setRight(value->Int32Value()); } @@ -51,7 +77,13 @@ static Handle Get_BorderState_top(Local property, const AccessorI { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return Undefined(); + BorderState *tmp = (BorderState *) wrap->Value(); + if (tmp == NULL) + return Undefined(); + return Int32::New(tmp->getTop()); } @@ -59,8 +91,15 @@ static void Set_BorderState_top(Local property, Local value, cons { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return; + BorderState *tmp = (BorderState *) wrap->Value(); - tmp->setTop(value->Int32Value()); + if (tmp == NULL) + return; + + if (!value.IsEmpty() && value->IsInt32()) + tmp->setTop(value->Int32Value()); } @@ -68,7 +107,13 @@ static Handle Get_BorderState_bottom(Local property, const Access { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return Undefined(); + BorderState *tmp = (BorderState *) wrap->Value(); + if (tmp == NULL) + return Undefined(); + return Int32::New(tmp->getBottom()); } @@ -76,8 +121,15 @@ static void Set_BorderState_bottom(Local property, Local value, c { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0)); + if (wrap.IsEmpty()) + return; + BorderState *tmp = (BorderState *) wrap->Value(); - tmp->setBottom(value->Int32Value()); + if (tmp == NULL) + return; + + if (!value.IsEmpty() && value->IsInt32()) + tmp->setBottom(value->Int32Value()); } -- cgit v1.2.3