diff --git a/jsvar.d b/jsvar.d index ad13b21..1d7bf4c 100644 --- a/jsvar.d +++ b/jsvar.d @@ -1722,7 +1722,7 @@ WrappedNativeObject wrapNativeObject(Class)(Class obj) if(is(Class == class)) { } import std.traits; -class WrappedOpaque(T) : PrototypeObject if(isPointer!T) { +class WrappedOpaque(T) : PrototypeObject if(isPointer!T || is(T == class)) { T wrapped; this(T t) { wrapped = t; @@ -1731,7 +1731,7 @@ class WrappedOpaque(T) : PrototypeObject if(isPointer!T) { return wrapped; } } -class WrappedOpaque(T) : PrototypeObject if(!isPointer!T) { +class WrappedOpaque(T) : PrototypeObject if(!isPointer!T && !is(T == class)) { T* wrapped; this(T t) { wrapped = new T; diff --git a/minigui_xml.d b/minigui_xml.d index b3ef8ef..bd8204f 100644 --- a/minigui_xml.d +++ b/minigui_xml.d @@ -109,8 +109,14 @@ void loadMiniguiPublicClasses() { Parameters!(__traits(getMember, Member, "__ctor")) params; foreach(idx, param; params[0 .. $-1]) { - if(auto arg = paramNames[idx] in args) - params[idx] = to!(typeof(param))(*arg); + if(auto arg = paramNames[idx] in args) { + static if(is(typeof(param) == MemoryImage)) { + + } else static if(is(typeof(param) == Color)) { + params[idx] = Color.fromString(*arg); + } else + params[idx] = to!(typeof(param))(*arg); + } } params[$-1] = parent;