Add support for %nspace when using directors - C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12892 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
debd5e9246
commit
11185e66b1
4 changed files with 45 additions and 5 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Version 2.0.5 (in progress)
|
||||
===========================
|
||||
|
||||
2012-01-07: wsfulton
|
||||
[C#] Add support for %nspace when using directors.
|
||||
|
||||
2012-01-06: wsfulton
|
||||
[Java] Patch #3452560 from Brant Kyser - add support for %nspace when using directors.
|
||||
|
||||
|
|
|
|||
32
Examples/test-suite/csharp/director_nspace_runme.cs
Normal file
32
Examples/test-suite/csharp/director_nspace_runme.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
using System;
|
||||
using director_nspaceNamespace;
|
||||
|
||||
public class bools_runme {
|
||||
|
||||
public static void Main() {
|
||||
}
|
||||
}
|
||||
|
||||
class director_nspace_MyBarFoo : director_nspaceNamespace.Bar.Foo {
|
||||
|
||||
public override String ping() {
|
||||
return "director_nspace_MyBarFoo.ping();";
|
||||
}
|
||||
|
||||
public override String pong() {
|
||||
return "director_nspace_MyBarFoo.pong();" + ping();
|
||||
}
|
||||
|
||||
public override String fooBar(director_nspaceNamespace.Bar.FooBar fooBar) {
|
||||
return fooBar.FooBarDo();
|
||||
}
|
||||
|
||||
public override director_nspaceNamespace.Bar.Foo makeFoo() {
|
||||
return new director_nspaceNamespace.Bar.Foo();
|
||||
}
|
||||
|
||||
public override director_nspaceNamespace.Bar.FooBar makeFooBar() {
|
||||
return new director_nspaceNamespace.Bar.FooBar();
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ namespace Bar
|
|||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "Bar::Foo::ping()"; }
|
||||
virtual std::string pong() { return "Bar::Foo::pong();" + ping(); }
|
||||
virtual std::string fooBar(FooBar* fooBar) { return fooBar->FooBarDo(); }
|
||||
virtual std::string fooBar(FooBar* fb) { return fb->FooBarDo(); }
|
||||
virtual Foo makeFoo() { return Foo(); }
|
||||
virtual FooBar makeFooBar() { return FooBar(); }
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ namespace Bar
|
|||
virtual ~Foo();
|
||||
virtual std::string ping();
|
||||
virtual std::string pong();
|
||||
virtual std::string fooBar(FooBar* fooBar);
|
||||
virtual std::string fooBar(FooBar* fb);
|
||||
virtual Foo makeFoo();
|
||||
virtual FooBar makeFooBar();
|
||||
|
||||
|
|
|
|||
|
|
@ -3396,12 +3396,16 @@ public:
|
|||
String *swig_director_connect = Swig_name_member(getNSpace(), proxy_class_name, "director_connect");
|
||||
String *wname = Swig_name_wrapper(swig_director_connect);
|
||||
String *sym_name = Getattr(n, "sym:name");
|
||||
Wrapper *code_wrap;
|
||||
String *qualified_classname = Copy(sym_name);
|
||||
String *nspace = getNSpace();
|
||||
|
||||
if (nspace)
|
||||
Insert(qualified_classname, 0, NewStringf("%s.", nspace));
|
||||
|
||||
Printv(imclass_class_code, "\n [DllImport(\"", dllimport, "\", EntryPoint=\"", wname, "\")]\n", NIL);
|
||||
Printf(imclass_class_code, " public static extern void %s(HandleRef jarg1", swig_director_connect);
|
||||
|
||||
code_wrap = NewWrapper();
|
||||
Wrapper *code_wrap = NewWrapper();
|
||||
Printf(code_wrap->def, "SWIGEXPORT void SWIGSTDCALL %s(void *objarg", wname);
|
||||
|
||||
Printf(code_wrap->code, " %s *obj = (%s *)objarg;\n", norm_name, norm_name);
|
||||
|
|
@ -3419,7 +3423,7 @@ public:
|
|||
Printf(code_wrap->code, ", ");
|
||||
Printf(code_wrap->def, "SwigDirector_%s::SWIG_Callback%s_t callback%s", sym_name, methid, methid);
|
||||
Printf(code_wrap->code, "callback%s", methid);
|
||||
Printf(imclass_class_code, ", %s.SwigDelegate%s_%s delegate%s", sym_name, sym_name, methid, methid);
|
||||
Printf(imclass_class_code, ", %s.SwigDelegate%s_%s delegate%s", qualified_classname, sym_name, methid, methid);
|
||||
}
|
||||
|
||||
Printf(code_wrap->def, ") {\n");
|
||||
|
|
@ -3433,6 +3437,7 @@ public:
|
|||
|
||||
Delete(wname);
|
||||
Delete(swig_director_connect);
|
||||
Delete(qualified_classname);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue