summaryrefslogtreecommitdiff
path: root/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-12-31 21:12:58 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-12-31 21:12:58 +0000
commitbb6784e0e1a385cdd20b41d3254093e89a210332 (patch)
treec5d9c91b42a74baa30682fcbb717116a1df9c126 /Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
parent204a27b2f949cababbc13aff26755756987789a0 (diff)
skins: Added SkinLib
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@120 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp')
-rw-r--r--Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
new file mode 100644
index 0000000..a2e057e
--- /dev/null
+++ b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
@@ -0,0 +1,90 @@
+#include "globals.h"
+#include "BorderState_v8_wrapper.h"
+#include <v8.h>
+#include "BorderState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+static Handle<Value> Get_BorderState_left(Local<String> property, const AccessorInfo &info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ return Int32::New(tmp->getLeft());
+}
+
+static void Set_BorderState_left(Local<String> property, Local<Value> value, const AccessorInfo& info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ tmp->setLeft(value->Int32Value());
+}
+
+
+static Handle<Value> Get_BorderState_right(Local<String> property, const AccessorInfo &info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ return Int32::New(tmp->getRight());
+}
+
+static void Set_BorderState_right(Local<String> property, Local<Value> value, const AccessorInfo& info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ tmp->setRight(value->Int32Value());
+}
+
+
+static Handle<Value> Get_BorderState_top(Local<String> property, const AccessorInfo &info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ return Int32::New(tmp->getTop());
+}
+
+static void Set_BorderState_top(Local<String> property, Local<Value> value, const AccessorInfo& info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ tmp->setTop(value->Int32Value());
+}
+
+
+static Handle<Value> Get_BorderState_bottom(Local<String> property, const AccessorInfo &info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ return Int32::New(tmp->getBottom());
+}
+
+static void Set_BorderState_bottom(Local<String> property, Local<Value> value, const AccessorInfo& info)
+{
+ Local<Object> self = info.Holder();
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ BorderState *tmp = (BorderState *) wrap->Value();
+ tmp->setBottom(value->Int32Value());
+}
+
+
+void AddBorderStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ templ->SetAccessor(String::New("left"), Get_BorderState_left, Set_BorderState_left);
+ templ->SetAccessor(String::New("right"), Get_BorderState_right, Set_BorderState_right);
+ templ->SetAccessor(String::New("top"), Get_BorderState_top, Set_BorderState_top);
+ templ->SetAccessor(String::New("bottom"), Get_BorderState_bottom, Set_BorderState_bottom);
+}