Merge pull request #146 from v-for-vandal/class_p1_fixes2
Class p1 fixes2 - Lua enums and NSpace Disable old-names generation for enums in class in namespace Getattribute->GetFlag Partially disabling old names generation for classes with nspace Working around some of the SWIG internal issues with enums
This commit is contained in:
commit
bf8eb05dbb
3 changed files with 57 additions and 20 deletions
|
|
@ -62,6 +62,18 @@ sc = ns.Outer.SomeClass()
|
|||
assert( sc:GetInner1ColorChannel() ~= sc:GetInner2Channel() )
|
||||
assert( sc:GetInner1Channel() ~= sc:GetInner2Channel() )
|
||||
|
||||
-- Backward compatibility
|
||||
assert(ns.Outer.Inner1.Diffuse ~= nil)
|
||||
-- Enums within class within namespace shouldn't have backward compatible name. Same for static methods
|
||||
assert(ns.Outer.Inner1.Color_Diffuse == nil)
|
||||
assert(ns.Outer.Inner1.Color_colorStaticMethod == nil)
|
||||
|
||||
|
||||
-- Enums and static methods of class marked as %nonspace should have backward compatible name
|
||||
assert(ns.NoNSpacePlease_noNspaceStaticFunc() == 10)
|
||||
assert(ns.Outer.Inner2.NoNSpacePlease_NoNspace == nil)
|
||||
-- ReallyNoNSpaceEnum is wrapped into %nonspace and thus handled correctly.
|
||||
-- NoNSpaceEnum is not (although both of them are in %nonspace-wrapped class) and thus
|
||||
-- handled rather unexpectedly
|
||||
assert(ns.NoNSpacePlease_ReallyNoNspace1 == 1)
|
||||
assert(ns.NoNSpacePlease.ReallyNoNspace2 == 10)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
|
|||
|
||||
%nspace;
|
||||
%nonspace Outer::Inner2::NoNSpacePlease;
|
||||
%nonspace Outer::Inner2::NoNSpacePlease::ReallyNoNSpaceEnum;
|
||||
|
||||
%copyctor;
|
||||
%ignore Outer::Inner2::Color::Color();
|
||||
|
|
@ -67,7 +68,12 @@ namespace Outer {
|
|||
const Outer::Inner2::Color& col2c) {}
|
||||
}; // Color
|
||||
int Color::staticMemberVariable = 0;
|
||||
class NoNSpacePlease {};
|
||||
class NoNSpacePlease {
|
||||
public:
|
||||
enum NoNSpaceEnum { NoNspace1 = 1, NoNspace2 = 10 };
|
||||
enum ReallyNoNSpaceEnum { ReallyNoNspace1 = 1, ReallyNoNspace2 = 10 };
|
||||
static int noNspaceStaticFunc() { return 10; }
|
||||
};
|
||||
} // Inner2
|
||||
|
||||
// Derived class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue