Commit graph

318 commits

Author SHA1 Message Date
William S Fulton
21ee09fc19 Multiple inheritance warning wording tweak 2016-03-06 10:45:39 +00:00
William S Fulton
7d76617dc3 Add checks for interface name symbol clashes 2016-03-03 22:48:35 +00:00
William S Fulton
a1245ef398 Re-organization of the interface feature common code
Move code to new feature.cxx file.
Activate it in the allocate phase rather than in individual languages.
2016-03-03 08:55:20 +00:00
William S Fulton
14d2341512 Add $interfacename family of special variable expansions
This is a simple expansion expanding to the name of the interface and is
not qualified like $javainterfacename and $csinterfacename.
Expansion within typemaps is much like $javainterfacename otherwise.
Note that expansion within the pure java code typemap,
'javainterfacecode' and similarly pure C# code typemap,
'csinterfacecode' works like $javaclassname/$csclassname and
$&interfacename should not be used, just $interfacename.
2016-02-29 21:18:42 +00:00
William S Fulton
c71dba5021 Interface name handling improvements and special variable changes
Support expansion of name attribute in: %feature("interface", name="%s")
%s expands to the proxy class name and all the usual %rename functions
can be used (regex, strip, camelcase etc) to derive the interface name
from the proxy class name.
Rename $interfacename family of special variables to $javainterfacename for Java
Rename $interfacename family of special variables to $csinterfacename for C#
This is to free up $interfacename for simple interface name expansion in forthcoming commit
2016-02-29 20:18:01 +00:00
William S Fulton
50fec04759 Support namespaces and nspace with the interface feature for Java 2016-02-26 18:17:14 +00:00
William S Fulton
1737fc9b9b Add Java premature garbage collection prevention parameter (pgcpp) to interface feature
pgcpp was turned off but it is still needed for the interface feature
to prevent premature garbage collection of the proxy class being passed
into the C++ layer.
2016-02-24 08:30:10 +00:00
William S Fulton
e7bb3afa0c Create javainterfacecode and csinterfacecode typemaps
The interface feature is no longer hard coded and can
be controlled by a user via these new typemaps.
2016-02-23 07:30:00 +00:00
William S Fulton
c33b4dc34e Improve interface feature checks
Use common code for missing feature:interface:name attribute checks
Check that all base classes are also marked as interfaces
2016-02-13 13:03:40 +00:00
William S Fulton
645147a5b2 Comments added to interface feature implementation and cosmetic code changes 2016-02-12 20:23:35 +00:00
William S Fulton
fc4be01106 Refactor multiple inheritance warnings
Slightly simplify choosing single base class when handling
multiple inheritance and make consistent across more languages.
Modula3 multiple inheritance warnings now warn for all bases
2016-02-12 08:45:22 +00:00
Vladimir Kalinin
5768d87deb director generation fixes
Conflicts:
	Lib/java/feature_interface.i
	Source/Modules/csharp.cxx
	Source/Modules/java.cxx
2016-02-12 07:09:17 +00:00
William S Fulton
212300c62b interfaces branch merge fixes 2016-02-11 20:21:25 +00:00
William S Fulton
abccc13a4a Merge branch 'interfaces' into interfaces2
* interfaces:
  Remove unnecessary interfaces for concrete classes
  cosmetic code formatting changes
  Correct interface name attributes that are internal
  interface macro changes to support templates
  Test non-virtual method in Derived classes
  interface tests for a most derived class inheriting the interfaces further up the chain
  Rename GetCPtr/getCPtr to SWIGInterfaceUpcast
  interface feature support for const ref pointers (used by the STL)
  Interface feature support for arrays
  More interface feature testing for return values
  interface feature support for passing by value
  interface feature support for references
  Multiple inheritance parameters as pointers testing
  Simplify multiple_inheritance_abstract Java runtime test
  Warning fixes
  Rename test functions in multiple_inheritance_abstract testcase
  Formatting fixes in generated code for interface feature
  Cosmetic spacing changes in test case
  interface feature typemap corrections to handle NULL pointers
  interface test added
  javadirectorin fix
  interface implementation visibility
  interface inheritance (2)
  interface inheritance (1)
  feature:interface ported to Java
  propagate non-abstract "interface" base methods (3)
  propagate non-abstract "interface" base methods (2)
  propagate non-abstract "interface" base methods (1)
  namespace support added GetCPtr now returns HandleRef "feature:interface:name" is now mandatory attribute
  interfaces (1)
  interfaces (1)

Conflicts:
	Source/Modules/csharp.cxx
	Source/Modules/java.cxx
2016-02-11 19:37:31 +00:00
William S Fulton
3931b5800c Remove unnecessary interfaces for concrete classes
Add Java test for checking expected base and interfaces are generated (to be expanded further)
In the example, E was previously implementing IA, IB, IC. Now it doesn't implement any.
C# virtual/override still to be fixed for this test case
2016-02-10 20:54:39 +00:00
William S Fulton
993214872f cosmetic code formatting changes 2016-02-09 07:39:46 +00:00
William S Fulton
dd6af222f4 Correct interface name attributes that are internal
Attributes with 'feature:' prefix are reserved for %feature, not internal usage.
2016-02-09 07:22:07 +00:00
William S Fulton
72e5c221b6 Rename GetCPtr/getCPtr to SWIGInterfaceUpcast
This is then similarly named to other similar functions:
SWIGUpcast and SWIGSmartPtrUpcast
2016-02-08 20:49:46 +00:00
William S Fulton
f78b9264b8 Warning fixes 2016-02-06 16:34:33 +00:00
William S Fulton
a7370b7bc0 Formatting fixes in generated code for interface feature 2016-02-06 16:34:24 +00:00
Petre Eftime
0a07cd4c30 Prevent redefinition warnings when compiling with SWIG<module> defined
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
2015-12-22 14:33:21 +02:00
William S Fulton
faeaacf112 smartptr feature support - factor out common code 2015-09-25 22:57:59 +01:00
Anbiru Shouta
977240b3f4 Clearer variable name in Java director generated code
Closes #463
2015-07-17 22:34:08 +01:00
William S Fulton
775afd3579 Refactor Java director swig_override array code
Remove code duplication: Use new Swig::BoolArray to replace multiple
instances of ZeroedBoolArray.

Refactors #403 and #413.
2015-05-10 11:40:42 +01:00
Lindley French
8f19d77fec Don't include an STL header in SWIG. 2015-05-07 11:29:47 -07:00
Lindley French
159b3c7958 Use a bitset which is automatically initialized to 0, instead of a bool array which is not. 2015-05-06 11:33:28 -07:00
Lindley French
5f0181bfdd Too hard to conditionally define the memset....instead just make sure the array is defined even if it's unused. 2015-05-01 12:40:07 -07:00
Lindley French
e8ca8fb2e6 Only output memset if the array exists. 2015-04-30 23:14:48 -07:00
Lindley French
8acca78953 Zero-initialize swig_override in the director constructor. 2015-04-30 21:16:30 -07:00
Olly Betts
2c08e33099 Correct java warning to save javabase not csbase 2015-03-27 12:30:19 +13:00
Olly Betts
7ba0652677 Create director_common.swg for language-indep code
Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for
all languages with director support, not just Python and PHP.
2015-03-12 19:51:11 +13:00
William S Fulton
2e01533b23 Partial support for %constant and structs
Test case is slightly modified from the test case in issue #250

Use of constant objects does not seem to work in Python - the type is
SwigPyObject instead of constant_directive.Type1.
2014-12-18 07:01:08 +00:00
William S Fulton
0664ecdeb7 Fix strongly typed enums for Java when using simple enum wrappers 2014-11-24 07:04:54 +00:00
William S Fulton
fcef37d682 Fix incorrect symbol clash error in C# and Java when using %rename for enums
When using using 'simple enum' wrappers
2014-11-21 19:50:23 +00:00
William S Fulton
ede58b8744 Cosmetic formatting 2014-11-21 18:58:08 +00:00
William S Fulton
296d45aec5 Merge branch 'alexey-pelykh-cpp11_strongly_typed_enums__direct_inject_in_java'
* alexey-pelykh-cpp11_strongly_typed_enums__direct_inject_in_java:
  Enhance cpp11_strongly_typed_enumerations testcase and turn it on
  Simplify/improve strongly typed enum implementation for Java
  Rewrite some Java director nested class support code for strongly typed enums
  Expand director_nested_class test to test more than one level of nesting
  Add director_nested_class testcase
  Removed useless code (it does not affect output, at least on our testcases)
  Java/Fix: swig_connect_director used not-fully-qualified classname (proper)
  Java/Fix: swig_connect_director used not-fully-qualified classname
  Java: fix generation of ProxyName when JNI descriptor is requested - for inner classes '$' should be used as separator instead of '/'
  Java: fix invalid director 'self' variable type name (wasn't fully qualified)
  Clean-up test suite and fix issue with nspace, as well as keep the fix for Class::Struct::EnumClass being JNI-referenced as Struct_EnumClass
  C++11 strongly-typed enums fix for Java only (proper)
  Revert "C++11 strongly-typed enums fix for Java only"
  Additional test cases for C++11 strongly-typed enums
  C++11 strongly-typed enums fix for Java only
2014-11-21 07:34:12 +00:00
William S Fulton
77b338151e Simplify/improve strongly typed enum implementation for Java 2014-11-21 07:32:15 +00:00
William S Fulton
089865ba57 Rewrite some Java director nested class support code for strongly typed enums 2014-11-20 07:26:09 +00:00
Alexey Pelykh
837d2bfd04 Removed useless code (it does not affect output, at least on our testcases) 2014-11-03 12:10:10 +02:00
William S Fulton
6029b2f7d8 Fix for 'self' being used as a parameter name 2014-10-30 07:22:59 +00:00
William S Fulton
36ae32e941 Merge remote-tracking branch 'vadz/py-args'
* vadz/py-args:
  Allow using enum elements as default values for Python functions.
  Don't always use "*args" for all Python wrapper functions.
  No real changes, just make PYTHON::check_kwargs() const.
  Refactor: move makeParameterName() to common Language base class.
  Remove long line wrapping from Python parameter list generation code.
2014-10-27 20:02:59 +00:00
William S Fulton
b57a675d00 Cosmetic comment changes
Note: copyrights are in the COPYRIGHT file
2014-10-21 07:34:51 +01:00
Alexey Pelykh
afbb47dc8f Java/Fix: swig_connect_director used not-fully-qualified classname (proper) 2014-09-04 12:22:56 +03:00
Alexey Pelykh
8a69da7d82 Java/Fix: swig_connect_director used not-fully-qualified classname 2014-09-04 12:05:23 +03:00
Alexey Pelykh
e7db081d5e Java: fix generation of ProxyName when JNI descriptor is requested - for inner classes '$' should be used as separator instead of '/' 2014-09-03 09:37:25 +03:00
Alexey Pelykh
7b9027db89 Java: fix invalid director 'self' variable type name (wasn't fully qualified) 2014-08-31 19:26:31 +03:00
Alexey Pelykh
abb888cfdd Clean-up test suite and fix issue with nspace, as well as keep the fix for Class::Struct::EnumClass being JNI-referenced as Struct_EnumClass 2014-08-31 12:14:29 +03:00
Alexey Pelykh
d318f03efe C++11 strongly-typed enums fix for Java only (proper) 2014-08-30 11:58:52 +03:00
Alexey Pelykh
fd926cf284 Revert "C++11 strongly-typed enums fix for Java only"
This reverts commit cf139a90db.
2014-08-30 09:15:25 +03:00
Alexey Pelykh
cf139a90db C++11 strongly-typed enums fix for Java only 2014-08-29 19:39:39 +03:00