diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-06 05:45:37 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-06 05:45:37 +0000 |
commit | 3abd781670e4cd7a82d5ab2966ef9f8131535b54 (patch) | |
tree | 85cc3fcad80d491c706d77ed7a399cc17349dc6f /Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp | |
parent | 30f9565911217d38cefda3920f55d183d8f6e219 (diff) |
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
Diffstat (limited to 'Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp')
-rw-r--r-- | Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp | 60 |
1 files changed, 56 insertions, 4 deletions
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<Value> Get_BorderState_left(Local<String> property, const Accessor {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<String> property, Local<Value> value, con {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<Value> Get_BorderState_right(Local<String> property, const Accesso {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<String> property, Local<Value> value, co {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<Value> Get_BorderState_top(Local<String> property, const AccessorI {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<String> property, Local<Value> value, cons {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<Value> Get_BorderState_bottom(Local<String> property, const Access {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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<String> property, Local<Value> value, c {
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::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());
}
|