diff options
Diffstat (limited to 'Plugins')
30 files changed, 1343 insertions, 1098 deletions
diff --git a/Plugins/skins/MirandaSkinnedDialog.cpp b/Plugins/skins/MirandaSkinnedDialog.cpp index 412a615..ebc224c 100644 --- a/Plugins/skins/MirandaSkinnedDialog.cpp +++ b/Plugins/skins/MirandaSkinnedDialog.cpp @@ -29,9 +29,9 @@ void MirandaSkinnedDialog::setSkinName(const TCHAR *name) if (skinName == name)
return;
- skinName = name;
+// TODO skinName = name;
setSettting("Skin", skinName.c_str());
- updateFilename();
+// TODO updateFilename();
}
bool MirandaSkinnedDialog::finishedConfiguring()
diff --git a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp index ba8d611..732ca29 100644 --- a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp @@ -15,20 +15,24 @@ using namespace v8; static Handle<Value> Get_BorderState_left(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() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getLeft());
+ return scope.Close( Int32::New(tmp->getLeft()) );
}
static void Set_BorderState_left(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())
@@ -45,20 +49,24 @@ static void Set_BorderState_left(Local<String> property, Local<Value> value, con static Handle<Value> Get_BorderState_right(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() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getRight());
+ return scope.Close( Int32::New(tmp->getRight()) );
}
static void Set_BorderState_right(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())
@@ -75,20 +83,24 @@ static void Set_BorderState_right(Local<String> property, Local<Value> value, co static Handle<Value> Get_BorderState_top(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() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getTop());
+ return scope.Close( Int32::New(tmp->getTop()) );
}
static void Set_BorderState_top(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())
@@ -105,20 +117,24 @@ static void Set_BorderState_top(Local<String> property, Local<Value> value, cons static Handle<Value> Get_BorderState_bottom(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() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getBottom());
+ return scope.Close( Int32::New(tmp->getBottom()) );
}
static void Set_BorderState_bottom(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())
@@ -135,6 +151,8 @@ static void Set_BorderState_bottom(Local<String> property, Local<Value> value, c void AddBorderStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
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);
diff --git a/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.cpp new file mode 100644 index 0000000..c5916b2 --- /dev/null +++ b/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.cpp @@ -0,0 +1,20 @@ +#include "globals.h"
+#include "ButtonFieldState_v8_wrapper.h"
+#include <v8.h>
+#include "ButtonFieldState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+void AddButtonFieldStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ HandleScope scope;
+
+}
diff --git a/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.h b/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.h new file mode 100644 index 0000000..c69fdc5 --- /dev/null +++ b/Plugins/skins/SkinLib/ButtonFieldState_v8_wrapper.h @@ -0,0 +1,10 @@ +#ifndef __BUTTON_FIELD_STATE_V8_WRAPPER_H__
+# define __BUTTON_FIELD_STATE_V8_WRAPPER_H__
+
+#include <v8.h>
+
+void AddButtonFieldStateAcessors(v8::Handle<v8::ObjectTemplate> &templ);
+
+
+
+#endif // __BUTTON_FIELD_STATE_V8_WRAPPER_H__
diff --git a/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp index 9cbd06a..70d3e06 100644 --- a/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/ControlFieldState_v8_wrapper.cpp @@ -16,20 +16,24 @@ using namespace v8; static Handle<Value> Get_ControlFieldState_text(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() );
ControlFieldState *tmp = (ControlFieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return String::New((const V8_TCHAR *) tmp->getText());
+ return scope.Close( String::New((const V8_TCHAR *) tmp->getText()) );
}
static void Set_ControlFieldState_text(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,5 +53,7 @@ static void Set_ControlFieldState_text(Local<String> property, Local<Value> valu void AddControlFieldStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("text"), Get_ControlFieldState_text, Set_ControlFieldState_text);
}
diff --git a/Plugins/skins/SkinLib/DialogState_v8_wrapper.cpp b/Plugins/skins/SkinLib/DialogState_v8_wrapper.cpp index c1c49e3..4ab4951 100644 --- a/Plugins/skins/SkinLib/DialogState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/DialogState_v8_wrapper.cpp @@ -15,20 +15,24 @@ using namespace v8; static Handle<Value> Get_DialogState_width(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getWidth());
+ return scope.Close( Int32::New(tmp->getWidth()) );
}
static void Set_DialogState_width(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())
@@ -45,20 +49,24 @@ static void Set_DialogState_width(Local<String> property, Local<Value> value, co static Handle<Value> Get_DialogState_height(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getHeight());
+ return scope.Close( Int32::New(tmp->getHeight()) );
}
static void Set_DialogState_height(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())
@@ -75,96 +83,144 @@ static void Set_DialogState_height(Local<String> property, Local<Value> value, c static Handle<Value> Get_DialogState_x(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getX());
+ return scope.Close( Int32::New(tmp->getX()) );
}
static Handle<Value> Get_DialogState_y(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getY());
+ return scope.Close( Int32::New(tmp->getY()) );
}
static Handle<Value> Get_DialogState_left(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getLeft());
+ return scope.Close( Int32::New(tmp->getLeft()) );
}
static Handle<Value> Get_DialogState_top(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getTop());
+ return scope.Close( Int32::New(tmp->getTop()) );
}
static Handle<Value> Get_DialogState_right(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getRight());
+ return scope.Close( Int32::New(tmp->getRight()) );
}
static Handle<Value> Get_DialogState_bottom(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() );
DialogState *tmp = (DialogState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getBottom());
+ return scope.Close( Int32::New(tmp->getBottom()) );
+}
+
+
+static Handle<Value> Get_DialogState_borders(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 scope.Close( Undefined() );
+
+ DialogState *tmp = (DialogState *) wrap->Value();
+ if (tmp == NULL)
+ return scope.Close( Undefined() );
+
+ return scope.Close( self->Get(String::New("bordersRaw")) );
+}
+
+static void Set_DialogState_borders(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())
+ return;
+
+ DialogState *tmp = (DialogState *) wrap->Value();
+ if (tmp == NULL)
+ return;
+
+ if (!value.IsEmpty() && value->IsInt32())
+ tmp->getBorders()->setAll(value->Int32Value());
}
void AddDialogStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("width"), Get_DialogState_width, Set_DialogState_width);
templ->SetAccessor(String::New("height"), Get_DialogState_height, Set_DialogState_height);
templ->SetAccessor(String::New("x"), Get_DialogState_x, NULL, Handle<Value>(), DEFAULT, ReadOnly);
@@ -173,4 +229,5 @@ void AddDialogStateAcessors(Handle<ObjectTemplate> &templ) templ->SetAccessor(String::New("top"), Get_DialogState_top, NULL, Handle<Value>(), DEFAULT, ReadOnly);
templ->SetAccessor(String::New("right"), Get_DialogState_right, NULL, Handle<Value>(), DEFAULT, ReadOnly);
templ->SetAccessor(String::New("bottom"), Get_DialogState_bottom, NULL, Handle<Value>(), DEFAULT, ReadOnly);
+ templ->SetAccessor(String::New("borders"), Get_DialogState_borders, Set_DialogState_borders);
}
diff --git a/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.cpp new file mode 100644 index 0000000..86522b8 --- /dev/null +++ b/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.cpp @@ -0,0 +1,20 @@ +#include "globals.h"
+#include "EditFieldState_v8_wrapper.h"
+#include <v8.h>
+#include "EditFieldState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+void AddEditFieldStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ HandleScope scope;
+
+}
diff --git a/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.h b/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.h new file mode 100644 index 0000000..a589725 --- /dev/null +++ b/Plugins/skins/SkinLib/EditFieldState_v8_wrapper.h @@ -0,0 +1,10 @@ +#ifndef __EDIT_FIELD_STATE_V8_WRAPPER_H__
+# define __EDIT_FIELD_STATE_V8_WRAPPER_H__
+
+#include <v8.h>
+
+void AddEditFieldStateAcessors(v8::Handle<v8::ObjectTemplate> &templ);
+
+
+
+#endif // __EDIT_FIELD_STATE_V8_WRAPPER_H__
diff --git a/Plugins/skins/SkinLib/FieldState.rec b/Plugins/skins/SkinLib/FieldState.rec index 992c4d6..a8bf2a9 100644 --- a/Plugins/skins/SkinLib/FieldState.rec +++ b/Plugins/skins/SkinLib/FieldState.rec @@ -8,6 +8,7 @@ struct DialogState const Int32 top;
const Int32 right;
const Int32 bottom;
+ BorderState borders [setter: if (!value.IsEmpty() && value->IsInt32())\n\ttmp->getBorders()->setAll(value->Int32Value()); ];
};
struct FieldState
@@ -23,17 +24,40 @@ struct FieldState Boolean visible;
const Boolean enabled;
Char toolTip[128];
+ BorderState borders [setter: if (!value.IsEmpty() && value->IsInt32())\n\ttmp->getBorders()->setAll(value->Int32Value()); ];
};
-struct ControlFieldState
+struct ControlFieldState : FieldState
{
Char text[1024];
+ FontState font;
};
-struct TextFieldState
+struct LabelFieldState : ControlFieldState
+{
+};
+
+struct ButtonFieldState : ControlFieldState
+{
+};
+
+struct EditFieldState : ControlFieldState
+{
+};
+
+struct IconFieldState : FieldState
+{
+};
+
+struct ImageFieldState : FieldState
+{
+};
+
+struct TextFieldState : FieldState
{
Char text[1024];
Int32 hAlign | LEFT | CENTER | RIGHT;
+ FontState font;
};
struct FontState
@@ -61,4 +85,4 @@ struct SkinOption Int32 min;
Int32 max;
Int32 type | CHECKBOX | NUMBER | TEXT;
-};
\ No newline at end of file +};
diff --git a/Plugins/skins/SkinLib/FieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/FieldState_v8_wrapper.cpp index a4213b1..31e0e7d 100644 --- a/Plugins/skins/SkinLib/FieldState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/FieldState_v8_wrapper.cpp @@ -16,20 +16,24 @@ using namespace v8; static Handle<Value> Get_FieldState_x(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getX());
+ return scope.Close( Int32::New(tmp->getX()) );
}
static void Set_FieldState_x(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())
@@ -46,20 +50,24 @@ static void Set_FieldState_x(Local<String> property, Local<Value> value, const A static Handle<Value> Get_FieldState_y(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getY());
+ return scope.Close( Int32::New(tmp->getY()) );
}
static void Set_FieldState_y(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())
@@ -76,20 +84,24 @@ static void Set_FieldState_y(Local<String> property, Local<Value> value, const A static Handle<Value> Get_FieldState_width(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getWidth());
+ return scope.Close( Int32::New(tmp->getWidth()) );
}
static void Set_FieldState_width(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())
@@ -106,20 +118,24 @@ static void Set_FieldState_width(Local<String> property, Local<Value> value, con static Handle<Value> Get_FieldState_height(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getHeight());
+ return scope.Close( Int32::New(tmp->getHeight()) );
}
static void Set_FieldState_height(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())
@@ -136,20 +152,24 @@ static void Set_FieldState_height(Local<String> property, Local<Value> value, co static Handle<Value> Get_FieldState_left(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getLeft());
+ return scope.Close( Int32::New(tmp->getLeft()) );
}
static void Set_FieldState_left(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())
@@ -166,20 +186,24 @@ static void Set_FieldState_left(Local<String> property, Local<Value> value, cons static Handle<Value> Get_FieldState_top(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getTop());
+ return scope.Close( Int32::New(tmp->getTop()) );
}
static void Set_FieldState_top(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())
@@ -196,20 +220,24 @@ static void Set_FieldState_top(Local<String> property, Local<Value> value, const static Handle<Value> Get_FieldState_right(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getRight());
+ return scope.Close( Int32::New(tmp->getRight()) );
}
static void Set_FieldState_right(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())
@@ -226,20 +254,24 @@ static void Set_FieldState_right(Local<String> property, Local<Value> value, con static Handle<Value> Get_FieldState_bottom(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getBottom());
+ return scope.Close( Int32::New(tmp->getBottom()) );
}
static void Set_FieldState_bottom(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())
@@ -256,20 +288,24 @@ static void Set_FieldState_bottom(Local<String> property, Local<Value> value, co static Handle<Value> Get_FieldState_visible(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isVisible());
+ return scope.Close( Boolean::New(tmp->isVisible()) );
}
static void Set_FieldState_visible(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())
@@ -286,35 +322,41 @@ static void Set_FieldState_visible(Local<String> property, Local<Value> value, c static Handle<Value> Get_FieldState_enabled(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Boolean::New(tmp->isEnabled());
+ return scope.Close( Boolean::New(tmp->isEnabled()) );
}
static Handle<Value> Get_FieldState_toolTip(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() );
FieldState *tmp = (FieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return String::New((const V8_TCHAR *) tmp->getToolTip());
+ return scope.Close( String::New((const V8_TCHAR *) tmp->getToolTip()) );
}
static void Set_FieldState_toolTip(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())
@@ -332,8 +374,44 @@ static void Set_FieldState_toolTip(Local<String> property, Local<Value> value, c }
+static Handle<Value> Get_FieldState_borders(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 scope.Close( Undefined() );
+
+ FieldState *tmp = (FieldState *) wrap->Value();
+ if (tmp == NULL)
+ return scope.Close( Undefined() );
+
+ return scope.Close( self->Get(String::New("bordersRaw")) );
+}
+
+static void Set_FieldState_borders(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())
+ return;
+
+ FieldState *tmp = (FieldState *) wrap->Value();
+ if (tmp == NULL)
+ return;
+
+ if (!value.IsEmpty() && value->IsInt32())
+ tmp->getBorders()->setAll(value->Int32Value());
+}
+
+
void AddFieldStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("x"), Get_FieldState_x, Set_FieldState_x);
templ->SetAccessor(String::New("y"), Get_FieldState_y, Set_FieldState_y);
templ->SetAccessor(String::New("width"), Get_FieldState_width, Set_FieldState_width);
@@ -345,4 +423,5 @@ void AddFieldStateAcessors(Handle<ObjectTemplate> &templ) templ->SetAccessor(String::New("visible"), Get_FieldState_visible, Set_FieldState_visible);
templ->SetAccessor(String::New("enabled"), Get_FieldState_enabled, NULL, Handle<Value>(), DEFAULT, ReadOnly);
templ->SetAccessor(String::New("toolTip"), Get_FieldState_toolTip, Set_FieldState_toolTip);
+ templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
}
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);
diff --git a/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.cpp new file mode 100644 index 0000000..a955653 --- /dev/null +++ b/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.cpp @@ -0,0 +1,20 @@ +#include "globals.h"
+#include "IconFieldState_v8_wrapper.h"
+#include <v8.h>
+#include "IconFieldState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+void AddIconFieldStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ HandleScope scope;
+
+}
diff --git a/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.h b/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.h new file mode 100644 index 0000000..7b63f80 --- /dev/null +++ b/Plugins/skins/SkinLib/IconFieldState_v8_wrapper.h @@ -0,0 +1,10 @@ +#ifndef __ICON_FIELD_STATE_V8_WRAPPER_H__
+# define __ICON_FIELD_STATE_V8_WRAPPER_H__
+
+#include <v8.h>
+
+void AddIconFieldStateAcessors(v8::Handle<v8::ObjectTemplate> &templ);
+
+
+
+#endif // __ICON_FIELD_STATE_V8_WRAPPER_H__
diff --git a/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.cpp new file mode 100644 index 0000000..1e4a9b6 --- /dev/null +++ b/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.cpp @@ -0,0 +1,20 @@ +#include "globals.h"
+#include "ImageFieldState_v8_wrapper.h"
+#include <v8.h>
+#include "ImageFieldState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+void AddImageFieldStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ HandleScope scope;
+
+}
diff --git a/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.h b/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.h new file mode 100644 index 0000000..ea5f343 --- /dev/null +++ b/Plugins/skins/SkinLib/ImageFieldState_v8_wrapper.h @@ -0,0 +1,10 @@ +#ifndef __IMAGE_FIELD_STATE_V8_WRAPPER_H__
+# define __IMAGE_FIELD_STATE_V8_WRAPPER_H__
+
+#include <v8.h>
+
+void AddImageFieldStateAcessors(v8::Handle<v8::ObjectTemplate> &templ);
+
+
+
+#endif // __IMAGE_FIELD_STATE_V8_WRAPPER_H__
diff --git a/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.cpp new file mode 100644 index 0000000..9105a7d --- /dev/null +++ b/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.cpp @@ -0,0 +1,20 @@ +#include "globals.h"
+#include "LabelFieldState_v8_wrapper.h"
+#include <v8.h>
+#include "LabelFieldState.h"
+
+using namespace v8;
+
+
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
+
+
+void AddLabelFieldStateAcessors(Handle<ObjectTemplate> &templ)
+{
+ HandleScope scope;
+
+}
diff --git a/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.h b/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.h new file mode 100644 index 0000000..7d40de5 --- /dev/null +++ b/Plugins/skins/SkinLib/LabelFieldState_v8_wrapper.h @@ -0,0 +1,10 @@ +#ifndef __LABEL_FIELD_STATE_V8_WRAPPER_H__
+# define __LABEL_FIELD_STATE_V8_WRAPPER_H__
+
+#include <v8.h>
+
+void AddLabelFieldStateAcessors(v8::Handle<v8::ObjectTemplate> &templ);
+
+
+
+#endif // __LABEL_FIELD_STATE_V8_WRAPPER_H__
diff --git a/Plugins/skins/SkinLib/SkinOption_v8_wrapper.cpp b/Plugins/skins/SkinLib/SkinOption_v8_wrapper.cpp index 7f166c7..944bb6e 100644 --- a/Plugins/skins/SkinLib/SkinOption_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/SkinOption_v8_wrapper.cpp @@ -16,20 +16,24 @@ using namespace v8; static Handle<Value> Get_SkinOption_description(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() );
SkinOption *tmp = (SkinOption *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return String::New((const V8_TCHAR *) tmp->getDescription());
+ return scope.Close( String::New((const V8_TCHAR *) tmp->getDescription()) );
}
static void Set_SkinOption_description(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_SkinOption_description(Local<String> property, Local<Value> valu static Handle<Value> Get_SkinOption_min(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() );
SkinOption *tmp = (SkinOption *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getMin());
+ return scope.Close( Int32::New(tmp->getMin()) );
}
static void Set_SkinOption_min(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_SkinOption_min(Local<String> property, Local<Value> value, const static Handle<Value> Get_SkinOption_max(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() );
SkinOption *tmp = (SkinOption *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getMax());
+ return scope.Close( Int32::New(tmp->getMax()) );
}
static void Set_SkinOption_max(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,26 +121,30 @@ static void Set_SkinOption_max(Local<String> property, Local<Value> value, const static Handle<Value> Get_SkinOption_type(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() );
SkinOption *tmp = (SkinOption *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
switch(tmp->getType())
{
- case CHECKBOX: return String::New((const V8_TCHAR *) _T("CHECKBOX"));
- case NUMBER: return String::New((const V8_TCHAR *) _T("NUMBER"));
- case TEXT: return String::New((const V8_TCHAR *) _T("TEXT"));
+ case CHECKBOX: return scope.Close( String::New((const V8_TCHAR *) _T("CHECKBOX")) );
+ case NUMBER: return scope.Close( String::New((const V8_TCHAR *) _T("NUMBER")) );
+ case TEXT: return scope.Close( String::New((const V8_TCHAR *) _T("TEXT")) );
}
- return Undefined();
+ return scope.Close( Undefined() );
}
static void Set_SkinOption_type(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())
@@ -154,6 +170,8 @@ static void Set_SkinOption_type(Local<String> property, Local<Value> value, cons void AddSkinOptionAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("description"), Get_SkinOption_description, Set_SkinOption_description);
templ->SetAccessor(String::New("min"), Get_SkinOption_min, Set_SkinOption_min);
templ->SetAccessor(String::New("max"), Get_SkinOption_max, Set_SkinOption_max);
diff --git a/Plugins/skins/SkinLib/SkinnedDialog.cpp b/Plugins/skins/SkinLib/SkinnedDialog.cpp index fdca335..a6a3b2b 100644 --- a/Plugins/skins/SkinLib/SkinnedDialog.cpp +++ b/Plugins/skins/SkinLib/SkinnedDialog.cpp @@ -13,6 +13,7 @@ SkinnedDialog::SkinnedDialog(const char *name) errorCallback(NULL), errorCallbackParam(NULL),
traceCallback(NULL), traceCallbackParam(NULL)
{
+ V8Script::initializeEngine();
}
SkinnedDialog::~SkinnedDialog()
diff --git a/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp index 73035d9..6eb4a39 100644 --- a/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp @@ -16,20 +16,24 @@ using namespace v8; static Handle<Value> Get_TextFieldState_text(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() );
TextFieldState *tmp = (TextFieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return String::New((const V8_TCHAR *) tmp->getText());
+ return scope.Close( String::New((const V8_TCHAR *) tmp->getText()) );
}
static void Set_TextFieldState_text(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,26 +53,30 @@ static void Set_TextFieldState_text(Local<String> property, Local<Value> value, static Handle<Value> Get_TextFieldState_hAlign(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() );
TextFieldState *tmp = (TextFieldState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
switch(tmp->getHAlign())
{
- case LEFT: return String::New((const V8_TCHAR *) _T("LEFT"));
- case CENTER: return String::New((const V8_TCHAR *) _T("CENTER"));
- case RIGHT: return String::New((const V8_TCHAR *) _T("RIGHT"));
+ case LEFT: return scope.Close( String::New((const V8_TCHAR *) _T("LEFT")) );
+ case CENTER: return scope.Close( String::New((const V8_TCHAR *) _T("CENTER")) );
+ case RIGHT: return scope.Close( String::New((const V8_TCHAR *) _T("RIGHT")) );
}
- return Undefined();
+ return scope.Close( Undefined() );
}
static void Set_TextFieldState_hAlign(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())
@@ -94,6 +102,8 @@ static void Set_TextFieldState_hAlign(Local<String> property, Local<Value> value void AddTextFieldStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("text"), Get_TextFieldState_text, Set_TextFieldState_text);
templ->SetAccessor(String::New("hAlign"), Get_TextFieldState_hAlign, Set_TextFieldState_hAlign);
}
diff --git a/Plugins/skins/SkinLib/V8Script.cpp b/Plugins/skins/SkinLib/V8Script.cpp index 0d0fc85..fb32181 100644 --- a/Plugins/skins/SkinLib/V8Script.cpp +++ b/Plugins/skins/SkinLib/V8Script.cpp @@ -1,96 +1,37 @@ #include "globals.h"
#include "V8Script.h"
+#include "V8Wrappers.h"
#include <utf8_helpers.h>
using namespace v8;
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
-V8Script::V8Script() : exceptionCallback(NULL), exceptionCallbackParam(NULL)
-{
-}
+V8Wrappers *wrappers = NULL;
-V8Script::~V8Script()
-{
- dispose();
-}
-static Handle<Value> IsEmptyCallback(const Arguments& args)
+void V8Script::initializeEngine()
{
- if (args.Length() < 1)
- return Undefined();
-
- HandleScope scope;
-
- for(int i = 0; i < args.Length(); i++)
- {
- Local<Value> arg = args[0];
-
- if (arg.IsEmpty() || arg->IsNull() || arg->IsUndefined())
- {
- return Boolean::New(true);
- }
- else if (arg->IsObject())
- {
- Local<Object> self = Local<Object>::Cast(arg);
- if (self->InternalFieldCount() < 1)
- continue;
-
- Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
- FieldState *field = (FieldState *) wrap->Value();
- if (field == NULL)
- continue;
-
- if (field->isEmpty())
- return Boolean::New(true);
- }
- else if (arg->IsString())
- {
- Local<String> str = Local<String>::Cast(arg);
- if (str->Length() <= 0)
- return Boolean::New(true);
- }
- }
+ if (wrappers != NULL)
+ return;
- return Boolean::New(false);
+ wrappers = new V8Wrappers();
}
-static Handle<Value> RGBCallback(const Arguments& args)
-{
- if (args.Length() != 3)
- return Undefined();
- COLORREF color = RGB(args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value());
- return Int32::New(color);
+V8Script::V8Script() : exceptionCallback(NULL), exceptionCallbackParam(NULL)
+{
}
-static Handle<Value> AlertCallback(const Arguments& args)
+V8Script::~V8Script()
{
- Local<External> wrap = Local<External>::Cast(args.Data());
- if (wrap.IsEmpty())
- return Int32::New(-1);
-
- Dialog *dialog = (Dialog *) wrap->Value();
- if (dialog == NULL)
- return Int32::New(-1);
-
- if (args.Length() < 1)
- return Int32::New(-1);
-
- Local<Value> arg = args[0];
- if (!arg->IsString())
- return Int32::New(-1);
-
- Local<String> str = Local<String>::Cast(arg);
- String::Utf8Value utf8_value(str);
-
- std::tstring title;
- title = CharToTchar(dialog->getName());
- title += _T(" - Skin alert");
- MessageBox(NULL, Utf8ToTchar(*utf8_value), title.c_str(), MB_OK);
-
- return Int32::New(0);
+ dispose();
}
bool V8Script::compile(const TCHAR *source, Dialog *dlg)
@@ -99,58 +40,67 @@ bool V8Script::compile(const TCHAR *source, Dialog *dlg) HandleScope handle_scope;
- Handle<ObjectTemplate> global = ObjectTemplate::New();
-
- global->Set(String::New("IsEmpty"), FunctionTemplate::New(&IsEmptyCallback));
- global->Set(String::New("RGB"), FunctionTemplate::New(&RGBCallback));
- global->Set(String::New("alert"), FunctionTemplate::New(&AlertCallback, External::New(dlg)));
-
- global->Set(String::New("NUMBER"), String::New("NUMBER"));
- global->Set(String::New("CHECKBOX"), String::New("CHECKBOX"));
- global->Set(String::New("TEXT"), String::New("TEXT"));
- global->Set(String::New("LEFT"), String::New("LEFT"));
- global->Set(String::New("CENTER"), String::New("CENTER"));
- global->Set(String::New("RIGHT"), String::New("RIGHT"));
-
- context = Context::New(NULL, global);
+ context = Context::New(NULL, wrappers->getGlobalTemplate());
Context::Scope context_scope(context);
- context->Global()->Set(String::New("window"), wrappers.createDialogWrapper(), ReadOnly);
- context->Global()->Set(String::New("opts"), wrappers.createOptionsWrapper(), ReadOnly);
+ context->Global()->Set(String::New("window"), wrappers->newDialogState(), ReadOnly);
+ context->Global()->Set(String::New("opts"), wrappers->newOptions(), ReadOnly);
for(unsigned int i = 0; i < dlg->getFieldCount(); i++)
{
Field *field = dlg->getField(i);
- context->Global()->Set(String::New(field->getName()), wrappers.createWrapper(field->getType()), ReadOnly);
+ context->Global()->Set(String::New(field->getName()), wrappers->newState(field->getType()), ReadOnly);
}
- wrappers.clearTemplates();
TryCatch try_catch;
- Local<Script> tmpScript = Script::Compile(String::New((const V8_TCHAR *) source), String::New(dlg->getName()));
- if (tmpScript.IsEmpty())
+ Local<Script> script = Script::Compile(String::New((const V8_TCHAR *) source), String::New(dlg->getName()));
+ if (script.IsEmpty())
+ {
+ reportException(&try_catch);
+ dispose();
+ return false;
+ }
+
+ // Run once to get the functions
+ Handle<Value> result = script->Run();
+ if (script.IsEmpty())
{
reportException(&try_catch);
dispose();
return false;
}
- script = Persistent<Script>::New(tmpScript);
+ Handle<Value> configureFunction = context->Global()->Get(String::New("configure"));
+ if (!configureFunction.IsEmpty() && !configureFunction->IsFunction())
+ configureFunction.Clear();
+
+ Handle<Value> drawFunction = context->Global()->Get(String::New("draw"));
+ if (drawFunction.IsEmpty() || !drawFunction->IsFunction())
+ {
+ dispose();
+ return false;
+ }
+
+ this->configureFunction = Persistent<Function>::New(Handle<Function>::Cast(configureFunction));
+ this->drawFunction = Persistent<Function>::New(Handle<Function>::Cast(drawFunction));
return true;
}
void V8Script::dispose()
{
- script.Dispose();
- script.Clear();
-
context.Dispose();
+ configureFunction.Dispose();
+ drawFunction.Dispose();
+
context.Clear();
+ configureFunction.Clear();
+ drawFunction.Clear();
}
bool V8Script::isValid()
{
- return !context.IsEmpty() && !script.IsEmpty();
+ return !context.IsEmpty() && !drawFunction.IsEmpty();
}
static Handle<Object> get(Local<Object> obj, const char *field)
@@ -158,37 +108,16 @@ static Handle<Object> get(Local<Object> obj, const char *field) return Handle<Object>::Cast(obj->Get(String::New(field)));
}
-Handle<Function> V8Script::getConfigureFunction(Dialog *dlg)
+void V8Script::fillWrappers(DialogState *state, SkinOptions *opts, bool configure)
{
- DialogState *state = dlg->createState();
-
- HandleScope handle_scope;
-
- Context::Scope context_scope(context);
-
- // Run once to get function
Local<Object> global = context->Global();
- wrappers.fillWrapper(get(global, "window"), state);
- wrappers.fillWrapper(get(global, "opts"), (SkinOptions *) NULL, false);
+ wrappers->fillOptions(get(global, "opts"), opts, configure);
+ wrappers->fillDialogState(get(global, "window"), state);
for(unsigned int i = 0; i < state->fields.size(); i++)
{
FieldState *field = state->fields[i];
- wrappers.fillWrapper(get(global, field->getField()->getName()), field);
+ wrappers->fillState(get(global, field->getField()->getName()), field);
}
-
- // I don't care for the catch here
- TryCatch try_catch;
- script->Run();
-
- delete state;
-
- Handle<Value> configure_val = context->Global()->Get(String::New("configure"));
- if (configure_val.IsEmpty() || !configure_val->IsFunction())
- return Handle<Function>();
-
- Handle<Function> configure = Handle<Function>::Cast(configure_val);
-
- return handle_scope.Close(configure);
}
std::pair<SkinOptions *,DialogState *> V8Script::configure(Dialog *dlg)
@@ -199,33 +128,25 @@ std::pair<SkinOptions *,DialogState *> V8Script::configure(Dialog *dlg) SkinOptions *opts = new SkinOptions();
DialogState *state = dlg->createState();
- HandleScope handle_scope;
+ if (!configureFunction.IsEmpty())
+ {
+ HandleScope handle_scope;
- Context::Scope context_scope(context);
+ Context::Scope context_scope(context);
- Handle<Function> configure = getConfigureFunction(dlg);
- if (configure.IsEmpty())
- return std::pair<SkinOptions *,DialogState *>(opts, state);
+ fillWrappers(state, opts, true);
- Local<Object> global = context->Global();
- wrappers.fillWrapper(get(global, "opts"), opts, true);
- wrappers.fillWrapper(get(global, "window"), state);
- for(unsigned int i = 0; i < state->fields.size(); i++)
- {
- FieldState *field = state->fields[i];
- wrappers.fillWrapper(get(global, field->getField()->getName()), field);
+ TryCatch try_catch;
+ Handle<Value> result = configureFunction->Call(context->Global(), 0, NULL);
+ if (result.IsEmpty())
+ {
+ reportException(&try_catch);
+ delete opts;
+ delete state;
+ return std::pair<SkinOptions *,DialogState *>(NULL, NULL);;
+ }
}
- TryCatch try_catch;
- Handle<Value> result = configure->Call(global, 0, NULL);
- if (result.IsEmpty())
- {
- reportException(&try_catch);
- delete opts;
- delete state;
- return std::pair<SkinOptions *,DialogState *>(NULL, NULL);;
- }
-
return std::pair<SkinOptions *,DialogState *>(opts, state);
}
@@ -238,18 +159,10 @@ bool V8Script::run(DialogState * state, SkinOptions *opts) Context::Scope context_scope(context);
- Local<Object> global = context->Global();
-
- wrappers.fillWrapper(get(global, "window"), state);
- wrappers.fillWrapper(get(global, "opts"), opts, false);
- for(unsigned int i = 0; i < state->fields.size(); i++)
- {
- FieldState *field = state->fields[i];
- wrappers.fillWrapper(get(global, field->getField()->getName()), field);
- }
+ fillWrappers(state, opts, false);
TryCatch try_catch;
- Handle<Value> result = script->Run();
+ Handle<Value> result = drawFunction->Call(context->Global(), 0, NULL);
if (result.IsEmpty())
{
reportException(&try_catch);
diff --git a/Plugins/skins/SkinLib/V8Script.h b/Plugins/skins/SkinLib/V8Script.h index 8ff7cb5..45a9af7 100644 --- a/Plugins/skins/SkinLib/V8Script.h +++ b/Plugins/skins/SkinLib/V8Script.h @@ -5,12 +5,16 @@ #include <utility>
#include "V8Wrappers.h"
+
typedef void (*ExceptionCallback)(void *param, const TCHAR *err);
class V8Script
{
public:
+ static void initializeEngine();
+
+
V8Script();
~V8Script();
@@ -26,15 +30,15 @@ public: void setExceptionCallback(ExceptionCallback cb, void *param = NULL);
private:
- V8Wrappers wrappers;
v8::Persistent<v8::Context> context;
- v8::Persistent<v8::Script> script;
+ v8::Persistent<v8::Function> configureFunction;
+ v8::Persistent<v8::Function> drawFunction;
ExceptionCallback exceptionCallback;
void *exceptionCallbackParam;
- v8::Handle<v8::Function> getConfigureFunction(Dialog *dlg);
void reportException(v8::TryCatch *try_catch);
+ void fillWrappers(DialogState *state, SkinOptions *opts, bool configure);
};
diff --git a/Plugins/skins/SkinLib/V8Templates.cpp b/Plugins/skins/SkinLib/V8Templates.cpp new file mode 100644 index 0000000..dba4a14 --- /dev/null +++ b/Plugins/skins/SkinLib/V8Templates.cpp @@ -0,0 +1,466 @@ +#include "globals.h"
+#include <v8.h>
+#include "V8Templates.h"
+#include "DialogState_v8_wrapper.h"
+#include "FieldState_v8_wrapper.h"
+#include "ControlFieldState_v8_wrapper.h"
+#include "TextFieldState_v8_wrapper.h"
+#include "FontState_v8_wrapper.h"
+#include "BorderState_v8_wrapper.h"
+#include "SkinOption_v8_wrapper.h"
+
+using namespace v8;
+
+
+V8Templates::V8Templates()
+{
+}
+
+V8Templates::~V8Templates()
+{
+ dialogStateTemplate.Dispose();
+ fieldStateTemplate.Dispose();
+ controlFieldStateTemplate.Dispose();
+ textFieldStateTemplate.Dispose();
+ fontStateTemplate.Dispose();
+ borderStateTemplate.Dispose();
+ skinOptionTemplate.Dispose();
+}
+
+
+Handle<ObjectTemplate> V8Templates::getGlobalTemplate()
+{
+ HandleScope scope;
+
+ if (!globalTemplate.IsEmpty())
+ return globalTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->Set(String::New("LEFT"), String::New("LEFT"));
+ templ->Set(String::New("CENTER"), String::New("CENTER"));
+ templ->Set(String::New("RIGHT"), String::New("RIGHT"));
+ templ->Set(String::New("CHECKBOX"), String::New("CHECKBOX"));
+ templ->Set(String::New("NUMBER"), String::New("NUMBER"));
+ templ->Set(String::New("TEXT"), String::New("TEXT"));
+ addGlobalTemplateFields(templ);
+
+ globalTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return globalTemplate;
+}
+
+
+void V8Templates::addGlobalTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+
+int V8Templates::numOfDialogStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getDialogStateTemplate()
+{
+ HandleScope scope;
+
+ if (!dialogStateTemplate.IsEmpty())
+ return dialogStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfDialogStateInternalFields());
+ AddDialogStateAcessors(templ);
+ addDialogStateTemplateFields(templ);
+
+ dialogStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return dialogStateTemplate;
+}
+
+void V8Templates::addDialogStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newDialogState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getDialogStateTemplate()->NewInstance();
+ obj->Set(String::New("bordersRaw"), newBorderState(), ReadOnly);
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillDialogState(Handle<Object> v8Obj, DialogState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+ fillBorderState(Handle<Object>::Cast(v8Obj->Get(String::New("bordersRaw"))), obj->getBorders());
+}
+
+
+int V8Templates::numOfFieldStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getFieldStateTemplate()
+{
+ HandleScope scope;
+
+ if (!fieldStateTemplate.IsEmpty())
+ return fieldStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfFieldStateInternalFields());
+ AddFieldStateAcessors(templ);
+ addFieldStateTemplateFields(templ);
+
+ fieldStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return fieldStateTemplate;
+}
+
+void V8Templates::addFieldStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newFieldState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getFieldStateTemplate()->NewInstance();
+ obj->Set(String::New("bordersRaw"), newBorderState(), ReadOnly);
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillFieldState(Handle<Object> v8Obj, FieldState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+ fillBorderState(Handle<Object>::Cast(v8Obj->Get(String::New("bordersRaw"))), obj->getBorders());
+}
+
+
+int V8Templates::numOfControlFieldStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getControlFieldStateTemplate()
+{
+ HandleScope scope;
+
+ if (!controlFieldStateTemplate.IsEmpty())
+ return controlFieldStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfControlFieldStateInternalFields());
+ AddFieldStateAcessors(templ);
+ AddControlFieldStateAcessors(templ);
+ addControlFieldStateTemplateFields(templ);
+
+ controlFieldStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return controlFieldStateTemplate;
+}
+
+void V8Templates::addControlFieldStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newControlFieldState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getControlFieldStateTemplate()->NewInstance();
+ obj->Set(String::New("bordersRaw"), newBorderState(), ReadOnly);
+ obj->Set(String::New("font"), newFontState(), ReadOnly);
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillControlFieldState(Handle<Object> v8Obj, ControlFieldState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+ fillBorderState(Handle<Object>::Cast(v8Obj->Get(String::New("bordersRaw"))), obj->getBorders());
+ fillFontState(Handle<Object>::Cast(v8Obj->Get(String::New("font"))), obj->getFont());
+}
+
+
+Handle<ObjectTemplate> V8Templates::getLabelFieldStateTemplate()
+{
+ return getControlFieldStateTemplate();
+}
+
+Handle<Object> V8Templates::newLabelFieldState()
+{
+ return newControlFieldState();
+}
+
+void V8Templates::fillLabelFieldState(Handle<Object> v8Obj, LabelFieldState *obj)
+{
+ fillControlFieldState(v8Obj, obj);
+}
+
+
+Handle<ObjectTemplate> V8Templates::getButtonFieldStateTemplate()
+{
+ return getControlFieldStateTemplate();
+}
+
+Handle<Object> V8Templates::newButtonFieldState()
+{
+ return newControlFieldState();
+}
+
+void V8Templates::fillButtonFieldState(Handle<Object> v8Obj, ButtonFieldState *obj)
+{
+ fillControlFieldState(v8Obj, obj);
+}
+
+
+Handle<ObjectTemplate> V8Templates::getEditFieldStateTemplate()
+{
+ return getControlFieldStateTemplate();
+}
+
+Handle<Object> V8Templates::newEditFieldState()
+{
+ return newControlFieldState();
+}
+
+void V8Templates::fillEditFieldState(Handle<Object> v8Obj, EditFieldState *obj)
+{
+ fillControlFieldState(v8Obj, obj);
+}
+
+
+Handle<ObjectTemplate> V8Templates::getIconFieldStateTemplate()
+{
+ return getFieldStateTemplate();
+}
+
+Handle<Object> V8Templates::newIconFieldState()
+{
+ return newFieldState();
+}
+
+void V8Templates::fillIconFieldState(Handle<Object> v8Obj, IconFieldState *obj)
+{
+ fillFieldState(v8Obj, obj);
+}
+
+
+Handle<ObjectTemplate> V8Templates::getImageFieldStateTemplate()
+{
+ return getFieldStateTemplate();
+}
+
+Handle<Object> V8Templates::newImageFieldState()
+{
+ return newFieldState();
+}
+
+void V8Templates::fillImageFieldState(Handle<Object> v8Obj, ImageFieldState *obj)
+{
+ fillFieldState(v8Obj, obj);
+}
+
+
+int V8Templates::numOfTextFieldStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getTextFieldStateTemplate()
+{
+ HandleScope scope;
+
+ if (!textFieldStateTemplate.IsEmpty())
+ return textFieldStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfTextFieldStateInternalFields());
+ AddFieldStateAcessors(templ);
+ AddTextFieldStateAcessors(templ);
+ addTextFieldStateTemplateFields(templ);
+
+ textFieldStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return textFieldStateTemplate;
+}
+
+void V8Templates::addTextFieldStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newTextFieldState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getTextFieldStateTemplate()->NewInstance();
+ obj->Set(String::New("bordersRaw"), newBorderState(), ReadOnly);
+ obj->Set(String::New("font"), newFontState(), ReadOnly);
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillTextFieldState(Handle<Object> v8Obj, TextFieldState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+ fillBorderState(Handle<Object>::Cast(v8Obj->Get(String::New("bordersRaw"))), obj->getBorders());
+ fillFontState(Handle<Object>::Cast(v8Obj->Get(String::New("font"))), obj->getFont());
+}
+
+
+int V8Templates::numOfFontStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getFontStateTemplate()
+{
+ HandleScope scope;
+
+ if (!fontStateTemplate.IsEmpty())
+ return fontStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfFontStateInternalFields());
+ AddFontStateAcessors(templ);
+ addFontStateTemplateFields(templ);
+
+ fontStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return fontStateTemplate;
+}
+
+void V8Templates::addFontStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newFontState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getFontStateTemplate()->NewInstance();
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillFontState(Handle<Object> v8Obj, FontState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+}
+
+
+int V8Templates::numOfBorderStateInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getBorderStateTemplate()
+{
+ HandleScope scope;
+
+ if (!borderStateTemplate.IsEmpty())
+ return borderStateTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfBorderStateInternalFields());
+ AddBorderStateAcessors(templ);
+ addBorderStateTemplateFields(templ);
+
+ borderStateTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return borderStateTemplate;
+}
+
+void V8Templates::addBorderStateTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newBorderState()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getBorderStateTemplate()->NewInstance();
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillBorderState(Handle<Object> v8Obj, BorderState *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+}
+
+
+int V8Templates::numOfSkinOptionInternalFields()
+{
+ return 1;
+}
+
+Handle<ObjectTemplate> V8Templates::getSkinOptionTemplate()
+{
+ HandleScope scope;
+
+ if (!skinOptionTemplate.IsEmpty())
+ return skinOptionTemplate;
+
+ Handle<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetInternalFieldCount(numOfSkinOptionInternalFields());
+ AddSkinOptionAcessors(templ);
+ addSkinOptionTemplateFields(templ);
+
+ skinOptionTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return skinOptionTemplate;
+}
+
+void V8Templates::addSkinOptionTemplateFields(Handle<ObjectTemplate> &templ)
+{
+}
+
+Handle<Object> V8Templates::newSkinOption()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getSkinOptionTemplate()->NewInstance();
+
+ return scope.Close(obj);
+}
+
+void V8Templates::fillSkinOption(Handle<Object> v8Obj, SkinOption *obj)
+{
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
+
+ v8Obj->SetInternalField(0, External::New(obj));
+}
+
+
diff --git a/Plugins/skins/SkinLib/V8Templates.h b/Plugins/skins/SkinLib/V8Templates.h new file mode 100644 index 0000000..38590fe --- /dev/null +++ b/Plugins/skins/SkinLib/V8Templates.h @@ -0,0 +1,114 @@ +#ifndef __V8_TEMPLATES_H__
+# define __V8_TEMPLATES_H__
+
+#include <v8.h>
+#include "DialogState.h"
+#include "FieldState.h"
+#include "ControlFieldState.h"
+#include "LabelFieldState.h"
+#include "ButtonFieldState.h"
+#include "EditFieldState.h"
+#include "IconFieldState.h"
+#include "ImageFieldState.h"
+#include "TextFieldState.h"
+#include "FontState.h"
+#include "BorderState.h"
+#include "SkinOption.h"
+
+
+class V8Templates
+{
+public:
+ V8Templates();
+ virtual ~V8Templates();
+
+ virtual v8::Handle<v8::ObjectTemplate> getGlobalTemplate();
+
+ virtual v8::Handle<v8::ObjectTemplate> getDialogStateTemplate();
+ virtual v8::Handle<v8::Object> newDialogState();
+ virtual void fillDialogState(v8::Handle<v8::Object> v8Obj, DialogState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newFieldState();
+ virtual void fillFieldState(v8::Handle<v8::Object> v8Obj, FieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getControlFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newControlFieldState();
+ virtual void fillControlFieldState(v8::Handle<v8::Object> v8Obj, ControlFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getLabelFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newLabelFieldState();
+ virtual void fillLabelFieldState(v8::Handle<v8::Object> v8Obj, LabelFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getButtonFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newButtonFieldState();
+ virtual void fillButtonFieldState(v8::Handle<v8::Object> v8Obj, ButtonFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getEditFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newEditFieldState();
+ virtual void fillEditFieldState(v8::Handle<v8::Object> v8Obj, EditFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getIconFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newIconFieldState();
+ virtual void fillIconFieldState(v8::Handle<v8::Object> v8Obj, IconFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getImageFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newImageFieldState();
+ virtual void fillImageFieldState(v8::Handle<v8::Object> v8Obj, ImageFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getTextFieldStateTemplate();
+ virtual v8::Handle<v8::Object> newTextFieldState();
+ virtual void fillTextFieldState(v8::Handle<v8::Object> v8Obj, TextFieldState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getFontStateTemplate();
+ virtual v8::Handle<v8::Object> newFontState();
+ virtual void fillFontState(v8::Handle<v8::Object> v8Obj, FontState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getBorderStateTemplate();
+ virtual v8::Handle<v8::Object> newBorderState();
+ virtual void fillBorderState(v8::Handle<v8::Object> v8Obj, BorderState *obj);
+
+ virtual v8::Handle<v8::ObjectTemplate> getSkinOptionTemplate();
+ virtual v8::Handle<v8::Object> newSkinOption();
+ virtual void fillSkinOption(v8::Handle<v8::Object> v8Obj, SkinOption *obj);
+
+
+private:
+ v8::Persistent<v8::ObjectTemplate> globalTemplate;
+ v8::Persistent<v8::ObjectTemplate> dialogStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> fieldStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> controlFieldStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> textFieldStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> fontStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> borderStateTemplate;
+ v8::Persistent<v8::ObjectTemplate> skinOptionTemplate;
+
+protected:
+ virtual void addGlobalTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfDialogStateInternalFields();
+ virtual void addDialogStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfFieldStateInternalFields();
+ virtual void addFieldStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfControlFieldStateInternalFields();
+ virtual void addControlFieldStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfTextFieldStateInternalFields();
+ virtual void addTextFieldStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfFontStateInternalFields();
+ virtual void addFontStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfBorderStateInternalFields();
+ virtual void addBorderStateTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+ virtual int numOfSkinOptionInternalFields();
+ virtual void addSkinOptionTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
+
+};
+
+
+
+#endif // __V8_TEMPLATES_H__
diff --git a/Plugins/skins/SkinLib/V8Wrappers.cpp b/Plugins/skins/SkinLib/V8Wrappers.cpp index 5cfc7b1..f782d7c 100644 --- a/Plugins/skins/SkinLib/V8Wrappers.cpp +++ b/Plugins/skins/SkinLib/V8Wrappers.cpp @@ -1,499 +1,184 @@ #include "globals.h"
#include "V8Wrappers.h"
-#include "FieldState_v8_wrapper.h"
-#include "ControlFieldState_v8_wrapper.h"
-#include "TextFieldState_v8_wrapper.h"
-#include "FontState_v8_wrapper.h"
-#include "DialogState_v8_wrapper.h"
-#include "BorderState_v8_wrapper.h"
-#include "SkinOption_v8_wrapper.h"
#include <utf8_helpers.h>
-#define OPTION (USER_DEFINED-5)
-#define OPTIONS (USER_DEFINED-4)
-#define BORDER (USER_DEFINED-3)
-#define FONT (USER_DEFINED-2)
-#define DIALOG (USER_DEFINED-1)
-
-
using namespace v8;
-void V8Wrappers::createTemplateFor(FieldType type)
-{
- switch(type)
- {
- case SIMPLE_TEXT:
- createTextTemplate();
- break;
- case SIMPLE_IMAGE:
- createImageTemplate();
- break;
- case SIMPLE_ICON:
- createIconTemplate();
- break;
- case CONTROL_LABEL:
- createLabelTemplate();
- break;
- case CONTROL_BUTTON:
- createButtonTemplate();
- break;
- case CONTROL_EDIT:
- createEditTemplate();
- break;
- }
-}
-
+#ifdef UNICODE
+# define V8_TCHAR uint16_t
+#else
+# define V8_TCHAR char
+#endif
-static Handle<Value> Get_DialogState_borders(Local<String> property, const AccessorInfo &info)
-{
- Local<Object> self = info.Holder();
- return self->GetInternalField(1);
-}
-static void Set_DialogState_borders(Local<String> property, Local<Value> value, const AccessorInfo& info)
+static Handle<Value> IsEmptyCallback(const Arguments& args)
{
- Local<Object> self = info.Holder();
- Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
- if (wrap.IsEmpty())
- return;
-
- DialogState *tmp = (DialogState *) wrap->Value();
- if (tmp == NULL)
- return;
-
- if (!value.IsEmpty() && value->IsInt32())
- tmp->getBorders()->setAll(value->Int32Value());
-}
+ HandleScope scope;
+
+ if (args.Length() < 1)
+ return scope.Close( Undefined() );
+ for(int i = 0; i < args.Length(); i++)
+ {
+ Local<Value> arg = args[0];
-void V8Wrappers::createDialogTemplate()
-{
- if (templs.find(DIALOG) != templs.end())
- return;
-
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddDialogStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_DialogState_borders, Set_DialogState_borders);
- templs[DIALOG] = templ;
-
- createBorderTemplate();
-}
-
-static Handle<Value> Get_FieldState_borders(Local<String> property, const AccessorInfo &info)
-{
- Local<Object> self = info.Holder();
- return self->GetInternalField(1);
-}
-
-
-static void Set_FieldState_borders(Local<String> property, Local<Value> value, const AccessorInfo& info)
-{
- Local<Object> self = info.Holder();
- Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
- if (wrap.IsEmpty())
- return;
-
- FieldState *tmp = (FieldState *) wrap->Value();
- if (tmp == NULL)
- return;
-
- if (!value.IsEmpty() && value->IsInt32())
- tmp->getBorders()->setAll(value->Int32Value());
-}
-
-void V8Wrappers::createTextTemplate()
-{
- if (templs.find(SIMPLE_TEXT) != templs.end())
- return;
-
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- AddTextFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[SIMPLE_TEXT] = templ;
-
- createFontTemplate();
- createBorderTemplate();
-}
+ if (arg.IsEmpty() || arg->IsNull() || arg->IsUndefined())
+ {
+ return scope.Close( Boolean::New(true) );
+ }
+ else if (arg->IsObject())
+ {
+ Local<Object> self = Local<Object>::Cast(arg);
+ if (self->InternalFieldCount() < 1)
+ continue;
-void V8Wrappers::createImageTemplate()
-{
- if (templs.find(SIMPLE_IMAGE) != templs.end())
- return;
+ Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+ FieldState *field = (FieldState *) wrap->Value();
+ if (field == NULL)
+ continue;
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[SIMPLE_IMAGE] = templ;
+ if (field->isEmpty())
+ return scope.Close( Boolean::New(true) );
+ }
+ else if (arg->IsString())
+ {
+ Local<String> str = Local<String>::Cast(arg);
+ if (str->Length() <= 0)
+ return scope.Close( Boolean::New(true) );
+ }
+ }
- createBorderTemplate();
+ return scope.Close( Boolean::New(false) );
}
-void V8Wrappers::createIconTemplate()
+static Handle<Value> RGBCallback(const Arguments& args)
{
- if (templs.find(SIMPLE_ICON) != templs.end())
- return;
+ HandleScope scope;
+
+ if (args.Length() != 3)
+ return scope.Close( Undefined() );
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[SIMPLE_ICON] = templ;
-
- createBorderTemplate();
+ COLORREF color = RGB(args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value());
+ return scope.Close( Int32::New(color) );
}
-void V8Wrappers::createLabelTemplate()
+static Handle<Value> AlertCallback(const Arguments& args)
{
- if (templs.find(CONTROL_LABEL) != templs.end())
- return;
+ HandleScope scope;
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- AddControlFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[CONTROL_LABEL] = templ;
+ Local<External> wrap = Local<External>::Cast(args.Data());
+ if (wrap.IsEmpty())
+ return scope.Close( Boolean::New(false) );
- createFontTemplate();
+ if (args.Length() < 1)
+ return scope.Close( Boolean::New(false) );
- createBorderTemplate();
-}
+ Local<Value> arg = args[0];
+ if (!arg->IsString())
+ return scope.Close( Boolean::New(false) );
-void V8Wrappers::createButtonTemplate()
-{
- if (templs.find(CONTROL_BUTTON) != templs.end())
- return;
+ Local<String> str = Local<String>::Cast(arg);
+ String::Utf8Value utf8_value(str);
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- AddControlFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[CONTROL_BUTTON] = templ;
+ MessageBox(NULL, Utf8ToTchar(*utf8_value), _T("Skin alert"), MB_OK);
- createFontTemplate();
- createBorderTemplate();
+ return scope.Close( Boolean::New(true) );
}
-void V8Wrappers::createEditTemplate()
+void V8Wrappers::addGlobalTemplateFields(Handle<ObjectTemplate> &templ)
{
- if (templs.find(CONTROL_EDIT) != templs.end())
- return;
-
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(2);
- AddFieldStateAcessors(templ);
- AddControlFieldStateAcessors(templ);
- templ->SetAccessor(String::New("borders"), Get_FieldState_borders, Set_FieldState_borders);
- templs[CONTROL_EDIT] = templ;
+ HandleScope scope;
- createFontTemplate();
- createBorderTemplate();
+ templ->Set(String::New("IsEmpty"), FunctionTemplate::New(&IsEmptyCallback));
+ templ->Set(String::New("RGB"), FunctionTemplate::New(&RGBCallback));
+ templ->Set(String::New("alert"), FunctionTemplate::New(&AlertCallback));
}
-void V8Wrappers::createFontTemplate()
-{
- if (templs.find(FONT) != templs.end())
- return;
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(1);
- AddFontStateAcessors(templ);
- templs[FONT] = templ;
-}
-
-
-void V8Wrappers::createBorderTemplate()
+Handle<Object> V8Wrappers::newState(FieldType type)
{
- if (templs.find(BORDER) != templs.end())
- return;
-
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(1);
- AddBorderStateAcessors(templ);
- templs[BORDER] = templ;
+ switch(type)
+ {
+ case SIMPLE_TEXT:
+ return newTextFieldState();
+ case SIMPLE_IMAGE:
+ return newImageFieldState();
+ case SIMPLE_ICON:
+ return newIconFieldState();
+ case CONTROL_LABEL:
+ return newLabelFieldState();
+ case CONTROL_BUTTON:
+ return newButtonFieldState();
+ case CONTROL_EDIT:
+ return newEditFieldState();
+ }
+ throw "Unknown type";
}
-
-Handle<Object> V8Wrappers::createWrapper(FieldType type)
+void V8Wrappers::fillState(Handle<Object> obj, FieldState *state)
{
- createTemplateFor(type);
-
- switch(type)
+ switch(state->getField()->getType())
{
case SIMPLE_TEXT:
- return createTextWrapper();
+ fillTextFieldState(obj, (TextFieldState *) state);
break;
case SIMPLE_IMAGE:
- return createImageWrapper();
+ fillImageFieldState(obj, (ImageFieldState *) state);
break;
case SIMPLE_ICON:
- return createIconWrapper();
+ fillIconFieldState(obj, (IconFieldState *) state);
break;
case CONTROL_LABEL:
- return createLabelWrapper();
+ fillLabelFieldState(obj, (LabelFieldState *) state);
break;
case CONTROL_BUTTON:
- return createButtonWrapper();
+ fillButtonFieldState(obj, (ButtonFieldState *) state);
break;
case CONTROL_EDIT:
- return createEditWrapper();
+ fillEditFieldState(obj, (EditFieldState *) state);
break;
+ default:
+ throw "Unknown type";
}
- throw "Unknown type";
}
-Handle<Object> V8Wrappers::fillWrapper(Handle<Object> obj, FieldState *state)
+static Handle<Value> Get_SkinOption_value(SkinOption *opt)
{
- if (obj.IsEmpty())
- throw "Empty object";
+ HandleScope scope;
+
+ if (opt == NULL)
+ return scope.Close( Undefined() );
- switch(state->getField()->getType())
+ switch (opt->getType())
{
- case SIMPLE_TEXT:
- return fillTextWrapper(obj, (TextFieldState *) state);
- break;
- case SIMPLE_IMAGE:
- return fillImageWrapper(obj, (ImageFieldState *) state);
- break;
- case SIMPLE_ICON:
- return fillIconWrapper(obj, (IconFieldState *) state);
- break;
- case CONTROL_LABEL:
- return fillLabelWrapper(obj, (LabelFieldState *) state);
- break;
- case CONTROL_BUTTON:
- return fillButtonWrapper(obj, (ButtonFieldState *) state);
- break;
- case CONTROL_EDIT:
- return fillEditWrapper(obj, (EditFieldState *) state);
- break;
+ case CHECKBOX: return scope.Close( Boolean::New(opt->getValueCheckbox()) );
+ case NUMBER: return scope.Close( Int32::New(opt->getValueNumber()) );
+ case TEXT: return scope.Close( String::New((const V8_TCHAR *) opt->getValueText()) );
}
- throw "Unknown type";
-}
-
-Handle<Object> V8Wrappers::createDialogWrapper()
-{
- createDialogTemplate();
-
- Handle<Object> obj = newInstance(DIALOG);
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillWrapper(Handle<Object> obj, DialogState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::newInstance(int type)
-{
- if (templs.find(type) == templs.end())
- throw "Unknown template";
-
- return templs[type]->NewInstance();
-}
-
-Handle<Object> V8Wrappers::createTextWrapper()
-{
- Handle<Object> obj = newInstance(SIMPLE_TEXT);
-
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- Handle<Object> font = newInstance(FONT);
- obj->Set(String::New("font"), font, ReadOnly);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillTextWrapper(Handle<Object> obj, TextFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- Handle<Object> font = Handle<Object>::Cast(obj->Get(String::New("font")));
- font->SetInternalField(0, External::New(state->getFont()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::createIconWrapper()
-{
- Handle<Object> obj = newInstance(SIMPLE_ICON);
-
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillIconWrapper(Handle<Object> obj, IconFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::createImageWrapper()
-{
- Handle<Object> obj = newInstance(SIMPLE_IMAGE);
-
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillImageWrapper(Handle<Object> obj, ImageFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::createLabelWrapper()
-{
- Handle<Object> obj = newInstance(CONTROL_LABEL);
-
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- Handle<Object> font = newInstance(FONT);
- obj->Set(String::New("font"), font, ReadOnly);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillLabelWrapper(Handle<Object> obj, LabelFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- Handle<Object> font = Handle<Object>::Cast(obj->Get(String::New("font")));
- font->SetInternalField(0, External::New(state->getFont()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::createButtonWrapper()
-{
- Handle<Object> obj = newInstance(CONTROL_BUTTON);
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- Handle<Object> font = newInstance(FONT);
- obj->Set(String::New("font"), font, ReadOnly);
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillButtonWrapper(Handle<Object> obj, ButtonFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- Handle<Object> font = Handle<Object>::Cast(obj->Get(String::New("font")));
- font->SetInternalField(0, External::New(state->getFont()));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::createEditWrapper()
-{
- Handle<Object> obj = newInstance(CONTROL_EDIT);
-
- Handle<Object> borders = newInstance(BORDER);
- obj->SetInternalField(1, borders);
-
- Handle<Object> font = newInstance(FONT);
- obj->Set(String::New("font"), font, ReadOnly);
-
- return obj;
+ return scope.Close( Undefined() );
}
-Handle<Object> V8Wrappers::fillEditWrapper(Handle<Object> obj, EditFieldState *state)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(state));
-
- Handle<Object> borders = Handle<Object>::Cast(obj->GetInternalField(1));
- borders->SetInternalField(0, External::New(state->getBorders()));
-
- Handle<Object> font = Handle<Object>::Cast(obj->Get(String::New("font")));
- font->SetInternalField(0, External::New(state->getFont()));
-
- return obj;
-}
-
-void V8Wrappers::clearTemplates()
-{
- templs.clear();
-}
-
-
static Handle<Value> Get_Options_Fields(Local<String> aName, 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() );
SkinOptions *opts = (SkinOptions *) wrap->Value();
if (opts == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
String::AsciiValue name(aName);
if (name.length() <= 0)
- return Undefined();
+ return scope.Close( Undefined() );
bool configure = self->GetInternalField(1)->BooleanValue();
if (configure)
@@ -506,66 +191,76 @@ static Handle<Value> Get_Options_Fields(Local<String> aName, const AccessorInfo opts->addOption(opt);
}
- V8Wrappers wrappers;
- return wrappers.fillWrapper(wrappers.createOptionWrapper(), opt);
+ wrap = Local<External>::Cast(info.Data());
+ if (wrap.IsEmpty())
+ return scope.Close( Undefined() );
+
+ V8Wrappers *wrappers = (V8Wrappers *) wrap->Value();
+ if (wrappers == NULL)
+ return scope.Close( Undefined() );
+
+ Handle<Object> ret = wrappers->newSkinOption();
+ wrappers->fillSkinOption(ret, opt);
+ return scope.Close( ret );
}
else
{
SkinOption * opt = opts->getOption(*name);
- if (opt == NULL)
- return Undefined();
-
- switch (opt->getType())
- {
- case CHECKBOX: return Boolean::New(opt->getValueCheckbox());
- case NUMBER: return Int32::New(opt->getValueNumber());
- case TEXT: return String::New((const V8_TCHAR *) opt->getValueText());
- }
-
- return Undefined();
+ return scope.Close( Get_SkinOption_value(opt) );
}
}
-void V8Wrappers::createOptionsTemplate()
+Handle<ObjectTemplate> V8Wrappers::getOptionsTemplate()
{
- if (templs.find(OPTIONS) != templs.end())
- return;
-
+ HandleScope scope;
+
+ if (!optionsTemplate.IsEmpty())
+ return optionsTemplate;
+
Handle<ObjectTemplate> templ = ObjectTemplate::New();
templ->SetInternalFieldCount(2);
- templ->SetNamedPropertyHandler(&Get_Options_Fields);
- templs[OPTIONS] = templ;
+ templ->SetNamedPropertyHandler(&Get_Options_Fields, 0, 0, 0, 0, External::New(this));
+
+ optionsTemplate = Persistent<ObjectTemplate>::New(templ);
+
+ return optionsTemplate;
+}
+
+Handle<Object> V8Wrappers::newOptions()
+{
+ HandleScope scope;
+
+ Handle<Object> obj = getOptionsTemplate()->NewInstance();
+
+ return scope.Close(obj);
}
-Handle<Object> V8Wrappers::createOptionsWrapper()
+void V8Wrappers::fillOptions(Handle<Object> v8Obj, SkinOptions *obj, bool configure)
{
- createOptionsTemplate();
+ HandleScope scope;
+
+ _ASSERT(!v8Obj.IsEmpty());
- return newInstance(OPTIONS);
+ v8Obj->SetInternalField(0, External::New(obj));
+ v8Obj->SetInternalField(1, Boolean::New(configure));
}
static Handle<Value> Get_SkinOption_value(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() );
- SkinOption *opt = (SkinOption *) wrap->Value();
- if (opt == NULL)
- return Undefined();
-
- switch (opt->getType())
- {
- case CHECKBOX: return Boolean::New(opt->getValueCheckbox());
- case NUMBER: return Int32::New(opt->getValueNumber());
- case TEXT: return String::New((const V8_TCHAR *) opt->getValueText());
- }
- return Undefined();
+ return scope.Close( Get_SkinOption_value((SkinOption *) wrap->Value()) );
}
static void Set_SkinOption_value(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())
@@ -592,42 +287,9 @@ static void Set_SkinOption_value(Local<String> property, Local<Value> value, con }
}
-void V8Wrappers::createOptionTemplate()
+void V8Wrappers::addSkinOptionTemplateFields(Handle<ObjectTemplate> &templ)
{
- if (templs.find(OPTION) != templs.end())
- return;
-
- Handle<ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetInternalFieldCount(1);
- AddSkinOptionAcessors(templ);
+ HandleScope scope;
+
templ->SetAccessor(String::New("value"), Get_SkinOption_value, Set_SkinOption_value);
- templs[OPTION] = templ;
-}
-
-Handle<Object> V8Wrappers::createOptionWrapper()
-{
- createOptionTemplate();
-
- return newInstance(OPTION);
}
-
-Handle<Object> V8Wrappers::fillWrapper(Handle<Object> obj, SkinOptions *opts, bool configure)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(opts));
- obj->SetInternalField(1, Boolean::New(configure));
-
- return obj;
-}
-
-Handle<Object> V8Wrappers::fillWrapper(Handle<Object> obj, SkinOption *opt)
-{
- if (obj.IsEmpty())
- throw "Empty object";
-
- obj->SetInternalField(0, External::New(opt));
-
- return obj;
-}
\ No newline at end of file diff --git a/Plugins/skins/SkinLib/V8Wrappers.h b/Plugins/skins/SkinLib/V8Wrappers.h index 01781f7..4b7a672 100644 --- a/Plugins/skins/SkinLib/V8Wrappers.h +++ b/Plugins/skins/SkinLib/V8Wrappers.h @@ -1,70 +1,27 @@ #ifndef __V8_WRAPPERS_H__
# define __V8_WRAPPERS_H__
-#include <v8.h>
-#include <map>
-#include "DialogState.h"
-#include "TextFieldState.h"
-#include "ImageFieldState.h"
-#include "IconFieldState.h"
-#include "LabelFieldState.h"
-#include "ButtonFieldState.h"
-#include "EditFieldState.h"
+#include "V8Templates.h"
#include "SkinOptions.h"
-#ifdef UNICODE
-# define V8_TCHAR uint16_t
-#else
-# define V8_TCHAR char
-#endif
-class V8Wrappers
+class V8Wrappers : public V8Templates
{
public:
- v8::Handle<v8::Object> createDialogWrapper();
- v8::Handle<v8::Object> createOptionsWrapper();
- v8::Handle<v8::Object> createOptionWrapper();
- v8::Handle<v8::Object> createWrapper(FieldType type);
+ virtual v8::Handle<v8::Object> newState(FieldType type);
+ virtual void fillState(v8::Handle<v8::Object> obj, FieldState *state);
- v8::Handle<v8::Object> fillWrapper(v8::Handle<v8::Object> obj, FieldState *state);
- v8::Handle<v8::Object> fillWrapper(v8::Handle<v8::Object> obj, DialogState *state);
- v8::Handle<v8::Object> fillWrapper(v8::Handle<v8::Object> obj, SkinOptions *opts, bool configure);
- v8::Handle<v8::Object> fillWrapper(v8::Handle<v8::Object> obj, SkinOption *opt);
-
- void clearTemplates();
+ virtual v8::Handle<v8::ObjectTemplate> getOptionsTemplate();
+ virtual v8::Handle<v8::Object> newOptions();
+ virtual void fillOptions(v8::Handle<v8::Object> v8Obj, SkinOptions *obj, bool configure);
private:
- std::map<int, v8::Handle<v8::ObjectTemplate>> templs;
-
- void createDialogTemplate();
- void createOptionsTemplate();
- void createOptionTemplate();
- void createTemplateFor(FieldType type);
-
- void createTextTemplate();
- void createImageTemplate();
- void createIconTemplate();
- void createLabelTemplate();
- void createButtonTemplate();
- void createEditTemplate();
- void createFontTemplate();
- void createBorderTemplate();
-
- v8::Handle<v8::Object> createTextWrapper();
- v8::Handle<v8::Object> createImageWrapper();
- v8::Handle<v8::Object> createIconWrapper();
- v8::Handle<v8::Object> createLabelWrapper();
- v8::Handle<v8::Object> createButtonWrapper();
- v8::Handle<v8::Object> createEditWrapper();
+ v8::Persistent<v8::ObjectTemplate> optionsTemplate;
- v8::Handle<v8::Object> fillTextWrapper(v8::Handle<v8::Object> obj, TextFieldState *state);
- v8::Handle<v8::Object> fillImageWrapper(v8::Handle<v8::Object> obj, ImageFieldState *state);
- v8::Handle<v8::Object> fillIconWrapper(v8::Handle<v8::Object> obj, IconFieldState *state);
- v8::Handle<v8::Object> fillLabelWrapper(v8::Handle<v8::Object> obj, LabelFieldState *state);
- v8::Handle<v8::Object> fillButtonWrapper(v8::Handle<v8::Object> obj, ButtonFieldState *state);
- v8::Handle<v8::Object> fillEditWrapper(v8::Handle<v8::Object> obj, EditFieldState *state);
+protected:
+ virtual void addGlobalTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
- v8::Handle<v8::Object> newInstance(int type);
+ virtual void addSkinOptionTemplateFields(v8::Handle<v8::ObjectTemplate> &templ);
};
diff --git a/Plugins/skins/m_skins_cpp.h b/Plugins/skins/m_skins_cpp.h index a1e5756..1434dc1 100644 --- a/Plugins/skins/m_skins_cpp.h +++ b/Plugins/skins/m_skins_cpp.h @@ -29,7 +29,7 @@ extern struct SKIN_INTERFACE mski; class SkinFieldState
{
public:
- SkinFieldState(SKINNED_FIELD_STATE field) { this->field = field; }
+ SkinFieldState(SKINNED_FIELD_STATE field) : tooltip(NULL) { this->field = field; }
virtual ~SkinFieldState() { if (tooltip != NULL) mir_free(tooltip); }
BOOL isValid() { return field != NULL; }
diff --git a/Plugins/skins/skins.dsp b/Plugins/skins/skins.dsp deleted file mode 100644 index 77a3828..0000000 --- a/Plugins/skins/skins.dsp +++ /dev/null @@ -1,243 +0,0 @@ -# Microsoft Developer Studio Project File - Name="skins" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=skins - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "skins.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "skins.mak" CFG="skins - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "skins - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "skins - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "skins - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "skins - Win32 Unicode Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "skins - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O1 /YX /FD /c
-# SUBTRACT BASE CPP /Fr
-# ADD CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /I "sdk" /D "WIN32" /D "W32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fr /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x417 /d "NDEBUG"
-# ADD RSC /l 0x417 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 user32.lib shell32.lib wininet.lib gdi32.lib /nologo /base:"0x67100000" /dll /machine:I386 /filealign:0x200
-# SUBTRACT BASE LINK32 /pdb:none /map
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib msimg32.lib comctl32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release\Plugins\skins.dll" /pdbtype:sept /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT LINK32 /profile /pdb:none
-
-!ELSEIF "$(CFG)" == "skins - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /FR /YX /FD /c
-# ADD CPP /nologo /G4 /MTd /W3 /GX /ZI /Od /I "../../include" /I "sdk" /D "WIN32" /D "W32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x417 /d "NDEBUG"
-# ADD RSC /l 0x417 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..bin\release\Plugins\skins.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib msimg32.lib comctl32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\skins.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT LINK32 /profile /pdb:none
-
-!ELSEIF "$(CFG)" == "skins - Win32 Unicode Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "skins___Win32_Unicode_Debug"
-# PROP BASE Intermediate_Dir "skins___Win32_Unicode_Debug"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode_Debug"
-# PROP Intermediate_Dir "Unicode_Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G4 /MTd /W3 /GX /ZI /Od /I "../../include" /FR /YX /FD /c
-# ADD CPP /nologo /G4 /MTd /W3 /GX /ZI /Od /I "../../include" /I "sdk" /D "WIN32" /D "W32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x417 /d "NDEBUG"
-# ADD RSC /l 0x417 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\skins.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib msimg32.lib comctl32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\skinsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT LINK32 /profile /pdb:none
-
-!ELSEIF "$(CFG)" == "skins - Win32 Unicode Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "skins___Win32_Unicode_Release"
-# PROP BASE Intermediate_Dir "skins___Win32_Unicode_Release"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode_Release"
-# PROP Intermediate_Dir "Unicode_Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /Fr /YX /FD /c
-# ADD CPP /nologo /G4 /MT /W3 /GX /O2 /Ob0 /I "../../include" /I "sdk" /D "WIN32" /D "W32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /Fr /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x417 /d "NDEBUG"
-# ADD RSC /l 0x417 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\skins.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib msimg32.lib comctl32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release unicode\Plugins\skinsW.dll" /pdbtype:sept /filealign:0x200 /ALIGN:4096 /ignore:4108
-# SUBTRACT LINK32 /profile /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "skins - Win32 Release"
-# Name "skins - Win32 Debug"
-# Name "skins - Win32 Unicode Debug"
-# Name "skins - Win32 Unicode Release"
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\commons.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\m_skins.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\utils\mir_icons.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\utils\mir_memory.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\utils\mir_options.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\options.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\resource.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\resource.rc
-# End Source File
-# End Group
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\utils\mir_icons.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\utils\mir_memory.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\utils\mir_options.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\options.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\skins.cpp
-# End Source File
-# End Group
-# Begin Group "Docs"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\Docs\langpack_skins.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\Docs\skins_changelog.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\Docs\skins_readme.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\Docs\skins_version.txt
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/Plugins/skins/skins.dsw b/Plugins/skins/skins.dsw deleted file mode 100644 index c83b550..0000000 --- a/Plugins/skins/skins.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "skins"=.\skins.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/Plugins/skins/skins.vcproj b/Plugins/skins/skins.vcproj index ab8700d..50a7001 100644 --- a/Plugins/skins/skins.vcproj +++ b/Plugins/skins/skins.vcproj @@ -560,6 +560,10 @@ >
</File>
<File
+ RelativePath=".\SkinLib\V8Templates.h"
+ >
+ </File>
+ <File
RelativePath=".\SkinLib\V8Wrappers.h"
>
</File>
@@ -942,6 +946,10 @@ >
</File>
<File
+ RelativePath=".\SkinLib\V8Templates.cpp"
+ >
+ </File>
+ <File
RelativePath=".\SkinLib\V8Wrappers.cpp"
>
</File>
|